x86/kdump fixes for 3.9
Subsystems (5)
Hi Linus,
I am sending this particular patchset under its own cover because I consider it to be a judgement call.
The kexec/kdump people have found several problems with the support for loading over 4 GiB that was introduced in this merge cycle. This is partly due to a number of design problems inherent in the way the various pieces of kdump fit together (it is pretty horrifically manual in many places.)
After a *lot* of iterations this is the patchset that was agreed upon, but of course it is now very late in the cycle. However, because it changes both the syntax and semantics of the crashkernel option, it would be desirable to avoid a stable release with the broken interfaces.
-hpa
The following changes since commit 41ef2d5678d83af030125550329b6ae8b74618fa:
Linux 3.9-rc7 (2013-04-14 17:45:16 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-kdump-for-linus
for you to fetch changes up to 157752d84f5df47e01577970f9c5f61a0b9f4546:
kexec: use Crash kernel for Crash kernel low (2013-04-17 12:35:34 -0700)
----------------------------------------------------------------
Yinghai Lu (4):
x86, kdump: Set crashkernel_low automatically
x86, kdump: Retore crashkernel= to allocate under 896M x86, kdump: Change crashkernel_high/low= to crashkernel=,high/low
kexec: use Crash kernel for Crash kernel low
Documentation/kernel-parameters.txt | 23 ++++++- arch/x86/kernel/setup.c | 45 +++++++++++--- include/linux/kexec.h | 2 + include/linux/swiotlb.h | 1 + kernel/kexec.c | 118 ++++++++++++++++++++++++++++++++---- lib/swiotlb.c | 19 ++++-- 6 files changed, 180 insertions(+), 28 deletions(-)
Documentation/kernel-parameters.txt +20 -3
@@ -596,9 +596,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. is selected automatically. Check Documentation/kdump/kdump.txt for further details. - crashkernel_low=size[KMG] - [KNL, x86] parts under 4G. - crashkernel=range1:size1[,range2:size2,...][@offset] [KNL] Same as above, but depends on the memory in the running system. The syntax of range is
@@ -606,6 +603,26 @@ bytes respectively. Such letter suffixes can also be entirely omitted. a memory unit (amount[KMG]). See also Documentation/kdump/kdump.txt for an example. + crashkernel=size[KMG],high + [KNL, x86_64] range could be above 4G. Allow kernel + to allocate physical memory region from top, so could + be above 4G if system have more than 4G ram installed. + Otherwise memory region will be allocated below 4G, if + available. + It will be ignored if crashkernel=X is specified. + crashkernel=size[KMG],low + [KNL, x86_64] range under 4G. When crashkernel=X,high + is passed, kernel could allocate physical memory region + above 4G, that cause second kernel crash on system + that require some amount of low memory, e.g. swiotlb + requires at least 64M+32K low memory. Kernel would + try to allocate 72M below 4G automatically. + This one let user to specify own low range under 4G + for second kernel instead. + 0: to disable low allocation. + It will be ignored when crashkernel=X,high is not used + or memory reserved is below 4G. + cs89x0_dma= [HW,NET] Format: <dma>
arch/x86/kernel/setup.c +37 -8
88 lines not on this page · raw message
include/linux/kexec.h +2 -0
@@ -200,6 +200,8 @@ extern size_t vmcoreinfo_max_size;int __init parse_crashkernel (char *cmdline,unsigned long long system_ram,unsigned long long *crash_size,unsigned long long *crash_base); +int parse_crashkernel_high (char *cmdline,unsigned long long system_ram, +unsigned long long *crash_size,unsigned long long *crash_base);int parse_crashkernel_low (char *cmdline,unsigned long long system_ram,unsigned long long *crash_size,unsigned long long *crash_base);int crash_shrink_memory (unsigned long new_size);
include/linux/swiotlb.h +1 -0
@@ -25,6 +25,7 @@ extern int swiotlb_force;extern void swiotlb_init (int verbose);int swiotlb_init_with_tbl (char *tlb,unsigned long nslabs,int verbose);extern unsigned long swiotlb_nr_tbl (void ); +unsigned long swiotlb_size_or_default (void );extern int swiotlb_late_init_with_tbl (char *tlb,unsigned long nslabs);/*
kernel/kexec.c +105 -13
167 lines not on this page · raw message
lib/swiotlb.c +15 -4
@@ -105,9 +105,9 @@ setup_io_tlb_npages(char *str)if (!strcmp (str,"force" )) swiotlb_force =1 ; -return 1 ; +return 0 ; } -__setup ("swiotlb=" , setup_io_tlb_npages); +early_param ("swiotlb" , setup_io_tlb_npages);/* make io_tlb_overflow tunable too? */ unsigned long swiotlb_nr_tbl (void )
@@ -115,6 +115,18 @@ unsigned long swiotlb_nr_tbl(void)return io_tlb_nslabs; }EXPORT_SYMBOL_GPL (swiotlb_nr_tbl); + +/* default to 64MB */ +#define IO_TLB_DEFAULT_SIZE (64UL<<20) +unsigned long swiotlb_size_or_default (void ) +{ +unsigned long size; + + size = io_tlb_nslabs <<IO_TLB_SHIFT ; + +return size ? size : (IO_TLB_DEFAULT_SIZE ); +} +/* Note that this doesn't work with highmem page */ static dma_addr_t swiotlb_virt_to_bus (struct device *hwdev,volatile void *address)
@@ -188,8 +200,7 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)void __init swiotlb_init (int verbose) { -/* default to 64MB */ -size_t default_size =64UL <<20 ; +size_t default_size =IO_TLB_DEFAULT_SIZE ;unsigned char *vstart;unsigned long bytes;