summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZou Nan hai <nanhai.zou@intel.com>2006-08-14 14:57:07 +0800
committerSimon Horman <horms@verge.net.au>2006-10-06 12:44:15 +0900
commitaf07e52128dff6d25d6efd94c9e22c21e7b30cec (patch)
treea299e7a7edc24bb6fb856576f04dafea91607629
parent9e741cbe256fa166d1e18b635cd55ae173eb0224 (diff)
ia64: kdump: patch clone ia64_boot_param area for crash
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. Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> Removed bogus fragments caused by whitespace addition Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/ia64/kexec-elf-ia64.c10
-rw-r--r--purgatory/arch/ia64/entry.S3
-rw-r--r--purgatory/arch/ia64/purgatory-ia64.c22
3 files changed, 24 insertions, 11 deletions
diff --git a/kexec/arch/ia64/kexec-elf-ia64.c b/kexec/arch/ia64/kexec-elf-ia64.c
index 8c2609f..41e81fc 100644
--- a/kexec/arch/ia64/kexec-elf-ia64.c
+++ b/kexec/arch/ia64/kexec-elf-ia64.c
@@ -115,9 +115,10 @@ int elf_ia64_load(int argc, char **argv, const char *buf, off_t len,
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, const char *buf, off_t len,
&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);
diff --git a/purgatory/arch/ia64/entry.S b/purgatory/arch/ia64/entry.S
index 1821505..a1e9e87 100644
--- a/purgatory/arch/ia64/entry.S
+++ b/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)
diff --git a/purgatory/arch/ia64/purgatory-ia64.c b/purgatory/arch/ia64/purgatory-ia64.c
index c0115c0..dbf77a6 100644
--- a/purgatory/arch/ia64/purgatory-ia64.c
+++ b/purgatory/arch/ia64/purgatory-ia64.c
@@ -123,6 +123,7 @@ struct kexec_boot_params {
uint64_t command_line_len;
uint64_t efi_memmap_base;
uint64_t efi_memmap_size;
+ uint64_t boot_param_base;
struct loaded_segment *loaded_segments;
unsigned long loaded_segments_num;
};
@@ -243,13 +244,15 @@ ia64_env_setup(struct ia64_boot_param *boot_param,
unsigned long *set_virtual_address_map;
char *command_line = (char *)params->command_line;
uint64_t command_line_len = params->command_line_len;
-
+ struct ia64_boot_param *new_boot_param =
+ (struct ia64_boot_param *) params->boot_param_base;
+ memcpy(new_boot_param, boot_param, 4096);
// patch efi_runtime->set_virtual_address_map to a
// dummy function
len = __dummy_efi_function_end - __dummy_efi_function;
memcpy(command_line + command_line_len,
__dummy_efi_function, len);
- systab = (efi_system_table_t *)boot_param->efi_systab;
+ systab = (efi_system_table_t *)new_boot_param->efi_systab;
runtime = (efi_runtime_services_t *)PA(systab->runtime);
set_virtual_address_map =
(unsigned long *)PA(runtime->set_virtual_address_map);
@@ -257,15 +260,14 @@ ia64_env_setup(struct ia64_boot_param *boot_param,
(unsigned long)(command_line + command_line_len);
flush_icache_range(command_line + command_line_len, len);
- patch_efi_memmap(params, boot_param);
-
- boot_param->efi_memmap = params->efi_memmap_base;
+ patch_efi_memmap(params, new_boot_param);
- boot_param->command_line = params->command_line;
- boot_param->console_info.orig_x = 0;
- boot_param->console_info.orig_y = 0;
- boot_param->initrd_start = params->ramdisk_base;
- boot_param->initrd_size = params->ramdisk_size;
+ new_boot_param->efi_memmap = params->efi_memmap_base;
+ new_boot_param->command_line = params->command_line;
+ new_boot_param->console_info.orig_x = 0;
+ new_boot_param->console_info.orig_y = 0;
+ new_boot_param->initrd_start = params->ramdisk_base;
+ new_boot_param->initrd_size = params->ramdisk_size;
}
/* This function can be used to execute after the SHA256 verification. */