[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v13 1/2] arm/pci: add pci_passhtrough_enabled check to pci_device_reset
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
- Date: Wed, 16 Jul 2025 07:43:46 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uUG6Cwb8smWEtMNxtDvE6ueGOwnA6LFWxhVRoCwAz1E=; b=By7GH5VByg4mf30cgVBlHFdubQUoctygsL08xWPD/RtFphjyIzPOse67knEfYGj+8/wVNc0uNgPh86aZm6KI8N5Wsfk3BYLDWif+3LHtVm3GmkJfHIWDY768Ox6iZCHc7yJ35M/561cEPnoFxjXLbvz/pQQB5yRtShQZxTXv6zH3LpimlSDcJW6RP4N+gKdUBbM4vfBfSZ78B1tmVCJgf9MqrQF4cHguiHD/3G0e870B39JpTTG1yWO2S4x7G3dvoAA8GOUtCBruT5T67yhGjfqyM0QmhMitc669GH5hq4W5B3UotdhZ0ojHdON6Qh6R0hv611JiOEe6zl2po1vSLA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fqj3LKDab5dT7WYO5sB7+ndl6GlJFOktoRT/3rny8YGLOQ75RUw2AjT9orSLu8j7YY0pAF3NgTnuTZp0vls8iao6KfkqUb+o3faiesLlqksdM5UzpThACd56m5ZI90r/3Yomn2ohyJcvF1l01/ZskVusc11igQtqbAZBz8O91Asw1cnmguKppg8k/Vw912X1jfSw5iKuT6JDR3oat1VT8WNHBCi4KX1ky+WjFfcaI0oinY/HpHyvF2rDWcQT8JbO+xcxAeWDAjccmWD3zljjZlZbI1oqMrLUc1g52B+XTpDr206JgyQefDcRLlElnweyHT2Fq0P3xghUfzu9tK+kmg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Wed, 16 Jul 2025 07:43:56 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHb9iVc9+KBe39cBkCCdxD6apzzJg==
- Thread-topic: [PATCH v13 1/2] arm/pci: add pci_passhtrough_enabled check to pci_device_reset
Without pci-passthrough=on Xen does not know anything about present PCI
devices due to PHYSDEVOP_pci_device_add not executing. This causes
PHYSDEVOP_pci_device_reset to fail when trying to find the device that
is being reset and return ENODEV.
Add explicit is_pci_passthrough_enabled check to return a more
meaningful EOPNOTSUPP code.
Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
---
xen/drivers/pci/physdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/xen/drivers/pci/physdev.c b/xen/drivers/pci/physdev.c
index 0161a85e1e..78de67ec64 100644
--- a/xen/drivers/pci/physdev.c
+++ b/xen/drivers/pci/physdev.c
@@ -74,6 +74,9 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void)
arg)
struct pci_dev *pdev;
pci_sbdf_t sbdf;
+ if ( !is_pci_passthrough_enabled() )
+ return -EOPNOTSUPP;
+
ret = -EFAULT;
if ( copy_from_guest(&dev_reset, arg, 1) != 0 )
break;
--
2.34.1
|