Merge branch 'x86-kdump-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 kdump update from Ingo Molnar: "This includes two changes: - Raise the crash kernel reservation limit from from ~896MB to ~4GB. Only very old (and already known-broken) kexec-tools is supposed to be affected by this negatively. - Allow higher than 4GB crash kernel allocations when low allocations fail" * 'x86-kdump-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/kdump: Fall back to reserve high crashkernel memory x86/kdump: Have crashkernel=X reserve under 4G by defaulthifive-unleashed-5.2
commit
e913c4a4c2
|
@ -704,8 +704,11 @@
|
||||||
upon panic. This parameter reserves the physical
|
upon panic. This parameter reserves the physical
|
||||||
memory region [offset, offset + size] for that kernel
|
memory region [offset, offset + size] for that kernel
|
||||||
image. If '@offset' is omitted, then a suitable offset
|
image. If '@offset' is omitted, then a suitable offset
|
||||||
is selected automatically. Check
|
is selected automatically.
|
||||||
Documentation/kdump/kdump.txt for further details.
|
[KNL, x86_64] select a region under 4G first, and
|
||||||
|
fall back to reserve region above 4G when '@offset'
|
||||||
|
hasn't been specified.
|
||||||
|
See Documentation/kdump/kdump.txt for further details.
|
||||||
|
|
||||||
crashkernel=range1:size1[,range2:size2,...][@offset]
|
crashkernel=range1:size1[,range2:size2,...][@offset]
|
||||||
[KNL] Same as above, but depends on the memory
|
[KNL] Same as above, but depends on the memory
|
||||||
|
|
|
@ -71,6 +71,7 @@
|
||||||
#include <linux/tboot.h>
|
#include <linux/tboot.h>
|
||||||
#include <linux/jiffies.h>
|
#include <linux/jiffies.h>
|
||||||
#include <linux/mem_encrypt.h>
|
#include <linux/mem_encrypt.h>
|
||||||
|
#include <linux/sizes.h>
|
||||||
|
|
||||||
#include <linux/usb/xhci-dbgp.h>
|
#include <linux/usb/xhci-dbgp.h>
|
||||||
#include <video/edid.h>
|
#include <video/edid.h>
|
||||||
|
@ -448,18 +449,17 @@ static void __init memblock_x86_reserve_range_setup_data(void)
|
||||||
#ifdef CONFIG_KEXEC_CORE
|
#ifdef CONFIG_KEXEC_CORE
|
||||||
|
|
||||||
/* 16M alignment for crash kernel regions */
|
/* 16M alignment for crash kernel regions */
|
||||||
#define CRASH_ALIGN (16 << 20)
|
#define CRASH_ALIGN SZ_16M
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Keep the crash kernel below this limit. On 32 bits earlier kernels
|
* Keep the crash kernel below this limit. On 32 bits earlier kernels
|
||||||
* would limit the kernel to the low 512 MiB due to mapping restrictions.
|
* would limit the kernel to the low 512 MiB due to mapping restrictions.
|
||||||
* On 64bit, old kexec-tools need to under 896MiB.
|
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
# define CRASH_ADDR_LOW_MAX (512 << 20)
|
# define CRASH_ADDR_LOW_MAX SZ_512M
|
||||||
# define CRASH_ADDR_HIGH_MAX (512 << 20)
|
# define CRASH_ADDR_HIGH_MAX SZ_512M
|
||||||
#else
|
#else
|
||||||
# define CRASH_ADDR_LOW_MAX (896UL << 20)
|
# define CRASH_ADDR_LOW_MAX SZ_4G
|
||||||
# define CRASH_ADDR_HIGH_MAX MAXMEM
|
# define CRASH_ADDR_HIGH_MAX MAXMEM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -541,21 +541,27 @@ static void __init reserve_crashkernel(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 0 means: find the address automatically */
|
/* 0 means: find the address automatically */
|
||||||
if (crash_base <= 0) {
|
if (!crash_base) {
|
||||||
/*
|
/*
|
||||||
* Set CRASH_ADDR_LOW_MAX upper bound for crash memory,
|
* Set CRASH_ADDR_LOW_MAX upper bound for crash memory,
|
||||||
* as old kexec-tools loads bzImage below that, unless
|
* crashkernel=x,high reserves memory over 4G, also allocates
|
||||||
* "crashkernel=size[KMG],high" is specified.
|
* 256M extra low memory for DMA buffers and swiotlb.
|
||||||
|
* But the extra memory is not required for all machines.
|
||||||
|
* So try low memory first and fall back to high memory
|
||||||
|
* unless "crashkernel=size[KMG],high" is specified.
|
||||||
*/
|
*/
|
||||||
crash_base = memblock_find_in_range(CRASH_ALIGN,
|
if (!high)
|
||||||
high ? CRASH_ADDR_HIGH_MAX
|
crash_base = memblock_find_in_range(CRASH_ALIGN,
|
||||||
: CRASH_ADDR_LOW_MAX,
|
CRASH_ADDR_LOW_MAX,
|
||||||
crash_size, CRASH_ALIGN);
|
crash_size, CRASH_ALIGN);
|
||||||
|
if (!crash_base)
|
||||||
|
crash_base = memblock_find_in_range(CRASH_ALIGN,
|
||||||
|
CRASH_ADDR_HIGH_MAX,
|
||||||
|
crash_size, CRASH_ALIGN);
|
||||||
if (!crash_base) {
|
if (!crash_base) {
|
||||||
pr_info("crashkernel reservation failed - No suitable area found.\n");
|
pr_info("crashkernel reservation failed - No suitable area found.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
unsigned long long start;
|
unsigned long long start;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue