aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/fadump.c
diff options
context:
space:
mode:
authorHari Bathini <hbathini@linux.ibm.com>2022-04-06 15:08:38 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2022-04-26 22:38:13 +1000
commit9cf3b3a33a36ef4a988be0a770edd3555297f2a9 (patch)
treefdb84095ae2c60e0226a6dd2bfdea3e64f8bea88 /arch/powerpc/kernel/fadump.c
parentpowerpc/fadump: fix PT_LOAD segment for boot memory area (diff)
downloadlinux-dev-9cf3b3a33a36ef4a988be0a770edd3555297f2a9.tar.xz
linux-dev-9cf3b3a33a36ef4a988be0a770edd3555297f2a9.zip
powerpc/fadump: align destination address to pagesize
On crash, boot memory area is copied to a destination address by f/w. This region is setup as separate PT_LOAD segment with appropriate offset to handle the different physical address and offset in vmcore. If this destination address is not page aligned, reading the vmcore with mmap is likely to fail forcing tools like makedumpfile to fall back to regular read. Avoid mmap read failure by ensuring that the destination address is always page aligned. Signed-off-by: Hari Bathini <hbathini@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220406093839.206608-3-hbathini@linux.ibm.com
Diffstat (limited to 'arch/powerpc/kernel/fadump.c')
-rw-r--r--arch/powerpc/kernel/fadump.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 044fbf7e4d8a..4f2bd7952604 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -365,6 +365,11 @@ static unsigned long __init get_fadump_area_size(void)
size += fw_dump.cpu_state_data_size;
size += fw_dump.hpte_region_size;
+ /*
+ * Account for pagesize alignment of boot memory area destination address.
+ * This faciliates in mmap reading of first kernel's memory.
+ */
+ size = PAGE_ALIGN(size);
size += fw_dump.boot_memory_size;
size += sizeof(struct fadump_crash_info_header);
size += sizeof(struct elfhdr); /* ELF core header.*/