qemu-devel
[Top][All Lists]
Advanced

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

Re: [SeaBIOS] [PATCH 3/4] move 64bit pci window to end of address space


From: Paul Menzel
Subject: Re: [SeaBIOS] [PATCH 3/4] move 64bit pci window to end of address space
Date: Mon, 21 Nov 2022 11:57:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0

Dear Gerd,


Thank you for the patch.

Am 21.11.22 um 11:32 schrieb Gerd Hoffmann:
When the size of the physical address space is known (PhysBits is not
zero) move the 64bit pci io window to the end of the address space.

It’d be great, if you elaborated, why this is an improvement.


Kind regards,

Paul


Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
  src/fw/pciinit.c | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
index badf13d3233b..ad6def93633b 100644
--- a/src/fw/pciinit.c
+++ b/src/fw/pciinit.c
@@ -1128,6 +1128,14 @@ static void pci_bios_map_devices(struct pci_bus *busses)
          r64_mem.base = le64_to_cpu(romfile_loadint("etc/reserved-memory-end", 
0));
          if (r64_mem.base < 0x100000000LL + RamSizeOver4G)
              r64_mem.base = 0x100000000LL + RamSizeOver4G;
+        if (PhysBits) {
+            u64 top = 1LL << PhysBits;
+            u64 size = (ALIGN(sum_mem, (1LL<<30)) +
+                        ALIGN(sum_pref, (1LL<<30)));
+            if (r64_mem.base < top - size) {
+                r64_mem.base = top - size;
+            }
+        }
          r64_mem.base = ALIGN(r64_mem.base, align_mem);
          r64_mem.base = ALIGN(r64_mem.base, (1LL<<30));    // 1G hugepage
          r64_pref.base = r64_mem.base + sum_mem;



reply via email to

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