blob: 5323a81e6b523edf524dc58e8b29aaa01fd7713d [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From edf186f45d543e318400195cc25175387ff3f5c4 Mon Sep 17 00:00:00 2001
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08002From: Andrea Adami <andrea.adami@gmail.com>
3Date: Sun, 26 Aug 2018 21:40:06 +0200
Brad Bishop26bdd442019-08-16 17:08:17 -04004Subject: [PATCH] arm- backport from oe-core
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005
6Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Brad Bishop26bdd442019-08-16 17:08:17 -04007
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08008---
9 kexec/arch/arm/crashdump-arm.c | 5 ++++-
10 1 file changed, 4 insertions(+), 1 deletion(-)
11
12diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
Brad Bishop26bdd442019-08-16 17:08:17 -040013index daa4788..3f72b38 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080014--- a/kexec/arch/arm/crashdump-arm.c
15+++ b/kexec/arch/arm/crashdump-arm.c
16@@ -240,6 +240,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
17 void *buf;
18 int err;
19 int last_ranges;
20+ unsigned short align_bit_shift = 20;
21
22 /*
23 * First fetch all the memory (RAM) ranges that we are going to pass to
24@@ -281,6 +282,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
25
26 /* for support LPAE enabled kernel*/
27 elf_info.class = ELFCLASS64;
28+ align_bit_shift = 21;
29
30 err = crash_create_elf64_headers(info, &elf_info,
31 usablemem_rgns.ranges,
32@@ -302,8 +304,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
33 * 1MB) so that available memory passed in kernel command line will be
34 * aligned to 1MB. This is because kernel create_mapping() wants memory
35 * regions to be aligned to SECTION_SIZE.
36+ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h
37 */
38- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
39+ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift,
40 crash_kernel_mem.start,
41 crash_kernel_mem.end, -1, 0);
42