Re: [PATCH] x86/boot: Use EFI setup data if provided

From: Baoquan He
Date: Mon Mar 25 2019 - 03:27:36 EST


On 03/22/19 at 04:23pm, Borislav Petkov wrote:
> On Fri, Mar 22, 2019 at 11:03:43AM +0000, Junichi Nomura wrote:
> > Commit 3a63f70bf4c3a ("x86/boot: Early parse RSDP and save it in
> > boot_params") broke kexec boot on EFI systems. efi_get_rsdp_addr()
> > in the early parsing code tries to search RSDP from EFI table but
> > whose address is virtual.
> >
> > Since kexec(1) provides physical address of config_table via boot_params,
> > efi_get_rsdp_addr() should look for setup_data in the same way as
> > efi_systab_init() in arch/x86/platform/efi/efi.c does.
>
> If the kexec kernel should continue to use efi_systab_init() then you
> should make efi_get_rsdp_addr() exit early in the kexec-ed kernel.

Kexec kernel also need to get rsdp to get SRAT tables so that KASLR can
avoid those hotpluggable regions in boot compression stage.

The kexec_file_load has filled in acpi_rsdp_addr of kexec kernel in
below code. It will return direclty in get_rsdp_addr() since
acpi_rsdp_addr is got from boot_params->acpi_rsdp_addr.

arch/x86/kernel/kexec-bzimage64.c <<setup_boot_parameters>>
params->acpi_rsdp_addr = boot_params.acpi_rsdp_addr;

The other interface, kexec_load, its boot_params filling is done in user
space kexec_tools. And we haven't made the acpi_rsdp_addr filling yet.
And the old kexec_tools utility can also cause the new kexec kernel to
search efi rspd pointer even thought it's fixed.

Thanks
Baoquan

>
> --
> Regards/Gruss,
> Boris.
>
> Good mailing practices for 400: avoid top-posting and trim the reply.