summaryrefslogtreecommitdiffstats
path: root/kernel/kexec_file.c
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2018-11-15 00:52:44 -0500
committerWill Deacon <will.deacon@arm.com>2018-12-06 09:38:50 -0500
commit497e1858647a0b859076dc96300527375977d76a (patch)
tree6d4862bac0465c42164091c7ba13c5f91668b3ec /kernel/kexec_file.c
parent735c2f90e333b3d0adee52a8e7e855a0c0eca284 (diff)
kexec_file: kexec_walk_memblock() only walks a dedicated region at kdump
In kdump case, there exists only one dedicated memblock region as usable memory (crashk_res). With this patch, kexec_walk_memblock() runs a given callback function on this region. Cosmetic change: 0 to MEMBLOCK_NONE at for_each_free_mem_range*() Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Acked-by: Dave Young <dyoung@redhat.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Baoquan He <bhe@redhat.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'kernel/kexec_file.c')
-rw-r--r--kernel/kexec_file.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index d03195a8cb6e..f1d0e00a3971 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -515,8 +515,11 @@ static int kexec_walk_memblock(struct kexec_buf *kbuf,
515 phys_addr_t mstart, mend; 515 phys_addr_t mstart, mend;
516 struct resource res = { }; 516 struct resource res = { };
517 517
518 if (kbuf->image->type == KEXEC_TYPE_CRASH)
519 return func(&crashk_res, kbuf);
520
518 if (kbuf->top_down) { 521 if (kbuf->top_down) {
519 for_each_free_mem_range_reverse(i, NUMA_NO_NODE, 0, 522 for_each_free_mem_range_reverse(i, NUMA_NO_NODE, MEMBLOCK_NONE,
520 &mstart, &mend, NULL) { 523 &mstart, &mend, NULL) {
521 /* 524 /*
522 * In memblock, end points to the first byte after the 525 * In memblock, end points to the first byte after the
@@ -530,8 +533,8 @@ static int kexec_walk_memblock(struct kexec_buf *kbuf,
530 break; 533 break;
531 } 534 }
532 } else { 535 } else {
533 for_each_free_mem_range(i, NUMA_NO_NODE, 0, &mstart, &mend, 536 for_each_free_mem_range(i, NUMA_NO_NODE, MEMBLOCK_NONE,
534 NULL) { 537 &mstart, &mend, NULL) {
535 /* 538 /*
536 * In memblock, end points to the first byte after the 539 * In memblock, end points to the first byte after the
537 * range while in kexec, end points to the last byte 540 * range while in kexec, end points to the last byte