]> asedeno.scripts.mit.edu Git - linux.git/commit
x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernels
authorJunichi Nomura <j-nomura@ce.jp.nec.com>
Thu, 11 Apr 2019 13:49:32 +0000 (15:49 +0200)
committerBorislav Petkov <bp@suse.de>
Thu, 6 Jun 2019 18:28:37 +0000 (20:28 +0200)
commit0a23ebc66a46786769dd68bfdaa3102345819b9c
tree54cd0722e3d7139eb0485f2cb219e19aedd57c0f
parent6bbeb276b71f06c5267bfd154629b1bec82e7136
x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernels

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 the EFI tables but that will
crash because the table address is virtual when the kernel was booted by
kexec (set_virtual_address_map() has run in the first kernel and cannot
be run again in the second kernel).

In the case of kexec, the physical address of EFI tables is provided via
efi_setup_data in boot_params, which is set up by kexec(1).

Factor out the table parsing code and use different pointers depending
on whether the kernel is booted by kexec or not.

 [ bp: Massage. ]

Fixes: 3a63f70bf4c3a ("x86/boot: Early parse RSDP and save it in boot_params")
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Cc: Chao Fan <fanc.fnst@cn.fujitsu.com>
Cc: Dave Young <dyoung@redhat.com>
Link: https://lkml.kernel.org/r/20190408231011.GA5402@jeru.linux.bs1.fc.nec.co.jp
arch/x86/boot/compressed/acpi.c