* [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel.
@ 2017-01-03 9:05 Haiqing Bai
2017-01-04 14:31 ` Burton, Ross
0 siblings, 1 reply; 6+ messages in thread
From: Haiqing Bai @ 2017-01-03 9:05 UTC (permalink / raw)
To: openembedded-core
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).
Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
---
...-ARM-fix-add_buffer_phys_virt-align-issue.patch | 52 ++++++++++++++++++++++
meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb | 1 +
2 files changed, 53 insertions(+)
create mode 100644 meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
new file mode 100644
index 0000000..7d1f95e
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
@@ -0,0 +1,52 @@
+From 380019f68e19ac863cf32dc7ff6784e8fe1d751f Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Mon, 19 Dec 2016 14:52:02 +0800
+Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue.
+
+When "CONFIG_ARM_LPAE" is enabled,3 level page table
+is used by MMU, the "SECTION_SIZE" is defined with
+(1 << 21), but 'add_buffer_phys_virt()' hardcode this
+to (1 << 20).
+
+Upstream-Status: Pending
+
+Suggested-By:fredrik.markstrom@gmail.com
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ kexec/arch/arm/crashdump-arm.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
+index 38a1401..e41b7fb 100644
+--- a/kexec/arch/arm/crashdump-arm.c
++++ b/kexec/arch/arm/crashdump-arm.c
+@@ -271,6 +271,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ void *buf;
+ int err;
+ int last_ranges;
++ unsigned short align_bit_shift = 20;
+
+ /*
+ * First fetch all the memory (RAM) ranges that we are going to pass to
+@@ -295,6 +296,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+
+ /* for support LPAE enabled kernel*/
+ elf_info.class = ELFCLASS64;
++ align_bit_shift = 21;
+
+ err = crash_create_elf64_headers(info, &elf_info,
+ usablemem_rgns.ranges,
+@@ -315,8 +317,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ * 1MB) so that available memory passed in kernel command line will be
+ * aligned to 1MB. This is because kernel create_mapping() wants memory
+ * regions to be aligned to SECTION_SIZE.
++ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h
+ */
+- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
++ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift,
+ crash_reserved_mem.start,
+ crash_reserved_mem.end, -1, 0);
+
+--
+1.9.1
+
diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
index 59376c8..3e38923 100644
--- a/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
+++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
@@ -8,6 +8,7 @@ SRC_URI += " \
file://0002-powerpc-change-the-memory-size-limit.patch \
file://0001-purgatory-Pass-r-directly-to-linker.patch \
file://0001-vmcore-dmesg-Define-_GNU_SOURCE.patch \
+ file://kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch \
"
SRC_URI[md5sum] = "10ddaae0e86af54407b164a1f5a39cc3"
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel.
2017-01-03 9:05 [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel Haiqing Bai
@ 2017-01-04 14:31 ` Burton, Ross
2017-01-06 2:40 ` Bai, Haiqing
0 siblings, 1 reply; 6+ messages in thread
From: Burton, Ross @ 2017-01-04 14:31 UTC (permalink / raw)
To: Haiqing Bai; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 4446 bytes --]
An upgrade to 2.0.14 was recently posted on the list (and is now in
poky-contrib:ross/mut), can you verify that this patch is still required
with that release and rebase?
Ross
On 3 January 2017 at 09:05, Haiqing Bai <Haiqing.Bai@windriver.com> wrote:
> 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).
>
> Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
> ---
> ...-ARM-fix-add_buffer_phys_virt-align-issue.patch | 52
> ++++++++++++++++++++++
> meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb | 1 +
> 2 files changed, 53 insertions(+)
> create mode 100644 meta/recipes-kernel/kexec/
> kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
>
> diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_
> buffer_phys_virt-align-issue.patch b/meta/recipes-kernel/kexec/
> kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
> new file mode 100644
> index 0000000..7d1f95e
> --- /dev/null
> +++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_
> buffer_phys_virt-align-issue.patch
> @@ -0,0 +1,52 @@
> +From 380019f68e19ac863cf32dc7ff6784e8fe1d751f Mon Sep 17 00:00:00 2001
> +From: Haiqing Bai <Haiqing.Bai@windriver.com>
> +Date: Mon, 19 Dec 2016 14:52:02 +0800
> +Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue.
> +
> +When "CONFIG_ARM_LPAE" is enabled,3 level page table
> +is used by MMU, the "SECTION_SIZE" is defined with
> +(1 << 21), but 'add_buffer_phys_virt()' hardcode this
> +to (1 << 20).
> +
> +Upstream-Status: Pending
> +
> +Suggested-By:fredrik.markstrom@gmail.com
> +Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
> +---
> + kexec/arch/arm/crashdump-arm.c | 5 ++++-
> + 1 file changed, 4 insertions(+), 1 deletion(-)
> +
> +diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-
> arm.c
> +index 38a1401..e41b7fb 100644
> +--- a/kexec/arch/arm/crashdump-arm.c
> ++++ b/kexec/arch/arm/crashdump-arm.c
> +@@ -271,6 +271,7 @@ int load_crashdump_segments(struct kexec_info *info,
> char *mod_cmdline)
> + void *buf;
> + int err;
> + int last_ranges;
> ++ unsigned short align_bit_shift = 20;
> +
> + /*
> + * First fetch all the memory (RAM) ranges that we are going to
> pass to
> +@@ -295,6 +296,7 @@ int load_crashdump_segments(struct kexec_info *info,
> char *mod_cmdline)
> +
> + /* for support LPAE enabled kernel*/
> + elf_info.class = ELFCLASS64;
> ++ align_bit_shift = 21;
> +
> + err = crash_create_elf64_headers(info, &elf_info,
> + usablemem_rgns.ranges,
> +@@ -315,8 +317,9 @@ int load_crashdump_segments(struct kexec_info *info,
> char *mod_cmdline)
> + * 1MB) so that available memory passed in kernel command line
> will be
> + * aligned to 1MB. This is because kernel create_mapping() wants
> memory
> + * regions to be aligned to SECTION_SIZE.
> ++ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in
> pgtable-3level.h
> + */
> +- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
> ++ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 <<
> align_bit_shift,
> + crash_reserved_mem.start,
> + crash_reserved_mem.end, -1, 0);
> +
> +--
> +1.9.1
> +
> diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
> b/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
> index 59376c8..3e38923 100644
> --- a/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
> +++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
> @@ -8,6 +8,7 @@ SRC_URI += " \
> file://0002-powerpc-change-the-memory-size-limit.patch \
> file://0001-purgatory-Pass-r-directly-to-linker.patch \
> file://0001-vmcore-dmesg-Define-_GNU_SOURCE.patch \
> + file://kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch \
> "
>
> SRC_URI[md5sum] = "10ddaae0e86af54407b164a1f5a39cc3"
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
[-- Attachment #2: Type: text/html, Size: 6196 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel.
2017-01-04 14:31 ` Burton, Ross
@ 2017-01-06 2:40 ` Bai, Haiqing
2017-01-06 14:32 ` Burton, Ross
0 siblings, 1 reply; 6+ messages in thread
From: Bai, Haiqing @ 2017-01-06 2:40 UTC (permalink / raw)
To: BURTON, ROSS; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 5215 bytes --]
Hi, Ross:
I clone the branch (poky-contrib:ross/mut) and did’t find the fix in 2.0.14, so this fix is still required. Thanks
B,R
Haiqing Bai
From: Burton, Ross [mailto:ross.burton@intel.com]
Sent: 2017年1月4日 22:32
To: Bai, Haiqing
Cc: OE-core
Subject: Re: [OE-core] [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel.
An upgrade to 2.0.14 was recently posted on the list (and is now in poky-contrib:ross/mut), can you verify that this patch is still required with that release and rebase?
Ross
On 3 January 2017 at 09:05, Haiqing Bai <Haiqing.Bai@windriver.com<mailto:Haiqing.Bai@windriver.com>> wrote:
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).
Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com<mailto:Haiqing.Bai@windriver.com>>
---
...-ARM-fix-add_buffer_phys_virt-align-issue.patch | 52 ++++++++++++++++++++++
meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb<http://kexec-tools_2.0.12.bb> | 1 +
2 files changed, 53 insertions(+)
create mode 100644 meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
new file mode 100644
index 0000000..7d1f95e
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
@@ -0,0 +1,52 @@
+From 380019f68e19ac863cf32dc7ff6784e8fe1d751f Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com<mailto:Haiqing.Bai@windriver.com>>
+Date: Mon, 19 Dec 2016 14:52:02 +0800
+Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue.
+
+When "CONFIG_ARM_LPAE" is enabled,3 level page table
+is used by MMU, the "SECTION_SIZE" is defined with
+(1 << 21), but 'add_buffer_phys_virt()' hardcode this
+to (1 << 20).
+
+Upstream-Status: Pending
+
+Suggested-By:fredrik.markstrom@gmail.com<mailto:Suggested-By%3Afredrik.markstrom@gmail.com>
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com<mailto:Haiqing.Bai@windriver.com>>
+---
+ kexec/arch/arm/crashdump-arm.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
+index 38a1401..e41b7fb 100644
+--- a/kexec/arch/arm/crashdump-arm.c
++++ b/kexec/arch/arm/crashdump-arm.c
+@@ -271,6 +271,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ void *buf;
+ int err;
+ int last_ranges;
++ unsigned short align_bit_shift = 20;
+
+ /*
+ * First fetch all the memory (RAM) ranges that we are going to pass to
+@@ -295,6 +296,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+
+ /* for support LPAE enabled kernel*/
+ elf_info.class = ELFCLASS64;
++ align_bit_shift = 21;
+
+ err = crash_create_elf64_headers(info, &elf_info,
+ usablemem_rgns.ranges,
+@@ -315,8 +317,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ * 1MB) so that available memory passed in kernel command line will be
+ * aligned to 1MB. This is because kernel create_mapping() wants memory
+ * regions to be aligned to SECTION_SIZE.
++ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h
+ */
+- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
++ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift,
+ crash_reserved_mem.start,
+ crash_reserved_mem.end, -1, 0);
+
+--
+1.9.1
+
diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb<http://kexec-tools_2.0.12.bb> b/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb<http://kexec-tools_2.0.12.bb>
index 59376c8..3e38923 100644
--- a/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb<http://kexec-tools_2.0.12.bb>
+++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb<http://kexec-tools_2.0.12.bb>
@@ -8,6 +8,7 @@ SRC_URI += " \
file://0002-powerpc-change-the-memory-size-limit.patch<file:///\\0002-powerpc-change-the-memory-size-limit.patch> \
file://0001-purgatory-Pass-r-directly-to-linker.patch<file:///\\0001-purgatory-Pass-r-directly-to-linker.patch> \
file://0001-vmcore-dmesg-Define-_GNU_SOURCE.patch<file:///\\0001-vmcore-dmesg-Define-_GNU_SOURCE.patch> \
+ file://kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch<file:///\\kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch> \
"
SRC_URI[md5sum] = "10ddaae0e86af54407b164a1f5a39cc3"
--
1.9.1
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org<mailto:Openembedded-core@lists.openembedded.org>
http://lists.openembedded.org/mailman/listinfo/openembedded-core
[-- Attachment #2: Type: text/html, Size: 11667 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel.
2017-01-06 2:40 ` Bai, Haiqing
@ 2017-01-06 14:32 ` Burton, Ross
2017-01-09 9:30 ` Bai, Haiqing
0 siblings, 1 reply; 6+ messages in thread
From: Burton, Ross @ 2017-01-06 14:32 UTC (permalink / raw)
To: Bai, Haiqing (Wind River); +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 5076 bytes --]
Can you rebase and resent the patch please then?
Cheers,
Ross
On 6 January 2017 at 02:40, Bai, Haiqing (Wind River) <
haiqing.bai@windriver.com> wrote:
> Hi, Ross:
>
>
>
> I clone the branch (poky-contrib:ross/mut) and did’t find the fix
> in 2.0.14, so this fix is still required. Thanks
>
>
>
> B,R
>
> Haiqing Bai
>
> *From:* Burton, Ross [mailto:ross.burton@intel.com]
> *Sent:* 2017年1月4日 22:32
> *To:* Bai, Haiqing
> *Cc:* OE-core
> *Subject:* Re: [OE-core] [PATCH] kexec: ARM: fix align issue of
> add_buffer_phys_virt() for LPAE kernel.
>
>
>
> An upgrade to 2.0.14 was recently posted on the list (and is now in
> poky-contrib:ross/mut), can you verify that this patch is still required
> with that release and rebase?
>
>
>
> Ross
>
>
>
> On 3 January 2017 at 09:05, Haiqing Bai <Haiqing.Bai@windriver.com> wrote:
>
> 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).
>
> Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
> ---
> ...-ARM-fix-add_buffer_phys_virt-align-issue.patch | 52
> ++++++++++++++++++++++
> meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb | 1 +
> 2 files changed, 53 insertions(+)
> create mode 100644 meta/recipes-kernel/kexec/
> kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
>
> diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_
> buffer_phys_virt-align-issue.patch b/meta/recipes-kernel/kexec/
> kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
> new file mode 100644
> index 0000000..7d1f95e
> --- /dev/null
> +++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_
> buffer_phys_virt-align-issue.patch
> @@ -0,0 +1,52 @@
> +From 380019f68e19ac863cf32dc7ff6784e8fe1d751f Mon Sep 17 00:00:00 2001
> +From: Haiqing Bai <Haiqing.Bai@windriver.com>
> +Date: Mon, 19 Dec 2016 14:52:02 +0800
> +Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue.
> +
> +When "CONFIG_ARM_LPAE" is enabled,3 level page table
> +is used by MMU, the "SECTION_SIZE" is defined with
> +(1 << 21), but 'add_buffer_phys_virt()' hardcode this
> +to (1 << 20).
> +
> +Upstream-Status: Pending
> +
> +Suggested-By:fredrik.markstrom@gmail.com
> +Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
> +---
> + kexec/arch/arm/crashdump-arm.c | 5 ++++-
> + 1 file changed, 4 insertions(+), 1 deletion(-)
> +
> +diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-
> arm.c
> +index 38a1401..e41b7fb 100644
> +--- a/kexec/arch/arm/crashdump-arm.c
> ++++ b/kexec/arch/arm/crashdump-arm.c
> +@@ -271,6 +271,7 @@ int load_crashdump_segments(struct kexec_info *info,
> char *mod_cmdline)
> + void *buf;
> + int err;
> + int last_ranges;
> ++ unsigned short align_bit_shift = 20;
> +
> + /*
> + * First fetch all the memory (RAM) ranges that we are going to
> pass to
> +@@ -295,6 +296,7 @@ int load_crashdump_segments(struct kexec_info *info,
> char *mod_cmdline)
> +
> + /* for support LPAE enabled kernel*/
> + elf_info.class = ELFCLASS64;
> ++ align_bit_shift = 21;
> +
> + err = crash_create_elf64_headers(info, &elf_info,
> + usablemem_rgns.ranges,
> +@@ -315,8 +317,9 @@ int load_crashdump_segments(struct kexec_info *info,
> char *mod_cmdline)
> + * 1MB) so that available memory passed in kernel command line
> will be
> + * aligned to 1MB. This is because kernel create_mapping() wants
> memory
> + * regions to be aligned to SECTION_SIZE.
> ++ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in
> pgtable-3level.h
> + */
> +- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
> ++ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 <<
> align_bit_shift,
> + crash_reserved_mem.start,
> + crash_reserved_mem.end, -1, 0);
> +
> +--
> +1.9.1
> +
> diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
> b/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
> index 59376c8..3e38923 100644
> --- a/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
> +++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
> @@ -8,6 +8,7 @@ SRC_URI += " \
> file://0002-powerpc-change-the-memory-size-limit.patch \
> file://0001-purgatory-Pass-r-directly-to-linker.patch \
> file://0001-vmcore-dmesg-Define-_GNU_SOURCE.patch \
> + file://kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch \
> "
>
> SRC_URI[md5sum] = "10ddaae0e86af54407b164a1f5a39cc3"
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>
>
[-- Attachment #2: Type: text/html, Size: 9543 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel.
2017-01-06 14:32 ` Burton, Ross
@ 2017-01-09 9:30 ` Bai, Haiqing
0 siblings, 0 replies; 6+ messages in thread
From: Bai, Haiqing @ 2017-01-09 9:30 UTC (permalink / raw)
To: BURTON, ROSS; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 5709 bytes --]
ok, I have sent the new patch for 2.0.14. Thanks
From: Burton, Ross [mailto:ross.burton@intel.com]
Sent: 2017年1月6日 22:32
To: Bai, Haiqing
Cc: OE-core
Subject: Re: [OE-core] [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel.
Can you rebase and resent the patch please then?
Cheers,
Ross
On 6 January 2017 at 02:40, Bai, Haiqing (Wind River) <haiqing.bai@windriver.com<mailto:haiqing.bai@windriver.com>> wrote:
Hi, Ross:
I clone the branch (poky-contrib:ross/mut) and did’t find the fix in 2.0.14, so this fix is still required. Thanks
B,R
Haiqing Bai
From: Burton, Ross [mailto:ross.burton@intel.com<mailto:ross.burton@intel.com>]
Sent: 2017年1月4日 22:32
To: Bai, Haiqing
Cc: OE-core
Subject: Re: [OE-core] [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel.
An upgrade to 2.0.14 was recently posted on the list (and is now in poky-contrib:ross/mut), can you verify that this patch is still required with that release and rebase?
Ross
On 3 January 2017 at 09:05, Haiqing Bai <Haiqing.Bai@windriver.com<mailto:Haiqing.Bai@windriver.com>> wrote:
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).
Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com<mailto:Haiqing.Bai@windriver.com>>
---
...-ARM-fix-add_buffer_phys_virt-align-issue.patch | 52 ++++++++++++++++++++++
meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb<http://kexec-tools_2.0.12.bb> | 1 +
2 files changed, 53 insertions(+)
create mode 100644 meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
new file mode 100644
index 0000000..7d1f95e
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch
@@ -0,0 +1,52 @@
+From 380019f68e19ac863cf32dc7ff6784e8fe1d751f Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com<mailto:Haiqing.Bai@windriver.com>>
+Date: Mon, 19 Dec 2016 14:52:02 +0800
+Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue.
+
+When "CONFIG_ARM_LPAE" is enabled,3 level page table
+is used by MMU, the "SECTION_SIZE" is defined with
+(1 << 21), but 'add_buffer_phys_virt()' hardcode this
+to (1 << 20).
+
+Upstream-Status: Pending
+
+Suggested-By:fredrik.markstrom@gmail.com<mailto:Suggested-By%3Afredrik.markstrom@gmail.com>
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com<mailto:Haiqing.Bai@windriver.com>>
+---
+ kexec/arch/arm/crashdump-arm.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
+index 38a1401..e41b7fb 100644
+--- a/kexec/arch/arm/crashdump-arm.c
++++ b/kexec/arch/arm/crashdump-arm.c
+@@ -271,6 +271,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ void *buf;
+ int err;
+ int last_ranges;
++ unsigned short align_bit_shift = 20;
+
+ /*
+ * First fetch all the memory (RAM) ranges that we are going to pass to
+@@ -295,6 +296,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+
+ /* for support LPAE enabled kernel*/
+ elf_info.class = ELFCLASS64;
++ align_bit_shift = 21;
+
+ err = crash_create_elf64_headers(info, &elf_info,
+ usablemem_rgns.ranges,
+@@ -315,8 +317,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ * 1MB) so that available memory passed in kernel command line will be
+ * aligned to 1MB. This is because kernel create_mapping() wants memory
+ * regions to be aligned to SECTION_SIZE.
++ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h
+ */
+- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
++ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift,
+ crash_reserved_mem.start,
+ crash_reserved_mem.end, -1, 0);
+
+--
+1.9.1
+
diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb<http://kexec-tools_2.0.12.bb> b/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb<http://kexec-tools_2.0.12.bb>
index 59376c8..3e38923 100644
--- a/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb<http://kexec-tools_2.0.12.bb>
+++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb<http://kexec-tools_2.0.12.bb>
@@ -8,6 +8,7 @@ SRC_URI += " \
file://0002-powerpc-change-the-memory-size-limit.patch<file:///\\0002-powerpc-change-the-memory-size-limit.patch> \
file://0001-purgatory-Pass-r-directly-to-linker.patch<file:///\\0001-purgatory-Pass-r-directly-to-linker.patch> \
file://0001-vmcore-dmesg-Define-_GNU_SOURCE.patch<file:///\\0001-vmcore-dmesg-Define-_GNU_SOURCE.patch> \
+ file://kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch<file:///\\kexec-ARM-fix-add_buffer_phys_virt-align-issue.patch> \
"
SRC_URI[md5sum] = "10ddaae0e86af54407b164a1f5a39cc3"
--
1.9.1
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org<mailto:Openembedded-core@lists.openembedded.org>
http://lists.openembedded.org/mailman/listinfo/openembedded-core
[-- Attachment #2: Type: text/html, Size: 15253 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel
@ 2017-01-09 8:15 Haiqing Bai
0 siblings, 0 replies; 6+ messages in thread
From: Haiqing Bai @ 2017-01-09 8:15 UTC (permalink / raw)
To: openembedded-core, ross.burton
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).
Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
---
...-ARM-Fix-add_buffer_phys_virt-align-issue.patch | 52 ++++++++++++++++++++++
meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb | 1 +
2 files changed, 53 insertions(+)
create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch
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 0000000..6c6c66d
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch
@@ -0,0 +1,52 @@
+From 78e497fb69950665e639cfab8f4fb50cc404a1eb Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Mon, 9 Jan 2017 15:26:29 +0800
+Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue
+
+When "CONFIG_ARM_LPAE" is enabled,3 level page table
+is used by MMU, the "SECTION_SIZE" is defined with
+(1 << 21), but 'add_buffer_phys_virt()' hardcode this
+to (1 << 20).
+
+Upstream-Status: Pending
+
+Suggested-By:fredrik.markstrom@gmail.com
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ kexec/arch/arm/crashdump-arm.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
+index 245c21a..12139c3 100644
+--- a/kexec/arch/arm/crashdump-arm.c
++++ b/kexec/arch/arm/crashdump-arm.c
+@@ -240,6 +240,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ void *buf;
+ int err;
+ int last_ranges;
++ unsigned short align_bit_shift = 20;
+
+ /*
+ * First fetch all the memory (RAM) ranges that we are going to pass to
+@@ -281,6 +282,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+
+ /* for support LPAE enabled kernel*/
+ elf_info.class = ELFCLASS64;
++ align_bit_shift = 21;
+
+ err = crash_create_elf64_headers(info, &elf_info,
+ usablemem_rgns.ranges,
+@@ -302,8 +304,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ * 1MB) so that available memory passed in kernel command line will be
+ * aligned to 1MB. This is because kernel create_mapping() wants memory
+ * regions to be aligned to SECTION_SIZE.
++ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h
+ */
+- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
++ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift,
+ crash_kernel_mem.start,
+ crash_kernel_mem.end, -1, 0);
+
+--
+1.9.1
+
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 899b391..af32320 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
file://0007-arm64-kdump-set-up-other-segments.patch \
file://0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch \
file://0009-arm64-kdump-Add-support-for-binary-image-files.patch \
+ file://0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \
"
SRC_URI[md5sum] = "b2b2c5e6b29d467d6e99d587fb6b7cf5"
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-01-09 9:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 9:05 [PATCH] kexec: ARM: fix align issue of add_buffer_phys_virt() for LPAE kernel Haiqing Bai
2017-01-04 14:31 ` Burton, Ross
2017-01-06 2:40 ` Bai, Haiqing
2017-01-06 14:32 ` Burton, Ross
2017-01-09 9:30 ` Bai, Haiqing
2017-01-09 8:15 Haiqing Bai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.