Commit e6635bab authored by Lakshmi Ramasubramanian's avatar Lakshmi Ramasubramanian Committed by Rob Herring

powerpc: Use ELF fields defined in 'struct kimage'

ELF related fields elf_headers, elf_headers_sz, and elfcorehdr_addr
have been moved from 'struct kimage_arch' to 'struct kimage' as
elf_headers, elf_headers_sz, and elf_load_addr respectively.

Use the ELF fields defined in 'struct kimage'.
Suggested-by: default avatarRob Herring <robh@kernel.org>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarLakshmi Ramasubramanian <nramas@linux.microsoft.com>
Reviewed-by: default avatarThiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210221174930.27324-4-nramas@linux.microsoft.com
parent 7b558cc3
...@@ -108,10 +108,6 @@ struct kimage_arch { ...@@ -108,10 +108,6 @@ struct kimage_arch {
unsigned long backup_start; unsigned long backup_start;
void *backup_buf; void *backup_buf;
unsigned long elfcorehdr_addr;
unsigned long elf_headers_sz;
void *elf_headers;
#ifdef CONFIG_IMA_KEXEC #ifdef CONFIG_IMA_KEXEC
phys_addr_t ima_buffer_addr; phys_addr_t ima_buffer_addr;
size_t ima_buffer_size; size_t ima_buffer_size;
......
...@@ -45,7 +45,7 @@ char *setup_kdump_cmdline(struct kimage *image, char *cmdline, ...@@ -45,7 +45,7 @@ char *setup_kdump_cmdline(struct kimage *image, char *cmdline,
return NULL; return NULL;
elfcorehdr_strlen = sprintf(cmdline_ptr, "elfcorehdr=0x%lx ", elfcorehdr_strlen = sprintf(cmdline_ptr, "elfcorehdr=0x%lx ",
image->arch.elfcorehdr_addr); image->elf_load_addr);
if (elfcorehdr_strlen + cmdline_len > COMMAND_LINE_SIZE) { if (elfcorehdr_strlen + cmdline_len > COMMAND_LINE_SIZE) {
pr_err("Appending elfcorehdr=<addr> exceeds cmdline size\n"); pr_err("Appending elfcorehdr=<addr> exceeds cmdline size\n");
...@@ -263,8 +263,8 @@ int setup_new_fdt(const struct kimage *image, void *fdt, ...@@ -263,8 +263,8 @@ int setup_new_fdt(const struct kimage *image, void *fdt,
* Avoid elfcorehdr from being stomped on in kdump kernel by * Avoid elfcorehdr from being stomped on in kdump kernel by
* setting up memory reserve map. * setting up memory reserve map.
*/ */
ret = fdt_add_mem_rsv(fdt, image->arch.elfcorehdr_addr, ret = fdt_add_mem_rsv(fdt, image->elf_load_addr,
image->arch.elf_headers_sz); image->elf_headers_sz);
if (ret) { if (ret) {
pr_err("Error reserving elfcorehdr memory: %s\n", pr_err("Error reserving elfcorehdr memory: %s\n",
fdt_strerror(ret)); fdt_strerror(ret));
......
...@@ -816,9 +816,9 @@ static int load_elfcorehdr_segment(struct kimage *image, struct kexec_buf *kbuf) ...@@ -816,9 +816,9 @@ static int load_elfcorehdr_segment(struct kimage *image, struct kexec_buf *kbuf)
goto out; goto out;
} }
image->arch.elfcorehdr_addr = kbuf->mem; image->elf_load_addr = kbuf->mem;
image->arch.elf_headers_sz = headers_sz; image->elf_headers_sz = headers_sz;
image->arch.elf_headers = headers; image->elf_headers = headers;
out: out:
kfree(cmem); kfree(cmem);
return ret; return ret;
...@@ -852,7 +852,7 @@ int load_crashdump_segments_ppc64(struct kimage *image, ...@@ -852,7 +852,7 @@ int load_crashdump_segments_ppc64(struct kimage *image,
return ret; return ret;
} }
pr_debug("Loaded elf core header at 0x%lx, bufsz=0x%lx memsz=0x%lx\n", pr_debug("Loaded elf core header at 0x%lx, bufsz=0x%lx memsz=0x%lx\n",
image->arch.elfcorehdr_addr, kbuf->bufsz, kbuf->memsz); image->elf_load_addr, kbuf->bufsz, kbuf->memsz);
return 0; return 0;
} }
...@@ -1142,9 +1142,9 @@ int arch_kimage_file_post_load_cleanup(struct kimage *image) ...@@ -1142,9 +1142,9 @@ int arch_kimage_file_post_load_cleanup(struct kimage *image)
vfree(image->arch.backup_buf); vfree(image->arch.backup_buf);
image->arch.backup_buf = NULL; image->arch.backup_buf = NULL;
vfree(image->arch.elf_headers); vfree(image->elf_headers);
image->arch.elf_headers = NULL; image->elf_headers = NULL;
image->arch.elf_headers_sz = 0; image->elf_headers_sz = 0;
return kexec_image_post_load_cleanup_default(image); return kexec_image_post_load_cleanup_default(image);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment