diff options
author | Chen Zhou <chenzhou10@huawei.com> | 2022-05-06 13:43:59 +0200 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2022-05-07 20:54:33 +0200 |
commit | 944a45abfabc171fd121315ff0d5e62b11cb5d6f (patch) | |
tree | bceddfe1948986284e9ff090b6e695cf2e07ef4d /arch/arm64/kernel/machine_kexec.c | |
parent | arm64: Use insert_resource() to simplify code (diff) | |
download | linux-944a45abfabc171fd121315ff0d5e62b11cb5d6f.tar.xz linux-944a45abfabc171fd121315ff0d5e62b11cb5d6f.zip |
arm64: kdump: Reimplement crashkernel=X
There are following issues in arm64 kdump:
1. We use crashkernel=X to reserve crashkernel in DMA zone, which
will fail when there is not enough low memory.
2. If reserving crashkernel above DMA zone, in this case, crash dump
kernel will fail to boot because there is no low memory available
for allocation.
To solve these issues, introduce crashkernel=X,[high,low].
The "crashkernel=X,high" is used to select a region above DMA zone, and
the "crashkernel=Y,low" is used to allocate specified size low memory.
Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
Co-developed-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20220506114402.365-4-thunder.leizhen@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/machine_kexec.c')
-rw-r--r-- | arch/arm64/kernel/machine_kexec.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index e16b248699d5..19c2d487cb08 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -329,8 +329,13 @@ bool crash_is_nosave(unsigned long pfn) /* in reserved memory? */ addr = __pfn_to_phys(pfn); - if ((addr < crashk_res.start) || (crashk_res.end < addr)) - return false; + if ((addr < crashk_res.start) || (crashk_res.end < addr)) { + if (!crashk_low_res.end) + return false; + + if ((addr < crashk_low_res.start) || (crashk_low_res.end < addr)) + return false; + } if (!kexec_crash_image) return true; |