x86/kexec: Copy ACPI root pointer address from config table
Subsystems (3)
Ard Biesheuvel
maintainerPATCH 1/1 x86/kexec: Copy ACPI root pointer address from config table
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.
---
Unless anyone minds, I intend to take this via the EFI tree as a fix.
arch/x86/kernel/kexec-bzimage64.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/x86/kernel/kexec-bzimage64.c +6 -0
@@ -313,6 +313,12 @@ setup_boot_parameters(struct kimage *image, struct boot_params *params,/* Always fill in RSDP: it is either 0 or a valid value */ params->acpi_rsdp_addr = boot_params.acpi_rsdp_addr; +if (IS_ENABLED (CONFIG_EFI ) && !params->acpi_rsdp_addr) { +if (efi.acpi20 !=EFI_INVALID_TABLE_ADDR ) + params->acpi_rsdp_addr = efi.acpi20; +else if (efi.acpi !=EFI_INVALID_TABLE_ADDR ) + params->acpi_rsdp_addr = efi.acpi; + }/* Default APM info */ memset (¶ms->apm_bios_info,0 ,sizeof (params->apm_bios_info));
Signature · 1 line
2.53.0.273.g2a3d683680-goog
Quoted 29 lines · Ard Biesheuvel
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 a1b87d54f4e4 ("x86/efistub: Avoid legacy decompressor when doing EFI boot")Cc <[email protected]> # v6.1Reported-by Dave Young <[email protected]>Tested-by Dave Young <[email protected]>Signed-off-by Ard Biesheuvel <[email protected]>---
Unless anyone minds, I intend to take this via the EFI tree as a fix.
arch/x86/kernel/kexec-bzimage64.c| 6 ++++++1 file changed, 6 insertions(+)arch/x86/kernel/kexec-bzimage64.c +0
-0@@ -313,6 +313,12 @@ setup_boot_parameters(struct kimage *image, struct boot_params *params,/* Always fill in RSDP: it is either 0 or a valid value */ params->acpi_rsdp_addr = boot_params.acpi_rsdp_addr;
arch/x86/kernel/kexec-bzimage64.c setup_boot_parameters(struct kimage *image, struct boot_params *params,
Quoted 10 lines
arch/x86/kernel/kexec-bzimage64.c +6
-1+if (IS_ENABLED (CONFIG_EFI ) && !params->acpi_rsdp_addr) { +if (efi.acpi20 !=EFI_INVALID_TABLE_ADDR ) + params->acpi_rsdp_addr = efi.acpi20; +else if (efi.acpi !=EFI_INVALID_TABLE_ADDR ) + params->acpi_rsdp_addr = efi.acpi; + }/* Default APM info */ memset (¶ms->apm_bios_info,0 ,sizeof (params->apm_bios_info)); -- 2.53.0.273.g2a3d683680-goog
This change is good to me.