diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/setup.c | 21 |
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 | } |