cf. http://lists.gnu.org/archive/html/qemu-devel/2013-01/msg03650.html
Signed-off-by: David Woodhouse David.Woodhouse@intel.com
diff --git a/src/Kconfig b/src/Kconfig index f35b0f5..e49dd82 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -293,6 +293,13 @@ menu "BIOS interfaces" default y help Support finding and running option roms during POST. + config PERMIT_UNALIGNED_PCIROM + bool "Allow broken PCI option ROMs with unaligned PCIR table" + default n + help + Support initialising PCI ROMs which violate the spec by having + their PCI information at an unaligned offset, and which may not + be accepted by other firmwares. config OPTIONROMS_DEPLOYED depends on OPTIONROMS bool "Option roms are already at 0xc0000-0xf0000" diff --git a/src/optionroms.c b/src/optionroms.c index c9e7d7b..99c4135 100644 --- a/src/optionroms.c +++ b/src/optionroms.c @@ -107,6 +107,8 @@ static struct pci_data * get_pci_rom(struct rom_header *rom) { struct pci_data *pd = (void*)((u32)rom + rom->pcioffset); + if ((rom->pcioffset & 3) && !CONFIG_PERMIT_UNALIGNED_PCIROM) + return NULL; if (pd->signature != PCI_ROM_SIGNATURE) return NULL; return pd;