[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v14 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: Thu, 24 Jul 2025 09:44:36 +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=e3Lzd6Ut+0ZWOMVOO4BXgKBe6Ygl66u/G3PvJNdmwTE=; b=sQftOSJu+/SGhEIGR9veFFxRFn36SKP4uH/yfmaAGEgylZDis9NMFl7xGznv9IkasKQRMhWbn0IR5/g/kShJS/n0GiAAIuScs+4JfH7IxZbpTsSZXVrLl73ZfTFhxTUTIogYundW+yWG+xL3ljloVSsYQv7t2G8qTHvaqTv4+f7Yp+H3X95L/36RueedWVib0afETjl6IKyYDeOX4Xure/to+9trZqXnSZTselEsv2ycF7/qJSnZavuWISOxThpW50wMHQ+P08Bkf28KPRGvlNUgKWvWs0TZhZ6S6TC+VcHtcKQAhi7bIfMLWHF4QJI/LRKMMHqsJQve9t05oRQtKA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t0xb6zvDMda9Ul4kOGvTIec2vFijuGtrm+I6kRl2eNkrGvp+5ZAPKBziF0UYroh+J1c4w0gpfydsB/1BZAK0uGc4H4qCU6lWsTq/bgqwk4guNni8xBXKC3hFW0bW4/NqcF0OFVPQe9mc0dT5k34lB9/fVab+G3wyGsTnMXm8BD9/HNKXeKstHYcNllJZHnClGteHALnmouBbLjiIbZTL1SB+lL+qDyiXumWouPlIGyqi9k71UtorZPxtQXh6p12EqF363RX3LEZxBFjO93JpQ13IP0GjMPaE3CGNjXJS8ic+JacSNCS1KwXFFizZFmwKlo9xEzbJkZPdcovt5geAOA==
- 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: Thu, 24 Jul 2025 09:44:40 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHb/H+RZz72CuYaAEmAjKB8JLwIEg==
- Thread-topic: [PATCH v14 1/2] arm/pci: add pci_passhtrough_enabled check to pci_device_reset
On Arm 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.
This change should not affect x86 behavior as pci-passthrough is always
enabled there.
Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
---
v13->v14:
* clarify the commit message
v13:
* new patch
---
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
|