qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 3/8] hw/pci-host/designware: Add 'host_mem' variable for clar


From: Gustavo Romero
Subject: Re: [PATCH 3/8] hw/pci-host/designware: Add 'host_mem' variable for clarity
Date: Mon, 19 Aug 2024 01:21:55 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

Hi Phil,

On 10/12/23 9:18 AM, Philippe Mathieu-Daudé wrote:
designware_pcie_root_realize() uses get_system_memory()
as the "host side memory region", as opposed to the "PCI
side" one. Introduce the 'host_mem' variable for clarity.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
---
  hw/pci-host/designware.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index 692e0731cd..bacb2bdb2d 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -393,6 +393,7 @@ static void designware_pcie_root_realize(PCIDevice *dev, 
Error **errp)
  {
      DesignwarePCIERoot *root = DESIGNWARE_PCIE_ROOT(dev);
      DesignwarePCIEHost *host = designware_pcie_root_to_host(root);
+    MemoryRegion *host_mem = get_system_memory();
      MemoryRegion *address_space = &host->pci.memory;
      PCIBridge *br = PCI_BRIDGE(dev);
      DesignwarePCIEViewport *viewport;
@@ -433,7 +434,7 @@ static void designware_pcie_root_realize(PCIDevice *dev, 
Error **errp)
          viewport->cr[0]   = DESIGNWARE_PCIE_ATU_TYPE_MEM;
source = &host->pci.address_space_root;
-        destination = get_system_memory();
+        destination = host_mem;
          direction   = "Inbound";
/*
@@ -458,7 +459,7 @@ static void designware_pcie_root_realize(PCIDevice *dev, 
Error **errp)
destination = &host->pci.memory;
          direction   = "Outbound";
-        source      = get_system_memory();
+        source      = host_mem;
/*
           * Configure MemoryRegion implementing CPU -> PCI memory


Reviewed-by: Gustavo Romero <[email protected]>

This patch can get merged independently of this series.


Cheers,
Gustavo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]