x86/efistub: Fix PCI ROM preservation in mixed mode
authorMikel Rychliski <mikel@mikelr.com>
Wed, 23 Aug 2023 21:51:58 +0000 (17:51 -0400)
committerArd Biesheuvel <ardb@kernel.org>
Thu, 24 Aug 2023 09:22:12 +0000 (11:22 +0200)
preserve_pci_rom_image() was accessing the romsize field in
efi_pci_io_protocol_t directly instead of using the efi_table_attr()
helper. This prevents the ROM image from being saved correctly during a
mixed mode boot.

Fixes: 2c3625cb9fa2 ("efi/x86: Fold __setup_efi_pci32() and __setup_efi_pci64() into one function")
Signed-off-by: Mikel Rychliski <mikel@mikelr.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/x86-stub.c

index 220be75..146477d 100644 (file)
@@ -72,7 +72,7 @@ preserve_pci_rom_image(efi_pci_io_protocol_t *pci, struct pci_setup_rom **__rom)
        rom->data.type  = SETUP_PCI;
        rom->data.len   = size - sizeof(struct setup_data);
        rom->data.next  = 0;
-       rom->pcilen     = pci->romsize;
+       rom->pcilen     = romsize;
        *__rom = rom;
 
        status = efi_call_proto(pci, pci.read, EfiPciIoWidthUint16,