diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index a159ae07d66f86546887091757f9cb1c413cfb12..184ad34b9c582b1b4dce703201fa66149d7c3799 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -409,6 +409,9 @@ void __init efi_find_mirror(void) efi_memory_desc_t *md; u64 mirror_size = 0, total_size = 0; + if (!mirrored_kernelcore) + return; + for_each_efi_memory_desc(md) { unsigned long long start = md->phys_addr; unsigned long long size = md->num_pages << EFI_PAGE_SHIFT; diff --git a/include/linux/mm.h b/include/linux/mm.h index b318e9c6cc43dde5bb7fd63eeec248066582c3e2..460b8d4cae8772e5bdfe8336e66cccc132dbbf68 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2270,6 +2270,8 @@ extern void free_bootmem_with_active_regions(int nid, unsigned long max_low_pfn); extern void sparse_memory_present_with_active_regions(int nid); +extern bool mirrored_kernelcore; + #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ #if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 200e19fe216ae662e4b707143cfb7aa25a4c710b..14b4debd998e90d77596c34b0a710e83088a79c3 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -319,7 +319,7 @@ static unsigned long required_kernelcore_percent __initdata; static unsigned long required_movablecore __initdata; static unsigned long required_movablecore_percent __initdata; static unsigned long zone_movable_pfn[MAX_NUMNODES] __meminitdata; -static bool mirrored_kernelcore __meminitdata; +bool mirrored_kernelcore __meminitdata; /* movable_zone is the "real" zone pages in ZONE_MOVABLE are taken from */ int movable_zone;