mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
x86, efi: Fix PCI ROM handing in EFI boot stub, in 32-bit mode
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 <[email protected]> Cc: <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: H. Peter Anvin <[email protected]> Cc: Matt Fleming <[email protected]>
This commit is contained in:
1 parent
f791620fa7
commit
b607e21267
1 file changed
+6
-1
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user