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

[PATCH v5 7/9] xen/arm: Fix mapping for PCI bridge mmio region


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Wed, 4 Oct 2023 10:55:51 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=xYvhbIghzbK4otPkykio9apH9+Sqf28bZwTM507TJT4=; b=UgS3vktYejor4/gbPeDCPZbq4/YCzeafhYqrvSXfHQ4exppLw+Xh/GDYxd/QoW3YK3itzAFGl8dYhJq08Y/snEQQ0uvdK/Il8ngtxYO9iwSYdO3QLoiN9mx55fLpMs5XxN51AQ6puFl9rq3Wq+L7oVdgrlvYCqDa755FVkzuxnloBjZnxhWhvLeujhw0ebSz3/k+QBvLpBtkGwUxUb4fwPxwh8mubf6onEQoqj2/h0m5j+uGDhgTMdsv/1n9wkI7kApbyrF27VmzzQABRAp2zmRUV5OPu4l7DosMroshbk0htcQTPwi9qFVZ50GAXYv/J3pldFmIvbYIR2ZCLFbn6g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D9LL0UI3P5Igl9bcVddkiLsZgCENXhTbqrfsRSdRpsjOsKzap4p2oNQpeEbMLEIhtchAePIMVp7CmUphwuDxomW54elCN8lBHIOBdN2lL7F8Ph8YpZK2qjz0VdglOI/ldUgXKGh4lIWuM73IdX/VYo0g5JXQGEFCbQlRXlUM7GkWSldtb0+B3JKNOPKdBiiuhHrap8MZK4oISvFHuYCJeE1CtpZY1PYma0zFaoCH8DB4yStgxvcsvjmIWKUbWaisvsemgmocZ5pxJRQAv+aIuTLDzY7WJ0NraBIw+ODnIv/I/1IVF20e/EMjsixLCOWvKIMlcgoNydTsxEbF3sMJ7w==
  • Cc: Rahul Singh <rahul.singh@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Delivery-date: Wed, 04 Oct 2023 15:14:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Rahul Singh <rahul.singh@xxxxxxx>

Current code skip the mapping for PCI bridge MMIO region to dom0 when
pci_passthrough_enabled flag is set. Mapping should be skip when
has_vpci(d) is enabled for the domain, as we need to skip the mapping
only when VPCI handler are registered for ECAM.

Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
---
v4->v5:
* new patch
* rebase on top of "dynamic node programming using overlay dtbo" series
* replace !is_pci_passthrough_enabled() check with !IS_ENABLED(CONFIG_HAS_PCI)
  instead of removing
---
 xen/arch/arm/device.c       | 2 +-
 xen/arch/arm/domain_build.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c
index 1f631d327441..4d69c298858d 100644
--- a/xen/arch/arm/device.c
+++ b/xen/arch/arm/device.c
@@ -330,7 +330,7 @@ int handle_device(struct domain *d, struct dt_device_node 
*dev, p2m_type_t p2mt,
         .d = d,
         .p2mt = p2mt,
         .skip_mapping = !own_device ||
-                        (is_pci_passthrough_enabled() &&
+                        (has_vpci(d) &&
                         (device_get_class(dev) == DEVICE_PCI_HOSTBRIDGE)),
         .iomem_ranges = iomem_ranges,
         .irq_ranges = irq_ranges
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7da254709d17..2c55528a62d4 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1064,7 +1064,7 @@ static void __init assign_static_memory_11(struct domain 
*d,
 #endif
 
 /*
- * When PCI passthrough is available we want to keep the
+ * When HAS_PCI is enabled we want to keep the
  * "linux,pci-domain" in sync for every host bridge.
  *
  * Xen may not have a driver for all the host bridges. So we have
@@ -1080,7 +1080,7 @@ static int __init handle_linux_pci_domain(struct 
kernel_info *kinfo,
     uint16_t segment;
     int res;
 
-    if ( !is_pci_passthrough_enabled() )
+    if ( !IS_ENABLED(CONFIG_HAS_PCI) )
         return 0;
 
     if ( !dt_device_type_is_equal(node, "pci") )
-- 
2.42.0




 


Rackspace

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