From 0c41d96cbed0ae895fd7da425f755a8684558e1c Mon Sep 17 00:00:00 2001 From: Dave Young Date: Fri, 30 May 2014 11:24:52 +0800 Subject: kdump: pass acpi_rsdp to 2nd kernel if kernel does not export efi runtime maps If kernel does not export efi runtime maps it means 1:1 mapping does not work or user explictly boot with efi=old_map. In this case efi setup code will failback to noefi boot, but for kdump case we still need pass extra acpi_rsdp cmdline. Thus adding a check in kdump path. Signed-off-by: Dave Young Signed-off-by: Simon Horman --- kexec/arch/i386/crashdump-x86.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c index 8ef0c8b..77bdad5 100644 --- a/kexec/arch/i386/crashdump-x86.c +++ b/kexec/arch/i386/crashdump-x86.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "../../kexec.h" #include "../../kexec-elf.h" #include "../../kexec-syscall.h" @@ -780,6 +781,18 @@ static enum coretype get_core_type(struct crash_elf_info *elf_info, } } +static int sysfs_efi_runtime_map_exist(void) +{ + DIR *dir; + + dir = opendir("/sys/firmware/efi/runtime-map"); + if (!dir) + return 0; + + closedir(dir); + return 1; +} + /* Appends 'acpi_rsdp=' commandline for efi boot crash dump */ static void cmdline_add_efi(char *cmdline) { @@ -974,7 +987,8 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, dbgprintf("Created elf header segment at 0x%lx\n", elfcorehdr); if (delete_memmap(memmap_p, &nr_memmap, elfcorehdr, memsz) < 0) return -1; - if (!bzImage_support_efi_boot || arch_options.noefi) + if (!bzImage_support_efi_boot || arch_options.noefi || + !sysfs_efi_runtime_map_exist()) cmdline_add_efi(mod_cmdline); cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr); -- cgit v1.2.1