Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp38486rbe; Wed, 28 Feb 2024 11:16:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXzHLBVu3mcAX/9lCzBzmWLzcYRrYPKwHX2R0eZBZ+waTWklFmffyeCAJ50b5EaPc7HtSuEL4XZbTUiaH/GysK8q2t4zBRYGaAxU+bojw== X-Google-Smtp-Source: AGHT+IFGlYg8C2D+ycAn8USD9VZgV2U8EXtE1ppd2ADyYcP1bv+2RbtL1uLAmXsvDNzRbKzlDv+6 X-Received: by 2002:a05:6602:641d:b0:7c7:cd3b:9e69 with SMTP id gn29-20020a056602641d00b007c7cd3b9e69mr165481iob.3.1709147806151; Wed, 28 Feb 2024 11:16:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709147806; cv=pass; d=google.com; s=arc-20160816; b=mXmyQ63gTwfR9fUUBPmDIX0lGW4oKwbJVDw46o9QpAKa4F9cq5DZED7UYkfMV43+H7 s44Qa9/OoiAG5RcmobsLqJwSfbQAoQBjUFbOx4DgRGZ1FAoMP7/Tgv3MN3A/fU1zn2/K zCAtaz0EJf/C4x1EfvWYTtN7WpzYVgfAl4zZ/MNe75PtLESq3ecST6TmOIElfozwVRqt G1xj/AwNy2aBw0jo4BOar2Ypi0bZ61zHaPmOnKpd/rt3M9xVRXnjakUBWivibxCGMnUD HpJkCWHOVUjvet/zFIXqWTQVRwSL0m1I1HJ41C7zI9y28/mjA672uiLpTod3139qDqx2 A5mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=rYV4SrxcohGt3HtzPUZ+rdkqbt8EWPpbUaoKo3V+foI=; fh=G38WzsagXyyXeY1VrrmWRXgyGDtH73eXKWRvS31AHe8=; b=vPMv1DxKLSTvV5GC9TSP0dUe3MXQzXCpfI5haLc2gyKkRBaq69Utmhlu9M7B0oudFv p91FWiGAtVHsIANfi/cqG4JjVh4Uf5eOObQ3GnMT3gSLozMQY5/bdWs+iboXYFsMVZB6 uW/a0dnJRkOl+vGwOu+AGsxphd7l+WZQEbDti5N48sq3MO24U1SfCovXh4SvLoWkyOFd PdXfpc+9/RbwaboyHaJDQJz6ttyIT+bXCUhCUsnJUEDingyetGeDxdsIk17vIpFNNg8e 6z2+ZhSTdH5mFdd1VLkIeBcWjKr7aLkSoF0swg7M5S4ZOz2DMCPCgaidOJ6iPNhoAiQZ 8RTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b6IR6NnT; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-crypto+bounces-2375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2375-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e14-20020a63e00e000000b005e46d335070si134015pgh.203.2024.02.28.11.16.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 11:16:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b6IR6NnT; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-crypto+bounces-2375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2375-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 30DB9B221C5 for ; Wed, 28 Feb 2024 19:07:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB7F779B74; Wed, 28 Feb 2024 19:07:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="b6IR6NnT" X-Original-To: linux-crypto@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6A4671EB9 for ; Wed, 28 Feb 2024 19:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709147239; cv=none; b=e5HFWJrNGFvslpwtO6wj/Y/g+OlOrbIJPbhnOijOYf2ViFjnT1ipJTW+vRya1h8+oBVIOKui20ci8S+6nq/7ErKQYADRcH9u/1svLkgb/5gakLjnAo4/8mQ/X4T2cDeSt3tJ9oNruWqNA9pACuOEPgGvwyOedKdqLxdcpscp6uY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709147239; c=relaxed/simple; bh=Qz2Vdj2rBC2mJZbNt9ILBRIAFfLJFVWy5MELjmgC5jo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VrqcO///ZcOQXWJoNVq68q/L4bNzvjGEXFacBTPH3e1jF+9tC6jb0CRuigu3IZv2sprJtKw+1IFCIw48KXQYZmK1xfViM3PExZ6yGjoGZZTILYYosC8rmGvA4pPKhCyilfTaNtM+wrDRY7Gs8AZ6oQHlWQ8y0T4LfdwBeKOgfos= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=b6IR6NnT; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709147236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rYV4SrxcohGt3HtzPUZ+rdkqbt8EWPpbUaoKo3V+foI=; b=b6IR6NnTAiiJfACCD7pQhVZY8mnAu67FqItpzgL0uGBR14TFGw69q2YKuKjzWWLiGPSCBZ +9f9UNgNVJLtD9yMljjuQg3EShhbGK3d8gwB9HbxFCMEljoGFj3KPf8YzF6IaLIT1jJfH6 q/kahHO3zaVnx9VsdBdyGEKqMERRb9k= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-594-mzeSPoI_PZ6055kU9_9R1g-1; Wed, 28 Feb 2024 14:07:11 -0500 X-MC-Unique: mzeSPoI_PZ6055kU9_9R1g-1 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-7c7e21711d0so1530839f.3 for ; Wed, 28 Feb 2024 11:07:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709147230; x=1709752030; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rYV4SrxcohGt3HtzPUZ+rdkqbt8EWPpbUaoKo3V+foI=; b=ssVpQPD2TVuz2uYN+QutrWXFq74EvqoqXPAxBtw+w6Gf8J6ZWZb8yc+CZzGscXmVJD 5K4SqW+sXsjpfK6t0JRIfqilFH1rPo6VNp+wiPs0i4QkrI4lUreOjgFmiVHLc56W0VuD ZZJWwJGGe7rrgRywl3Z/eIe5bYO2lj7cUYGIlfF9JzByZ9P31J6VMDd6V5l+XW2O+Mgp NglZCBzl/JkFYE1236y0qNZgi13LMwXl08NzORjIB+bNmKVDnMdV1JhdJaDI8YyTJTB+ 5KRMwEXkHoV3QDmnvps83/DQhcL26pfX7dzISHUStWbhvWPGR6mRcjDsC8ythitGMm0S jSoQ== X-Forwarded-Encrypted: i=1; AJvYcCUb7WP5XLHpn/6COcnM1/FhUC+Kv5On7UqExPyuMx5lp7gmNHRRsy0X5Je/+WT2Fm6jeM8SNKjRYJFqcgVCuJn5O10KehOTU23Bl3Uq X-Gm-Message-State: AOJu0YwXwHxBfucabqtqCw5gEjgu0YOFrODjLtk+E6PBz4bAO0DNX/KK L4lcaN0fG7J3WUX30H8PF8fAw56Y6SXi7SP440lPgPh+FwcW3VmHCue7ShdukumsrctZyQaznH3 IYsIyAzpT5KcpvjvgcK/7xbetNWPZxNPNjqfOqC7E48hp2w8BIj5N5iQjzItCKA== X-Received: by 2002:a5e:c249:0:b0:7c7:8fda:e836 with SMTP id w9-20020a5ec249000000b007c78fdae836mr120305iop.0.1709147230206; Wed, 28 Feb 2024 11:07:10 -0800 (PST) X-Received: by 2002:a5e:c249:0:b0:7c7:8fda:e836 with SMTP id w9-20020a5ec249000000b007c78fdae836mr120281iop.0.1709147229895; Wed, 28 Feb 2024 11:07:09 -0800 (PST) Received: from redhat.com ([38.15.36.11]) by smtp.gmail.com with ESMTPSA id eh3-20020a056638298300b0047466fd3b1dsm2360704jab.22.2024.02.28.11.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 11:07:09 -0800 (PST) Date: Wed, 28 Feb 2024 12:07:06 -0700 From: Alex Williamson To: Jason Gunthorpe Cc: Xin Zeng , herbert@gondor.apana.org.au, yishaih@nvidia.com, shameerali.kolothum.thodi@huawei.com, kevin.tian@intel.com, linux-crypto@vger.kernel.org, kvm@vger.kernel.org, qat-linux@intel.com, Yahui Cao Subject: Re: [PATCH v3 10/10] vfio/qat: Add vfio_pci driver for Intel QAT VF devices Message-ID: <20240228120706.715bc385.alex.williamson@redhat.com> In-Reply-To: <20240226152458.2b8a0f83.alex.williamson@redhat.com> References: <20240221155008.960369-1-xin.zeng@intel.com> <20240221155008.960369-11-xin.zeng@intel.com> <20240226115556.3f494157.alex.williamson@redhat.com> <20240226191220.GM13330@nvidia.com> <20240226124107.4317b3c3.alex.williamson@redhat.com> <20240226194952.GO13330@nvidia.com> <20240226152458.2b8a0f83.alex.williamson@redhat.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 26 Feb 2024 15:24:58 -0700 Alex Williamson wrote: > On Mon, 26 Feb 2024 15:49:52 -0400 > Jason Gunthorpe wrote: > > > On Mon, Feb 26, 2024 at 12:41:07PM -0700, Alex Williamson wrote: > > > On Mon, 26 Feb 2024 15:12:20 -0400 > > > libvirt recently implemented support for managed="yes" with variant > > > drivers where it will find the best "vfio_pci" driver for a device > > > using an algorithm like Max suggested, but in practice it's not clear > > > how useful that will be considering devices likes CX7 require > > > configuration before binding to the variant driver. libvirt has no > > > hooks to specify or perform configuration at that point. > > > > I don't think this is fully accurate (or at least not what was > > intended), the VFIO device can be configured any time up until the VM > > mlx5 driver reaches the device startup. > > > > Is something preventing this? Did we accidentally cache the migratable > > flag in vfio or something?? > > I don't think so, I think this was just the policy we had decided > relative to profiling VFs when they're created rather than providing a > means to do it though a common vfio variant driver interface[1]. Turns out that yes, migration support needs to be established at probe time. vfio_pci_core_register_device() expects migration_flags, mig_ops, and log_ops to all be established by this point, which for mlx5-vfio-pci occurs when the .init function calls mlx5vf_cmd_set_migratable(). So the VF does indeed need to be "profiled" to enabled migration prior to binding to the mlx5-vfio-pci driver in order to report support. That also makes me wonder what happens if migration support is disabled via devlink after binding the VF to mlx5-vfio-pci. Arguably this could be considered user error, but what's the failure mode and support implication? Thanks, Alex