Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0bb9e45 authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt
Browse files

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: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 76d479a7
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -208,6 +208,7 @@ int __init parse_crashkernel(char *cmdline, unsigned long long system_ram,
		unsigned long long *crash_size, unsigned long long *crash_base);
		unsigned long long *crash_size, unsigned long long *crash_base);
int crash_shrink_memory(unsigned long new_size);
int crash_shrink_memory(unsigned long new_size);
size_t crash_get_memory_size(void);
size_t crash_get_memory_size(void);
void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);


#else /* !CONFIG_KEXEC */
#else /* !CONFIG_KEXEC */
struct pt_regs;
struct pt_regs;
+3 −2
Original line number Original line Diff line number Diff line
@@ -1099,7 +1099,8 @@ size_t crash_get_memory_size(void)
	return size;
	return size;
}
}


static void free_reserved_phys_range(unsigned long begin, unsigned long end)
void __weak crash_free_reserved_phys_range(unsigned long begin,
					   unsigned long end)
{
{
	unsigned long addr;
	unsigned long addr;


@@ -1135,7 +1136,7 @@ int crash_shrink_memory(unsigned long new_size)
	start = roundup(start, PAGE_SIZE);
	start = roundup(start, PAGE_SIZE);
	end = roundup(start + new_size, PAGE_SIZE);
	end = roundup(start + new_size, PAGE_SIZE);


	free_reserved_phys_range(end, crashk_res.end);
	crash_free_reserved_phys_range(end, crashk_res.end);


	if ((start == end) && (crashk_res.parent != NULL))
	if ((start == end) && (crashk_res.parent != NULL))
		release_resource(&crashk_res);
		release_resource(&crashk_res);