Skip to content

Commit 0719392

Browse files
Russell Kingtorvalds
authored andcommitted
ARM: kexec: fix kexec for Keystone 2
Provide kexec with the boot view of memory by overriding the normal kexec translation functions added in a previous patch. We also need to fix a call to memblock in machine_kexec_prepare() so that we provide it with a running-view physical address rather than a boot- view physical address. Link: http://lkml.kernel.org/r/E1b8koa-0004Hl-Ey@rmk-PC.armlinux.org.uk Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Keerthy <j-keerthy@ti.com> Cc: Pratyush Anand <panand@redhat.com> Cc: Vitaly Andrianov <vitalya@ti.com> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Dave Young <dyoung@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Simon Horman <horms@verge.net.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 51d5d12 commit 0719392

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

‎arch/arm/include/asm/kexec.h‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
5353
/* Function pointer to optional machine-specific reinitialization */
5454
extern void (*kexec_reinit)(void);
5555

56+
static inline unsigned long phys_to_boot_phys(phys_addr_t phys)
57+
{
58+
return phys_to_idmap(phys);
59+
}
60+
#define phys_to_boot_phys phys_to_boot_phys
61+
62+
static inline phys_addr_t boot_phys_to_phys(unsigned long entry)
63+
{
64+
return idmap_to_phys(entry);
65+
}
66+
#define boot_phys_to_phys boot_phys_to_phys
67+
68+
static inline unsigned long page_to_boot_pfn(struct page *page)
69+
{
70+
return page_to_pfn(page) + (arch_phys_to_idmap_offset >> PAGE_SHIFT);
71+
}
72+
#define page_to_boot_pfn page_to_boot_pfn
73+
74+
static inline struct page *boot_pfn_to_page(unsigned long boot_pfn)
75+
{
76+
return pfn_to_page(boot_pfn - (arch_phys_to_idmap_offset >> PAGE_SHIFT));
77+
}
78+
#define boot_pfn_to_page boot_pfn_to_page
79+
5680
#endif /* __ASSEMBLY__ */
5781

5882
#endif /* CONFIG_KEXEC */

‎arch/arm/kernel/machine_kexec.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int machine_kexec_prepare(struct kimage *image)
5757
for (i = 0; i < image->nr_segments; i++) {
5858
current_segment = &image->segment[i];
5959

60-
if (!memblock_is_region_memory(current_segment->mem,
60+
if (!memblock_is_region_memory(idmap_to_phys(current_segment->mem),
6161
current_segment->memsz))
6262
return -EINVAL;
6363

0 commit comments

Comments
 (0)