mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 08:35:19 -05:00
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>
This commit is contained in:
parent
735c2f90e3
commit
497e185864
1 changed files with 6 additions and 3 deletions
|
@ -515,8 +515,11 @@ static int kexec_walk_memblock(struct kexec_buf *kbuf,
|
||||||
phys_addr_t mstart, mend;
|
phys_addr_t mstart, mend;
|
||||||
struct resource res = { };
|
struct resource res = { };
|
||||||
|
|
||||||
|
if (kbuf->image->type == KEXEC_TYPE_CRASH)
|
||||||
|
return func(&crashk_res, kbuf);
|
||||||
|
|
||||||
if (kbuf->top_down) {
|
if (kbuf->top_down) {
|
||||||
for_each_free_mem_range_reverse(i, NUMA_NO_NODE, 0,
|
for_each_free_mem_range_reverse(i, NUMA_NO_NODE, MEMBLOCK_NONE,
|
||||||
&mstart, &mend, NULL) {
|
&mstart, &mend, NULL) {
|
||||||
/*
|
/*
|
||||||
* In memblock, end points to the first byte after the
|
* In memblock, end points to the first byte after the
|
||||||
|
@ -530,8 +533,8 @@ static int kexec_walk_memblock(struct kexec_buf *kbuf,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for_each_free_mem_range(i, NUMA_NO_NODE, 0, &mstart, &mend,
|
for_each_free_mem_range(i, NUMA_NO_NODE, MEMBLOCK_NONE,
|
||||||
NULL) {
|
&mstart, &mend, NULL) {
|
||||||
/*
|
/*
|
||||||
* In memblock, end points to the first byte after the
|
* In memblock, end points to the first byte after the
|
||||||
* range while in kexec, end points to the last byte
|
* range while in kexec, end points to the last byte
|
||||||
|
|
Loading…
Add table
Reference in a new issue