Allow setting pci_pad_mem64 via fw_cfg. Usage: qemu -fw_cfg name=opt/org.seabios/pci64,string={yes,no}
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- src/util.h | 1 + src/fw/paravirt.c | 13 +++++++++++++ src/fw/pciinit.c | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/util.h b/src/util.h index aff8e888955e..03dcafb83794 100644 --- a/src/util.h +++ b/src/util.h @@ -135,6 +135,7 @@ void multiboot_init(void); extern u64 pcimem_start, pcimem_end; extern u64 pcimem64_start, pcimem64_end; extern const u8 pci_irqs[4]; +extern u32 pci_pad_mem64; void pci_setup(void); void pci_resume(void);
diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c index e5d4eca0cb5a..6428a70361c4 100644 --- a/src/fw/paravirt.c +++ b/src/fw/paravirt.c @@ -718,6 +718,19 @@ void qemu_cfg_init(void) dprintf(1, "Moving pm_base to 0x%x\n", acpi_pm_base); }
+ // 64-bit pci mmio window + char *hint = romfile_loadfile("opt/org.seabios/pci64", NULL); + if (hint) { + if (0 == strcmp(hint, "0") || + 0 == strcmp(hint, "no") || + 0 == strcmp(hint, "off")) + pci_pad_mem64 = 0; + if (0 == strcmp(hint, "1") || + 0 == strcmp(hint, "yes") || + 0 == strcmp(hint, "on")) + pci_pad_mem64 = 1; + } + // serial console u16 nogfx = 0; qemu_cfg_read_entry(&nogfx, QEMU_CFG_NOGRAPHIC, sizeof(nogfx)); diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index df63acc19e24..5b4cf3bd5598 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 = -1; +u32 pci_pad_mem64 = -1;
struct pci_region_entry { struct pci_device *dev;