diff options
author | Haiqing Bai <Haiqing.Bai@windriver.com> | 2017-01-09 16:15:54 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-16 18:05:12 +0000 |
commit | 6e2b26eb22fe69e0b4b49829206b747584c30594 (patch) | |
tree | 2c2cb64d4c8e34af835eba396b3c322a957713a8 | |
parent | 753471db4534f121fe03b5d495fc3ec44f7207e7 (diff) | |
download | poky-6e2b26eb22fe69e0b4b49829206b747584c30594.tar.gz |
kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel
If LPAE is enabled, 3 level page table is used and the 'SECTION_SIZE'
is (1<<21), so add_buffer_phys_virt() should align to (1 << 21).
(From OE-Core rev: 582cad510953d3540ffe35b10b1ce2a8d034b535)
Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch | 52 | ||||
-rw-r--r-- | meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb | 1 |
2 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch b/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch new file mode 100644 index 0000000000..6c6c66d885 --- /dev/null +++ b/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 78e497fb69950665e639cfab8f4fb50cc404a1eb Mon Sep 17 00:00:00 2001 | ||
2 | From: Haiqing Bai <Haiqing.Bai@windriver.com> | ||
3 | Date: Mon, 9 Jan 2017 15:26:29 +0800 | ||
4 | Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue | ||
5 | |||
6 | When "CONFIG_ARM_LPAE" is enabled,3 level page table | ||
7 | is used by MMU, the "SECTION_SIZE" is defined with | ||
8 | (1 << 21), but 'add_buffer_phys_virt()' hardcode this | ||
9 | to (1 << 20). | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Suggested-By:fredrik.markstrom@gmail.com | ||
14 | Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com> | ||
15 | --- | ||
16 | kexec/arch/arm/crashdump-arm.c | 5 ++++- | ||
17 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c | ||
20 | index 245c21a..12139c3 100644 | ||
21 | --- a/kexec/arch/arm/crashdump-arm.c | ||
22 | +++ b/kexec/arch/arm/crashdump-arm.c | ||
23 | @@ -240,6 +240,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) | ||
24 | void *buf; | ||
25 | int err; | ||
26 | int last_ranges; | ||
27 | + unsigned short align_bit_shift = 20; | ||
28 | |||
29 | /* | ||
30 | * First fetch all the memory (RAM) ranges that we are going to pass to | ||
31 | @@ -281,6 +282,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) | ||
32 | |||
33 | /* for support LPAE enabled kernel*/ | ||
34 | elf_info.class = ELFCLASS64; | ||
35 | + align_bit_shift = 21; | ||
36 | |||
37 | err = crash_create_elf64_headers(info, &elf_info, | ||
38 | usablemem_rgns.ranges, | ||
39 | @@ -302,8 +304,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) | ||
40 | * 1MB) so that available memory passed in kernel command line will be | ||
41 | * aligned to 1MB. This is because kernel create_mapping() wants memory | ||
42 | * regions to be aligned to SECTION_SIZE. | ||
43 | + * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h | ||
44 | */ | ||
45 | - elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20, | ||
46 | + elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift, | ||
47 | crash_kernel_mem.start, | ||
48 | crash_kernel_mem.end, -1, 0); | ||
49 | |||
50 | -- | ||
51 | 1.9.1 | ||
52 | |||
diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb index 899b391ecf..af323207f0 100644 --- a/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb +++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb | |||
@@ -15,6 +15,7 @@ SRC_URI += "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.g | |||
15 | file://0007-arm64-kdump-set-up-other-segments.patch \ | 15 | file://0007-arm64-kdump-set-up-other-segments.patch \ |
16 | file://0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch \ | 16 | file://0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch \ |
17 | file://0009-arm64-kdump-Add-support-for-binary-image-files.patch \ | 17 | file://0009-arm64-kdump-Add-support-for-binary-image-files.patch \ |
18 | file://0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \ | ||
18 | " | 19 | " |
19 | 20 | ||
20 | SRC_URI[md5sum] = "b2b2c5e6b29d467d6e99d587fb6b7cf5" | 21 | SRC_URI[md5sum] = "b2b2c5e6b29d467d6e99d587fb6b7cf5" |