Skip to content

Commit

Permalink
arm64: kexec: make dtb_mem always enabled
Browse files Browse the repository at this point in the history
Currently, dtb_mem is enabled only when CONFIG_KEXEC_FILE is
enabled. This adds ugly ifdefs to c files.

Always enabled dtb_mem, when it is not used, it is NULL.
Change the dtb_mem to phys_addr_t, as it is a physical address.

Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: James Morse <james.morse@arm.com>
Link: https://lore.kernel.org/r/20210125191923.1060122-2-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
  • Loading branch information
Pavel Tatashin authored and Will Deacon committed Jan 27, 2021
1 parent 19c329f commit 117cda9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions arch/arm64/include/asm/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ static inline void crash_prepare_suspend(void) {}
static inline void crash_post_resume(void) {}
#endif

#ifdef CONFIG_KEXEC_FILE
#define ARCH_HAS_KIMAGE_ARCH

struct kimage_arch {
void *dtb;
unsigned long dtb_mem;
phys_addr_t dtb_mem;
/* Core ELF header buffer */
void *elf_headers;
unsigned long elf_headers_mem;
unsigned long elf_headers_sz;
};

#ifdef CONFIG_KEXEC_FILE
extern const struct kexec_file_ops kexec_image_ops;

struct kimage;
Expand Down
6 changes: 1 addition & 5 deletions arch/arm64/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,7 @@ void machine_kexec(struct kimage *kimage)
* In kexec_file case, the kernel starts directly without purgatory.
*/
cpu_soft_restart(reboot_code_buffer_phys, kimage->head, kimage->start,
#ifdef CONFIG_KEXEC_FILE
kimage->arch.dtb_mem);
#else
0);
#endif
kimage->arch.dtb_mem);

BUG(); /* Should never get here. */
}
Expand Down

0 comments on commit 117cda9

Please sign in to comment.