]> www.infradead.org Git - users/dwmw2/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 07:11:01 +0000 (09:11 +0200)
commitc5699cc857a037773bbce4f6966d55c227b8436b
tree0b1c1ec32d09bb7a83609a37b9edcefcdca57242
parent2fd4aaaf615d117ef28ff619046302ff2d65ab0c
x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernels

commit 0a23ebc66a46786769dd68bfdaa3102345819b9c upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/boot/compressed/acpi.c