Skip to content
/ linux Public

Commit ad36408

Browse files
ardbiesheuvelSasha Levin
authored andcommitted
x86/kexec: Copy ACPI root pointer address from config table
[ Upstream commit e00ac9e ] Dave reports that kexec may fail when the first kernel boots via the EFI stub but without EFI runtime services, as in that case, the RSDP address field in struct bootparams is never assigned. Kexec copies this value into the version of struct bootparams that it provides to the incoming kernel, which may have no other means to locate the ACPI root pointer. So take the value from the EFI config tables if no root pointer has been set in the first kernel's struct bootparams. Fixes: a1b87d5 ("x86/efistub: Avoid legacy decompressor when doing EFI boot") Cc: <stable@vger.kernel.org> # v6.1 Reported-by: Dave Young <dyoung@redhat.com> Tested-by: Dave Young <dyoung@redhat.com> Link: https://lore.kernel.org/linux-efi/aZQg_tRQmdKNadCg@darkstar.users.ipa.redhat.com/ Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9c735a7 commit ad36408

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/x86/kernel/kexec-bzimage64.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr,
184184
struct efi_info *current_ei = &boot_params.efi_info;
185185
struct efi_info *ei = &params->efi_info;
186186

187+
if (!params->acpi_rsdp_addr) {
188+
if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
189+
params->acpi_rsdp_addr = efi.acpi20;
190+
else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
191+
params->acpi_rsdp_addr = efi.acpi;
192+
}
193+
187194
if (!efi_enabled(EFI_RUNTIME_SERVICES))
188195
return 0;
189196

0 commit comments

Comments
 (0)