arch/arm64/kernel/machine_kexec_file.c | 3 +++ 1 file changed, 3 insertions(+)
Like crashk_res, Calling crash_exclude_mem_range function with
crashk_low_res area would need extra crash_mem range too.
Add one extra crash_mem range when crashk_low_res is used.
Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
---
arch/arm64/kernel/machine_kexec_file.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kernel/machine_kexec_file.c
b/arch/arm64/kernel/machine_kexec_file.c
index 889951291cc0..378aee04e7d4 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -51,6 +51,9 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
for_each_mem_range(i, &start, &end)
nr_ranges++;
+ if (crashk_low_res.end)
+ nr_ranges++; /**< for exclusion of
crashkernel=size,low region */
+
cmem = kmalloc(struct_size(cmem, ranges, nr_ranges), GFP_KERNEL);
if (!cmem)
return -ENOMEM;
--
2.35.1
On 08/30/22 at 01:28pm, Yun Levi wrote: > Like crashk_res, Calling crash_exclude_mem_range function with > crashk_low_res area would need extra crash_mem range too. > Add one extra crash_mem range when crashk_low_res is used. > > Signed-off-by: Levi Yun <ppbuk5246@gmail.com> > --- > arch/arm64/kernel/machine_kexec_file.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm64/kernel/machine_kexec_file.c > b/arch/arm64/kernel/machine_kexec_file.c > index 889951291cc0..378aee04e7d4 100644 > --- a/arch/arm64/kernel/machine_kexec_file.c > +++ b/arch/arm64/kernel/machine_kexec_file.c > @@ -51,6 +51,9 @@ static int prepare_elf_headers(void **addr, unsigned long *sz) > for_each_mem_range(i, &start, &end) > nr_ranges++; > > + if (crashk_low_res.end) > + nr_ranges++; /**< for exclusion of > crashkernel=size,low region */ > + Right, excluding crashkernel region may cause memory region splitting, so we need extra slot for that. Meanwhile, can you fix above code comment mess? Otherwise, this looks good to me. Or we can add extra 2 slots like we do in x86, it just add another 16 bytes temporarily. > cmem = kmalloc(struct_size(cmem, ranges, nr_ranges), GFP_KERNEL); > if (!cmem) > return -ENOMEM; > -- > 2.35.1 >
> Right, excluding crashkernel region may cause memory region splitting, > so we need extra slot for that. > > Meanwhile, can you fix above code comment mess? Otherwise, this looks > good to me. Thanks! I'll remove the comment. > Or we can add extra 2 slots like we do in x86, it just add another 16 > bytes temporarily. Agree. I'll send the patch again by modifying nr_ranges' initialized value as 2. Thanks!
Like crashk_res, Calling crash_exclude_mem_range function with
crashk_low_res area would need extra crash_mem range too.
Add one more extra cmem range slot in case of crashk_low_res is used.
Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
---
arch/arm64/kernel/machine_kexec_file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
index 889951291cc0..a11a6e14ba89 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -47,7 +47,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
u64 i;
phys_addr_t start, end;
- nr_ranges = 1; /* for exclusion of crashkernel region */
+ nr_ranges = 2; /* for exclusion of crashkernel region */
for_each_mem_range(i, &start, &end)
nr_ranges++;
--
2.35.1
On Tue, Aug 30, 2022 at 06:28:39PM +0900, Levi Yun wrote: > Like crashk_res, Calling crash_exclude_mem_range function with > crashk_low_res area would need extra crash_mem range too. > > Add one more extra cmem range slot in case of crashk_low_res is used. > > Signed-off-by: Levi Yun <ppbuk5246@gmail.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Does this need a Fixes tag and cc stable? -- Catalin
> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
>
> Does this need a Fixes tag and cc stable?
>
> --
> Catalin
IMHO, it seems good to add two tags like:
Fixes: 3751e728cef29 ("arm64: kexec_file: add crash dump support")
Cc: stable@vger.kernel.org
BTW, To add above two tags, should I resend the patch again with
former tags (Acked-by & Reviewed-by)?
Thanks.
--
Best regards,
Levi
On 08/31/22 at 09:38am, Yun Levi wrote:
> > Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> >
> > Does this need a Fixes tag and cc stable?
> >
> > --
> > Catalin
>
> IMHO, it seems good to add two tags like:
> Fixes: 3751e728cef29 ("arm64: kexec_file: add crash dump support")
> Cc: stable@vger.kernel.org
No, I don't think the Fixes commit is right. It should fix the commit
where crashkernel,low is introduced. Before that, no issue caused.
So the tags should be:
Fixes: 944a45abfabc ("arm64: kdump: Reimplement crashkernel=X")
Cc: stable@vger.kernel.org
> No, I don't think the Fixes commit is right. It should fix the commit
> where crashkernel,low is introduced. Before that, no issue caused.
> So the tags should be:
>
> Fixes: 944a45abfabc ("arm64: kdump: Reimplement crashkernel=X")
> Cc: stable@vger.kernel.org
Thanks! I'will resend the patch with fixed commit message and the tags
including Fixes, Cc, Review-By and Acked-by.
Like crashk_res, Calling crash_exclude_mem_range function with
crashk_low_res area would need extra crash_mem range too.
Add one more extra cmem slot in case of crashk_low_res is used.
Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
Fixes: 944a45abfabc ("arm64: kdump: Reimplement crashkernel=X")
Cc: stable@vger.kernel.org
Acked-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
---
arch/arm64/kernel/machine_kexec_file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/machine_kexec_file.c
b/arch/arm64/kernel/machine_kexec_file.c
index 889951291cc0..a11a6e14ba89 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -47,7 +47,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
u64 i;
phys_addr_t start, end;
- nr_ranges = 1; /* for exclusion of crashkernel region */
+ nr_ranges = 2; /* for exclusion of crashkernel region */
for_each_mem_range(i, &start, &end)
nr_ranges++;
--
2.35.1
On Wed, Aug 31, 2022 at 10:49:30AM +0900, Yun Levi wrote:
> Like crashk_res, Calling crash_exclude_mem_range function with
> crashk_low_res area would need extra crash_mem range too.
>
> Add one more extra cmem slot in case of crashk_low_res is used.
>
> Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
> Fixes: 944a45abfabc ("arm64: kdump: Reimplement crashkernel=X")
> Cc: stable@vger.kernel.org
To be even more precise, it should be:
Cc: <stable@vger.kernel.org> # 5.19.x
> Acked-by: Baoquan He <bhe@redhat.com>
> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> ---
> arch/arm64/kernel/machine_kexec_file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/machine_kexec_file.c
> b/arch/arm64/kernel/machine_kexec_file.c
> index 889951291cc0..a11a6e14ba89 100644
> --- a/arch/arm64/kernel/machine_kexec_file.c
> +++ b/arch/arm64/kernel/machine_kexec_file.c
> @@ -47,7 +47,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
> u64 i;
> phys_addr_t start, end;
>
> - nr_ranges = 1; /* for exclusion of crashkernel region */
> + nr_ranges = 2; /* for exclusion of crashkernel region */
> for_each_mem_range(i, &start, &end)
> nr_ranges++;
Something happened to the whitespace here, so the patch can't be
applied.
--
Catalin
>
> To be even more precise, it should be:
>
> Cc: <stable@vger.kernel.org> # 5.19.x
Thanks! I'll fix it!
> Something happened to the whitespace here, so the patch can't be
> applied.
Sorry, I'll check and send again :). Thanks!
On Wed, Aug 31, 2022 at 7:26 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Wed, Aug 31, 2022 at 10:49:30AM +0900, Yun Levi wrote:
> > Like crashk_res, Calling crash_exclude_mem_range function with
> > crashk_low_res area would need extra crash_mem range too.
> >
> > Add one more extra cmem slot in case of crashk_low_res is used.
> >
> > Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
> > Fixes: 944a45abfabc ("arm64: kdump: Reimplement crashkernel=X")
> > Cc: stable@vger.kernel.org
>
> To be even more precise, it should be:
>
> Cc: <stable@vger.kernel.org> # 5.19.x
>
> > Acked-by: Baoquan He <bhe@redhat.com>
> > Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> > ---
> > arch/arm64/kernel/machine_kexec_file.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/kernel/machine_kexec_file.c
> > b/arch/arm64/kernel/machine_kexec_file.c
> > index 889951291cc0..a11a6e14ba89 100644
> > --- a/arch/arm64/kernel/machine_kexec_file.c
> > +++ b/arch/arm64/kernel/machine_kexec_file.c
> > @@ -47,7 +47,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
> > u64 i;
> > phys_addr_t start, end;
> >
> > - nr_ranges = 1; /* for exclusion of crashkernel region */
> > + nr_ranges = 2; /* for exclusion of crashkernel region */
> > for_each_mem_range(i, &start, &end)
> > nr_ranges++;
>
> Something happened to the whitespace here, so the patch can't be
> applied.
>
> --
> Catalin
Like crashk_res, Calling crash_exclude_mem_range function with
crashk_low_res area would need extra crash_mem range too.
Add one more extra cmem slot in case of crashk_low_res is used.
Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
Fixes: 944a45abfabc ("arm64: kdump: Reimplement crashkernel=X")
Cc: <stable@vger.kernel.org> # 5.19.x
Acked-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
---
arch/arm64/kernel/machine_kexec_file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
index 889951291cc0..a11a6e14ba89 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -47,7 +47,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
u64 i;
phys_addr_t start, end;
- nr_ranges = 1; /* for exclusion of crashkernel region */
+ nr_ranges = 2; /* for exclusion of crashkernel region */
for_each_mem_range(i, &start, &end)
nr_ranges++;
--
2.35.1
On Wed, 31 Aug 2022 19:39:13 +0900, Levi Yun wrote:
> Like crashk_res, Calling crash_exclude_mem_range function with
> crashk_low_res area would need extra crash_mem range too.
>
> Add one more extra cmem slot in case of crashk_low_res is used.
>
>
Applied to arm64 (for-next/fixes), thanks!
[1/1] arm64/kexec: Fix missing extra range for crashkres_low.
https://git.kernel.org/arm64/c/4831be702b95
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
On 08/30/22 at 06:28pm, Levi Yun wrote:
> Like crashk_res, Calling crash_exclude_mem_range function with
> crashk_low_res area would need extra crash_mem range too.
>
> Add one more extra cmem range slot in case of crashk_low_res is used.
~~^ should be removed.
LGTM,
Acked-by: Baoquan He <bhe@redhat.com>
>
> Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
> ---
> arch/arm64/kernel/machine_kexec_file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
> index 889951291cc0..a11a6e14ba89 100644
> --- a/arch/arm64/kernel/machine_kexec_file.c
> +++ b/arch/arm64/kernel/machine_kexec_file.c
> @@ -47,7 +47,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
> u64 i;
> phys_addr_t start, end;
>
> - nr_ranges = 1; /* for exclusion of crashkernel region */
> + nr_ranges = 2; /* for exclusion of crashkernel region */
> for_each_mem_range(i, &start, &end)
> nr_ranges++;
>
> --
> 2.35.1
>
© 2016 - 2026 Red Hat, Inc.