Skip to contentSkip to conversation

kexec/x86: Unconditionally add the acpi_rsdp command line

PATCH In review Lianbo Jiang 2 participants 3 messages Mar 15, 2019 – May 13, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec/x86: Unconditionally add the acpi_rsdp command line

The Linux kernel commit 3a63f70bf4c3 introduces the early parsing of the RSDP. This means that boot loader must either set the boot_params.acpi_rsdp_addr or pass a command line 'acpi_rsdp=xxx' to tell the RDSP physical address.

Currently, kexec neither sets the boot_params.acpi_rsdp or passes acpi_rsdp command line if it sees the first kernel support efi runtime. This is causing the second kernel boot failure. The EFI runtime is not available so early in the boot process so unconditionally pass the 'acpi_rsdp=xxx' to the second kernel.

---
 kexec/arch/i386/crashdump-x86.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
kexec/arch/i386/crashdump-x86.c +1 -16
index 140f45b..a29b15b 100644
@@ -35,7 +35,6 @@
 #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"
@@ -772,18 +771,6 @@ 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)
 {
@@ -978,9 +965,7 @@ 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 ||
-	    !sysfs_efi_runtime_map_exist())
-		cmdline_add_efi(mod_cmdline);
+	cmdline_add_efi(mod_cmdline);
 	cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
 
 	/* Inform second kernel about the presence of ACPI tables. */
Signature · 7 lines
2.17.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw
Quoted 64 lines · Lianbo Jiang

The Linux kernel commit 3a63f70bf4c3 introduces the early parsing of the RSDP. This means that boot loader must either set the boot_params.acpi_rsdp_addr or pass a command line 'acpi_rsdp=xxx' to tell the RDSP physical address.

Currently, kexec neither sets the boot_params.acpi_rsdp or passes acpi_rsdp command line if it sees the first kernel support efi runtime. This is causing the second kernel boot failure. The EFI runtime is not available so early in the boot process so unconditionally pass the 'acpi_rsdp=xxx' to the second kernel.

---
 kexec/arch/i386/crashdump-x86.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
kexec/arch/i386/crashdump-x86.c +1 -17
index 140f45b..a29b15b 100644
@@ -35,7 +35,6 @@
 #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"
@@ -772,18 +771,6 @@ 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)
 {
@@ -978,9 +965,7 @@ 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 ||
-           !sysfs_efi_runtime_map_exist())
-               cmdline_add_efi(mod_cmdline);
+       cmdline_add_efi(mod_cmdline);
        cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
 
        /* Inform second kernel about the presence of ACPI tables. */
--

2.17.1

Quoted 4 lines

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Hi Lianbo,

I've sent another patch similiar to yours:
[PATCH] x86: Always try to fill acpi_rsdp_addr in boot params

I'll update V2 and your use case should also be covered in that patch, as we have talked in IRC previously, thanks!

--
Best Regards,
Kairui Song

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

author
#2 lore raw
Quoted 72 lines · Kairui Song
Quoted 64 lines · Lianbo Jiang

The Linux kernel commit 3a63f70bf4c3 introduces the early parsing of the RSDP. This means that boot loader must either set the boot_params.acpi_rsdp_addr or pass a command line 'acpi_rsdp=xxx' to tell the RDSP physical address.

Currently, kexec neither sets the boot_params.acpi_rsdp or passes acpi_rsdp command line if it sees the first kernel support efi runtime. This is causing the second kernel boot failure. The EFI runtime is not available so early in the boot process so unconditionally pass the 'acpi_rsdp=xxx' to the second kernel.

---
 kexec/arch/i386/crashdump-x86.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
kexec/arch/i386/crashdump-x86.c +1 -17
index 140f45b..a29b15b 100644
@@ -35,7 +35,6 @@
 #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"
@@ -772,18 +771,6 @@ 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)
 {
@@ -978,9 +965,7 @@ 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 ||
-           !sysfs_efi_runtime_map_exist())
-               cmdline_add_efi(mod_cmdline);
+       cmdline_add_efi(mod_cmdline);
        cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
 
        /* Inform second kernel about the presence of ACPI tables. */
--

2.17.1

Quoted 4 lines

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Hi Lianbo,

Quoted 5 lines

I've sent another patch similiar to yours:
[PATCH] x86: Always try to fill acpi_rsdp_addr in boot params

I'll update V2 and your use case should also be covered in that patch, as we have talked in IRC previously, thanks!

OK. I noticed that the RSDP parsing was disabled in upsream kernel. Please refer to the following heading:

"x86/boot: Disable RSDP parsing temporarily"

So, for this case, no longer need it. Please ignore it.

Thanks.
Lianbo

Quoted 5 lines

--
Best Regards,
Kairui Song

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec