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

[PATCH 7/7] xen/arm: rcar4: program ATU to accesses to all functions


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Mon, 24 Feb 2025 09:18:26 +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=Vr+RJzxbtfbXzyJxjIhXUxDesNrZnM6NrhcX9itp9QE=; b=adJlmy+Ws/8IV8BVcvqmF4RSWFadYIcsTrKauqDnWjN914xiPI8Fz+9c4lwo5I8UXa3vGoWApWQ9cMhI5gyQJOcpAIaRDSRqpG2fS/j1B/eUbrDv7J/CHiehxPReA2PGxMc6/BMbOvBXfgxbiwNuHcXb3cM3zC7W/14n7qjuVaz3le9scbIFeJ6kEceq13rMeJLg6qc3Ogticm0a9vPCQrfgN8lo9qnZUGaNkgfu8GKSKSb5xpxL6reixCvFd2tYTMuUW+MHZ3IfQcIbHyPICovztGmQ7jhVGDqCKfEnax0UYhPATJR437KtVMKkndj969/U5NWsVr0B+FuUzfG1lg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uujkxZsQBRQQYdsW2Y2bSDOHsia/kvSQscV8b3xpkIlKWi7EuIdY91yF+kUPnJFRFA+t9yoMQux38E5FxMFMLv1jPOD6AvLnSSulzZbwXDbAq4lPKP8PdTOB23N1IzdYZKJsnBRvC4/+zoN1deAxun02Kf7GA6iNPiTZ9A1eqJTKZqqy/FYLsSxsKfTPas7tGlAA62BtzXJ90RIUzOvMtrYG3MsETdWaHJs1ATCmGF6Zhu5FQPfUHM90z3ahmmfnzM6V3UnnTMlCkLwxYQt/XCa51oA6DaQFQ65PliBLRgnK6ayzULuUxvDaqTB8p6nReUm4EckB/ToFKK7DgHSBhw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Delivery-date: Mon, 24 Feb 2025 09:18:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbhp0PHs93+Pzdu0q8aV6A0xlD/w==
  • Thread-topic: [PATCH 7/7] xen/arm: rcar4: program ATU to accesses to all functions

From: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

According to ATU documentation, bits [18:16] of accessed memory
address correspond to a function number. This is somewhat similar to
ECAM, but with huge holes between regions.

We can use this to minimize number of ATU re-programmings: configure
ATU to access BDF with F=0 and adjust memory address with function
number.

Taking into account the previous patch, that optimizes ATU
reprogramming by skipping call to __dw_pcie_prog_outbound_atu() if we
already configured pci_address, we can be sure that accesses to all
functions of one device will not trigger ATU reprogramming at all.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
---
 xen/arch/arm/pci/pci-host-rcar4.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/pci/pci-host-rcar4.c 
b/xen/arch/arm/pci/pci-host-rcar4.c
index 3e3e073b09..5d006e4897 100644
--- a/xen/arch/arm/pci/pci-host-rcar4.c
+++ b/xen/arch/arm/pci/pci-host-rcar4.c
@@ -385,7 +385,7 @@ static void __iomem *rcar4_child_map_bus(struct 
pci_host_bridge *bridge,
     uint32_t busdev;
 
     busdev = PCIE_ATU_BUS(sbdf.bus) | PCIE_ATU_DEV(PCI_SLOT(sbdf.devfn)) |
-        PCIE_ATU_FUNC(PCI_FUNC(sbdf.devfn));
+        PCIE_ATU_FUNC(0);
 
     /* FIXME: Parent is the root bus, so use PCIE_ATU_TYPE_CFG0. */
     dw_pcie_prog_outbound_atu(bridge, PCIE_ATU_REGION_INDEX1,
@@ -393,7 +393,7 @@ static void __iomem *rcar4_child_map_bus(struct 
pci_host_bridge *bridge,
                               bridge->child_cfg->phys_addr,
                               busdev, bridge->child_cfg->size);
 
-    return bridge->child_cfg->win + where;
+    return bridge->child_cfg->win + ((uint32_t)sbdf.fn << 16) + where;
 }
 
 static int rcar4_child_config_read(struct pci_host_bridge *bridge,
-- 
2.34.1



 


Rackspace

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