Skip to content

Commit

Permalink
x86, efi: Fix PCI ROM handing in EFI boot stub, in 32-bit mode
Browse files Browse the repository at this point in the history
The 'Attributes' argument to pci->Attributes() function is 64-bit. So
when invoking in 32-bit mode it takes two registers, not just one.

This fixes memory corruption when booting via the 32-bit EFI boot stub.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: <stable@kernel.org>
Link: http://lkml.kernel.org/r/1358513837.2397.247.camel@shinybook.infradead.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Matt Fleming <matt.fleming@intel.com>
  • Loading branch information
David Woodhouse authored and H. Peter Anvin committed Jan 28, 2013
1 parent f791620 commit b607e21
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/x86/boot/compressed/eboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,15 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
if (!pci)
continue;

#ifdef CONFIG_X86_64
status = efi_call_phys4(pci->attributes, pci,
EfiPciIoAttributeOperationGet, 0,
&attributes);

#else
status = efi_call_phys5(pci->attributes, pci,
EfiPciIoAttributeOperationGet, 0, 0,
&attributes);
#endif
if (status != EFI_SUCCESS)
continue;

Expand Down

0 comments on commit b607e21

Please sign in to comment.