Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 1 | From edf186f45d543e318400195cc25175387ff3f5c4 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 2 | From: Andrea Adami <andrea.adami@gmail.com> |
| 3 | Date: Sun, 26 Aug 2018 21:40:06 +0200 |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 4 | Subject: [PATCH] arm- backport from oe-core |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 5 | |
| 6 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 7 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 8 | --- |
| 9 | kexec/arch/arm/crashdump-arm.c | 5 ++++- |
| 10 | 1 file changed, 4 insertions(+), 1 deletion(-) |
| 11 | |
| 12 | diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 13 | index daa4788..3f72b38 100644 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 14 | --- 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 | |