[PATCH kexec-tools] kdump: pass acpi_rsdp to 2nd kernel if kernel does not export efi runtime maps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <dyoung at redhat.com>
---
 kexec/arch/i386/crashdump-x86.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

Index: kexec-tools/kexec/arch/i386/crashdump-x86.c
===================================================================
--- kexec-tools.orig/kexec/arch/i386/crashdump-x86.c
+++ kexec-tools/kexec/arch/i386/crashdump-x86.c
@@ -34,6 +34,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <dirent.h>
 #include "../../kexec.h"
 #include "../../kexec-elf.h"
 #include "../../kexec-syscall.h"
@@ -780,6 +781,18 @@ static enum coretype get_core_type(struc
 	}
 }
 
+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
 	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);
 



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux