[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 4/8] xen/pci: disable pci_device_{add,remove} when hwdom uses vpci on arm


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Wed, 24 Sep 2025 07:59:22 +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=/J+B8SmmFZkxU0vI4rRuSl7qd5Ef4KyDBUosgN+zjEU=; b=nF+I9MsJOqKBxptTKiwvxob8V7rmP7QQM27P7qllIOUXW3dXLqeUGuktwC5G5HDRCIbeC7vGsjjTqe8yhd1maZ3LwrJyLOQ8voqjfrLAVWPM9HtgLywFB/XA2tUC6K/4CwH/t3KfNzAGIlJR4k8n2RoBOKIVmcR/zlj/UiRXQGPDc7SscimcGmmxY4SIw+vgVuKJFxxo7bFHZ0TyHyUmRcPXXa/B5VN/U/5UPrU2VAbFnNhfGJbimLKdSfsSLGc2NsVe71HvnBQUej12kvxDed+1Wn5E8gWLZaxNL+AUOgZqvraDf+q197wLXHjA9sLHu1WUCSSt4TjITqxA9sq2zg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mlCB6a0BpZcQaBFCGXnQTZfJI4GKNxeP3EIQWeYGbdnEWNEC8A66bCj1/gD85+Z7GGN1skllJ9VnBruKjus4eNc1PcWjIoefrJ3JEFadwpqVtpVqeE6hhQ565UobcNjyMVAiWtYPhtkvFHKTxUj+aLW494rAL++wnB6LaD71RnRluqGexiNX8Db0iIcMPwQ1s9TzifzIyqf0dEjuI2sYC3WEsKCmwS0knKi0gc+lnceKJ4AtjuPtCkFhnLhU41+2A4r2P0loknWtR8fqB5bpTvWPul+UN8dF/kqxCBFM2y5Shm0KEq+rkuMwxSkeXQT0Bdft5YzhI/k4HsXS3jEj6Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Luca Fancellu <luca.fancellu@xxxxxxx>, 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>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Delivery-date: Wed, 24 Sep 2025 07:59:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcLSkjp9oz81JUVE62TQagPRX78w==
  • Thread-topic: [PATCH v1 4/8] xen/pci: disable pci_device_{add,remove} when hwdom uses vpci on arm

From: Luca Fancellu <luca.fancellu@xxxxxxx>

On ARM, if the hardware domain is using the emulated bus, it should not
be allowed to add/remove pci devices, so return EOPNOTSUPP in that case.

Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
---
 xen/drivers/pci/physdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/drivers/pci/physdev.c b/xen/drivers/pci/physdev.c
index d46501b884..5b3f8dde14 100644
--- a/xen/drivers/pci/physdev.c
+++ b/xen/drivers/pci/physdev.c
@@ -19,6 +19,9 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
arg)
         struct pci_dev_info pdev_info;
         nodeid_t node = NUMA_NO_NODE;
 
+        if ( hwdom_uses_vpci() )
+            return -EOPNOTSUPP;
+
         if ( !is_pci_passthrough_enabled() && !arch_pci_device_physdevop() )
             return -EOPNOTSUPP;
 
@@ -57,6 +60,9 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
arg)
     case PHYSDEVOP_pci_device_remove: {
         struct physdev_pci_device dev;
 
+        if ( hwdom_uses_vpci() )
+            return -EOPNOTSUPP;
+
         if ( !is_pci_passthrough_enabled() && !arch_pci_device_physdevop() )
             return -EOPNOTSUPP;
 
-- 
2.34.1



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.