From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C7A3D1FF165 for ; Thu, 23 Oct 2025 15:08:37 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4F394AA59; Thu, 23 Oct 2025 15:09:04 +0200 (CEST) Message-ID: <1447bbf1-4dc2-49db-9535-e33bc23f5444@proxmox.com> Date: Thu, 23 Oct 2025 15:08:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta From: Dominik Csapak To: pve-devel@lists.proxmox.com References: <20250812100009.1613204-1-d.csapak@proxmox.com> Content-Language: en-US In-Reply-To: <20250812100009.1613204-1-d.csapak@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761224903041 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] superseded: [RFC PATCH qemu-server] pci: add 'keep-driver' option X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" superseded by: https://lore.proxmox.com/pve-devel/20251023130641.4190006-1-d.csapak@proxmox.com/T/#u On 8/12/25 11:59 AM, Dominik Csapak wrote: > by default, pci devices will be bound to 'vfio-pci' driver and reset. > For most devices this is necessary, but there are a few exceptions, > e.g.: > > * some mellanox nics have support for the driver 'mlx5_vfio_pci' > * intel flex gpus have support for 'i915_vfio_pci' > * (maybe some more i don't know about) > > both of these drivers play the role of the vfio-pci drivers themselves, > so no rebinding or resetting necessary. Those drivers usually have more > functionality than the default vfio driver, like support for > live-migration. > > To be able to configure that on our side, introduce the 'keep-driver' > option for 'hostpciX', which will not rebind/reset the device. > > Signed-off-by: Dominik Csapak > --- > sending as RFC, since i'm not sure if we want to go this (generic) > approach, or if we e.g. want to make special configs/cases for driver we > know. Pro of this approach is that we don't have to add more drivers in > the future, but con is that it has some potential to confuse users when > it does not work the way they though it would. > > src/PVE/QemuServer/PCI.pm | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/QemuServer/PCI.pm b/src/PVE/QemuServer/PCI.pm > index e7a9a610..84a56998 100644 > --- a/src/PVE/QemuServer/PCI.pm > +++ b/src/PVE/QemuServer/PCI.pm > @@ -124,6 +124,13 @@ EODESCR > optional => 1, > description => "Override PCI subsystem device ID visible to guest", > }, > + 'keep-driver' => { > + type => 'boolean', > + optional => 1, > + default => 0, > + description => "If this is set, does not bind the device to vfio-pci and does not reset" > + . "the device. Useful for VF that already have the correct driver loaded.", > + }, > }; > PVE::JSONSchema::register_format('pve-qm-hostpci', $hostpci_fmt); > > @@ -736,7 +743,7 @@ sub prepare_pci_device { > if !PVE::SysFSTools::check_iommu_support(); > die "no pci device info for device '$pciid'\n" if !$info; > > - if ($device->{nvidia}) { > + if ($device->{nvidia} || $device->{'keep-driver'}) { > # nothing to do > } elsif (my $mdev = $device->{mdev}) { > my $uuid = generate_mdev_uuid($vmid, $index); _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel