aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2013-04-16 01:23:45 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-04-17 15:35:32 -0400
commitc729de8fcea37a1c444e81857eace12494c804a9 (patch)
tree9400f7626dcbb7038b524ac2ea73315e6a0b6e55 /arch
parent41ef2d5678d83af030125550329b6ae8b74618fa (diff)
x86, kdump: Set crashkernel_low automatically
Chao said that kdump does does work well on his system on 3.8 without extra parameter, even iommu does not work with kdump. And now have to append crashkernel_low=Y in first kernel to make kdump work. We have now modified crashkernel=X to allocate memory beyong 4G (if available) and do not allocate low range for crashkernel if the user does not specify that with crashkernel_low=Y. This causes regression if iommu is not enabled. Without iommu, swiotlb needs to be setup in first 4G and there is no low memory available to second kernel. Set crashkernel_low automatically if the user does not specify that. For system that does support IOMMU with kdump properly, user could specify crashkernel_low=0 to save that 72M low ram. -v3: add swiotlb_size() according to Konrad. -v4: add comments what 8M is for according to hpa. also update more crashkernel_low= in kernel-parameters.txt -v5: update changelog according to Vivek. -v6: Change description about swiotlb referring according to HATAYAMA. Reported-by: WANG Chao <chaowang@redhat.com> Tested-by: WANG Chao <chaowang@redhat.com> Signed-off-by: Yinghai Lu <yinghai@kernel.org> Link: http://lkml.kernel.org/r/1366089828-19692-2-git-send-email-yinghai@kernel.org Acked-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/setup.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 90d8cc930f5e..12349202cae7 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -521,19 +521,34 @@ static void __init reserve_crashkernel_low(void)
521 unsigned long long low_base = 0, low_size = 0; 521 unsigned long long low_base = 0, low_size = 0;
522 unsigned long total_low_mem; 522 unsigned long total_low_mem;
523 unsigned long long base; 523 unsigned long long base;
524 bool auto_set = false;
524 int ret; 525 int ret;
525 526
526 total_low_mem = memblock_mem_size(1UL<<(32-PAGE_SHIFT)); 527 total_low_mem = memblock_mem_size(1UL<<(32-PAGE_SHIFT));
527 ret = parse_crashkernel_low(boot_command_line, total_low_mem, 528 ret = parse_crashkernel_low(boot_command_line, total_low_mem,
528 &low_size, &base); 529 &low_size, &base);
529 if (ret != 0 || low_size <= 0) 530 if (ret != 0) {
530 return; 531 /*
532 * two parts from lib/swiotlb.c:
533 * swiotlb size: user specified with swiotlb= or default.
534 * swiotlb overflow buffer: now is hardcoded to 32k.
535 * We round it to 8M for other buffers that
536 * may need to stay low too.
537 */
538 low_size = swiotlb_size_or_default() + (8UL<<20);
539 auto_set = true;
540 } else {
541 /* passed with crashkernel_low=0 ? */
542 if (!low_size)
543 return;
544 }
531 545
532 low_base = memblock_find_in_range(low_size, (1ULL<<32), 546 low_base = memblock_find_in_range(low_size, (1ULL<<32),
533 low_size, alignment); 547 low_size, alignment);
534 548
535 if (!low_base) { 549 if (!low_base) {
536 pr_info("crashkernel low reservation failed - No suitable area found.\n"); 550 if (!auto_set)
551 pr_info("crashkernel low reservation failed - No suitable area found.\n");
537 552
538 return; 553 return;
539 } 554 }