arm64/kexec: Fix missing extra range for crashkres_low.
Subsystems (4)
PATCH 1/1 arm64/kexec: Fix missing extra range for crashkres_low.
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.
--- arch/arm64/kernel/machine_kexec_file.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/kernel/machine_kexec_file.c +3 -0
@@ -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
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.
--- arch/arm64/kernel/machine_kexec_file.c | 3 +++ 1 file changed, 3 insertions(+)
(quoted diff) +0 -0
b/arch/arm64/kernel/machine_kexec_file.c
index 889951291cc0..378aee04e7d4 100644
arch/arm64/kernel/machine_kexec_file.c +2 -0
@@ -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
Quoted 20 lines · Yun Levi
Like
crashk_res, Callingcrash_exclude_mem_rangefunction withcrashk_low_resarea would need extracrash_memrange too. Add one extracrash_memrange whencrashk_low_resis used.Signed-off-by Levi Yun <[email protected]>--- arch/arm64/kernel/machine_kexec_file.c | 3 +++ 1 file changed, 3 insertions(+)arch/arm64/kernel/machine_kexec_file.c +2
-0@@ -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
Quoted 2 lines
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.
Quoted 6 lines
cmem = kmalloc(struct_size(cmem, ranges, nr_ranges), GFP_KERNEL); if (!cmem) return -ENOMEM;--
2.35.1
Quoted 5 lines
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.
Quoted 2 lines
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!
PATCH v2 1/1 arm64/kexec: Fix missing extra range for crashkres_low.
In reply to Yun LeviLike 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.
--- arch/arm64/kernel/machine_kexec_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/machine_kexec_file.c +1 -1
@@ -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++;
Signature · 1 line
2.35.1
Quoted 4 lines · Levi Yun
Like
crashk_res, Callingcrash_exclude_mem_rangefunction withcrashk_low_resarea would need extracrash_memrange too.Add one more extra cmem range slot in case of
crashk_low_resis used.
~~^ should be removed.
LGTM,
Quoted 22 lines
Signed-off-by Levi Yun <[email protected]>--- arch/arm64/kernel/machine_kexec_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/kernel/machine_kexec_file.c +1
-1@@ -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++;Signature · 1 line
2.35.1
Quoted 6 lines · Levi Yun
Like
crashk_res, Callingcrash_exclude_mem_rangefunction withcrashk_low_resarea would need extracrash_memrange too.Add one more extra cmem range slot in case of
crashk_low_resis used.Signed-off-by Levi Yun <[email protected]>
Does this need a Fixes tag and cc stable?
Signature · 1 line
Catalin
Quoted 6 lines
Reviewed-by Catalin Marinas <[email protected]>Does this need a Fixes tag and cc stable?
--
Catalin
IMHO, it seems good to add two tags like:
BTW, To add above two tags, should I resend the patch again with former tags (Acked-by & Reviewed-by)?
Thanks.
Signature · 7 lines
Best regards, Levi _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 10 lines · Yun Levi
Quoted 6 lines
Reviewed-by Catalin Marinas <[email protected]>Does this need a Fixes tag and cc stable?
--
CatalinIMHO, it seems good to add two tags like:
Fixes 3751e728cef29 ("arm64: kexec_file: add crash dump support")
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:
Quoted 6 lines
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")
Thanks! I'will resend the patch with fixed commit message and the tags including Fixes, Cc, Review-By and Acked-by.
PATCH 1/1 arm64/kexec: Fix missing extra range for crashkres_low.
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.
--- arch/arm64/kernel/machine_kexec_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0
b/arch/arm64/kernel/machine_kexec_file.c
index 889951291cc0..a11a6e14ba89 100644
arch/arm64/kernel/machine_kexec_file.c +1 -1
@@ -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++;
Signature · 1 line
2.35.1
Catalin Marinas
maintainerQuoted 8 lines · Yun Levi
Like
crashk_res, Callingcrash_exclude_mem_rangefunction withcrashk_low_resarea would need extracrash_memrange too.Add one more extra cmem slot in case of
crashk_low_resis used.Signed-off-by Levi Yun <[email protected]>Fixes 944a45abfabc ("arm64: kdump: Reimplement crashkernel=X")
To be even more precise, it should be:
Quoted 12 lines
Acked-by Baoquan He <[email protected]>Reviewed-by Catalin Marinas <[email protected]>--- arch/arm64/kernel/machine_kexec_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/kernel/machine_kexec_file.c +0
-0
arch/arm64/kernel/machine_kexec_file.c static int prepare_elf_headers(void **addr, unsigned long *sz) · line 52
Quoted 7 lines
arch/arm64/kernel/machine_kexec_file.c +1
-1@@ -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.
Signature · 1 line
Catalin
Quoted 4 lines
To be even more precise, it should be:
Cc <[email protected]> # 5.19.x
Thanks! I'll fix it!
Quoted 2 lines
Something happened to the whitespace here, so the patch can't be applied.
Sorry, I'll check and send again :). Thanks!
Quoted 40 lines · Catalin Marinas
Quoted 8 lines · Yun Levi
Like
crashk_res, Callingcrash_exclude_mem_rangefunction withcrashk_low_resarea would need extracrash_memrange too.Add one more extra cmem slot in case of
crashk_low_resis used.Signed-off-by Levi Yun <[email protected]>Fixes 944a45abfabc ("arm64: kdump: Reimplement crashkernel=X")To be even more precise, it should be:
Cc <[email protected]> # 5.19.xQuoted 12 lines
Acked-by Baoquan He <[email protected]>Reviewed-by Catalin Marinas <[email protected]>--- arch/arm64/kernel/machine_kexec_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/kernel/machine_kexec_file.c +0
-0arch/arm64/kernel/machine_kexec_file.c static int prepare_elf_headers(void **addr, unsigned long *sz) · line 52
Quoted 7 lines
arch/arm64/kernel/machine_kexec_file.c +1
-1@@ -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
PATCH v3 1/1 arm64/kexec: Fix missing extra range for crashkres_low.
In reply to Yun LeviLike 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.
--- arch/arm64/kernel/machine_kexec_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/machine_kexec_file.c +1 -1
@@ -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
Quoted 6 lines · Levi Yun
Like
crashk_res, Callingcrash_exclude_mem_rangefunction withcrashk_low_resarea would need extracrash_memrange too.Add one more extra cmem slot in case of
crashk_low_resis 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,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev