[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 3/6] move 64bit pci window to end of address space
|
From: |
Gerd Hoffmann |
|
Subject: |
[PATCH v3 3/6] move 64bit pci window to end of address space |
|
Date: |
Fri, 5 May 2023 09:11:14 +0200 |
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>
---
src/fw/pciinit.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
index badf13d3233b..0fcd2be598a2 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;
--
2.40.1
- [PATCH v3 0/6] misc tweaks for kvm and the 64bit pci window, Gerd Hoffmann, 2023/05/05
- [PATCH v3 4/6] be less conservative with the 64bit pci io window, Gerd Hoffmann, 2023/05/05
- [PATCH v3 2/6] detect physical address space size, Gerd Hoffmann, 2023/05/05
- [PATCH v3 1/6] better kvm detection, Gerd Hoffmann, 2023/05/05
- [PATCH v3 6/6] check for e820 conflict, Gerd Hoffmann, 2023/05/05
- [PATCH v3 3/6] move 64bit pci window to end of address space,
Gerd Hoffmann <=
- [PATCH v3 5/6] qemu: log reservations in fw_cfg e820 table, Gerd Hoffmann, 2023/05/05
- Re: [SeaBIOS] [PATCH v3 0/6] misc tweaks for kvm and the 64bit pci window, Kevin O'Connor, 2023/05/09