public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/kexec: Copy ACPI root pointer address from config table
@ 2026-02-17 16:35 Ard Biesheuvel
  2026-03-06  5:42 ` Richard Lyu
  0 siblings, 1 reply; 2+ messages in thread
From: Ard Biesheuvel @ 2026-02-17 16:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-efi, x86, Ard Biesheuvel, stable, Dave Young

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: <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>
---
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(+)

diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
index 7508d0ccc740..24aec7c1153f 100644
--- a/arch/x86/kernel/kexec-bzimage64.c
+++ b/arch/x86/kernel/kexec-bzimage64.c
@@ -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(&params->apm_bios_info, 0, sizeof(params->apm_bios_info));
-- 
2.53.0.273.g2a3d683680-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-06  5:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-17 16:35 [PATCH] x86/kexec: Copy ACPI root pointer address from config table Ard Biesheuvel
2026-03-06  5:42 ` Richard Lyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox