Skip to contentSkip to conversation

IA64 Kdump patch clone ia64_boot_param area for crash kernel

PATCH Zou Nan hai 1 participant 1 message Aug 14, 2006

lore
Share & tools
lore
#0 lore raw

make a clone of ia64_boot_param area to the crash kernel.

without this patch, crash tool will not able to analyze efi memmap of first kernel from vmcore file.
This patch is against kexec-tools-1.101 with kdump10 patch.

kexec/arch/ia64/kexec-elf-ia64.c +9 -1
diff -Nraup kexec-tools-1.101/kexec/arch/ia64/kexec-elf-ia64.c kexec-tools-1.101-fix/kexec/arch/ia64/kexec-elf-ia64.c
@@ -115,9 +115,10 @@ int elf_ia64_load(int argc, char **argv,
 	unsigned long entry, max_addr, gp_value;
 	unsigned long command_line_base, ramdisk_base;
 	unsigned long efi_memmap_base, efi_memmap_size;
+	unsigned long boot_param_base;
 	int result;
 	int opt;
-	char *efi_memmap_buf;
+	char *efi_memmap_buf, *boot_param;
 #define OPT_APPEND	(OPT_ARCH_MAX+0)
 #define OPT_RAMDISK	(OPT_ARCH_MAX+1)
 	static const struct option options[] = {
@@ -191,6 +192,13 @@ int elf_ia64_load(int argc, char **argv,
 				&command_line) < 0)
 		return -1;
 
+	// reverve 4k for ia64_boot_param
+	boot_param = xmalloc(4096);
+        boot_param_base = add_buffer(info, boot_param, 4096, 4096, 4096, 0,
+                        max_addr, -1);
+        elf_rel_set_symbol(&info->rhdr, "__boot_param_base",
+                        &boot_param_base, sizeof(long));
+
 	// reserve 8k for efi_memmap
 	efi_memmap_size = 1UL<<14;
 	efi_memmap_buf = xmalloc(efi_memmap_size);
purgatory/arch/ia64/entry.S +3 -0
diff -Nraup kexec-tools-1.101/purgatory/arch/ia64/entry.S kexec-tools-1.101-fix/purgatory/arch/ia64/entry.S
@@ -46,6 +46,8 @@ purgatory_start:
 	br.call.sptk.many b0=ia64_env_setup
 	movl r10=__kernel_entry;;
 	ld8 r14=[r10];;
+	movl r10=__boot_param_base;;
+	ld8 r28=[r10];;
 	mov b6=r14;;
 	mov ar.lc=r0
 	mov ar.ec=r0
@@ -61,6 +63,7 @@ DECLARE_DATA8(__command_line)
 DECLARE_DATA8(__command_line_len)
 DECLARE_DATA8(__efi_memmap_base)
 DECLARE_DATA8(__efi_memmap_size)
+DECLARE_DATA8(__boot_param_base)
 DECLARE_DATA8(__loaded_segments)
 DECLARE_DATA8(__loaded_segments_num)
 
purgatory/arch/ia64/purgatory-ia64.c +32 -30

160 lines not on this page · raw message