diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2024-11-21 16:35:41 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2025-01-16 09:48:27 +0100 |
commit | df9dd418b3b0e586cb208125094620fc7f90f23d (patch) | |
tree | ba5a77d751392b83186212ab7177cc940edf2faf /src | |
parent | a4fc1845b43687fe01c6f53fca9d7c1ac1b725d7 (diff) | |
download | seabios-df9dd418b3b0e586cb208125094620fc7f90f23d.zip seabios-df9dd418b3b0e586cb208125094620fc7f90f23d.tar.gz seabios-df9dd418b3b0e586cb208125094620fc7f90f23d.tar.bz2 |
update pci_pad_mem64 handling
Add a new possible state: '-1' means 'use default'. In that case
seabios continue to use the current heuristic: In case memory
above 4G is present enable 64-bit guest friendly configuration.
This allows forcing the one or the other behavior by setting the
pci_pad_mem64 variable beforehand (which is done by another patch).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/fw/pciinit.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index b3e359d..be76c44 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -55,7 +55,7 @@ u64 pcimem64_end = BUILD_PCIMEM64_END; // Resource allocation limits static u64 pci_io_low_end = 0xa000; static u64 pci_mem64_top = 0; -static u32 pci_pad_mem64 = 0; +static u32 pci_pad_mem64 = -1; struct pci_region_entry { struct pci_device *dev; @@ -1202,8 +1202,15 @@ pci_setup(void) } } - if (CPUPhysBits >= 36 && CPULongMode && RamSizeOver4G) - pci_pad_mem64 = 1; + pci_pad_mem64 = romfile_loadbool("opt/org.seabios/pci64", -1); + + if (pci_pad_mem64 == -1) + // when not set enable in case memory over 4G is present + pci_pad_mem64 = RamSizeOver4G ? 1 : 0; + + if (!CPULongMode) + // force off for 32-bit CPUs + pci_pad_mem64 = 0; dprintf(1, "=== PCI bus & bridge init ===\n"); if (pci_probe_host() != 0) { |