diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2022-09-09 10:16:31 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2023-08-24 10:56:21 +0200 |
commit | bcfed7e270776ab5595cafc6f1794bea0cae1c6c (patch) | |
tree | 3128667c4119ebe59e9bcc0c81e6b68856be8d4e | |
parent | 90eeb0c8558a1524836ec94aee11f4cc88b10c78 (diff) | |
download | seabios-bcfed7e270776ab5595cafc6f1794bea0cae1c6c.tar.gz |
move 64bit pci window to end of address space
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.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | src/fw/pciinit.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index badf13d3..0fcd2be5 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 (CPUPhysBits) { + u64 top = 1LL << CPUPhysBits; + 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; |