Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kdump: Allow shrinking of kdump region to be overridden

On ppc64 the crashkernel region almost always overlaps an area of firmware.
This works fine except when using the sysfs interface to reduce the kdump
region. If we free the firmware area we are guaranteed to crash.

Rename free_reserved_phys_range to crash_free_reserved_phys_range and make
it a weak function so we can override it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Anton Blanchard and committed by
Benjamin Herrenschmidt
c0bb9e45 76d479a7

+4 -2
+1
include/linux/kexec.h
··· 208 208 unsigned long long *crash_size, unsigned long long *crash_base); 209 209 int crash_shrink_memory(unsigned long new_size); 210 210 size_t crash_get_memory_size(void); 211 + void crash_free_reserved_phys_range(unsigned long begin, unsigned long end); 211 212 212 213 #else /* !CONFIG_KEXEC */ 213 214 struct pt_regs;
+3 -2
kernel/kexec.c
··· 1099 1099 return size; 1100 1100 } 1101 1101 1102 - static void free_reserved_phys_range(unsigned long begin, unsigned long end) 1102 + void __weak crash_free_reserved_phys_range(unsigned long begin, 1103 + unsigned long end) 1103 1104 { 1104 1105 unsigned long addr; 1105 1106 ··· 1136 1135 start = roundup(start, PAGE_SIZE); 1137 1136 end = roundup(start + new_size, PAGE_SIZE); 1138 1137 1139 - free_reserved_phys_range(end, crashk_res.end); 1138 + crash_free_reserved_phys_range(end, crashk_res.end); 1140 1139 1141 1140 if ((start == end) && (crashk_res.parent != NULL)) 1142 1141 release_resource(&crashk_res);