Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86: fix init_memory_mapping() to handle small ranges

Impact: fix failed EFI bootup in certain circumstances

Ying Huang found init_memory_mapping() has problem with small ranges
less than 2M when he tried to direct map the EFI runtime code out of
max_low_pfn_mapped.

It turns out we never considered that case and didn't check the range...

Reported-by: Ying Huang <ying.huang@intel.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Brian Maly <bmaly@redhat.com>
LKML-Reference: <49ACDDED.1060508@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Yinghai Lu and committed by
Ingo Molnar
0fc59d3a 2450cf51

+2
+2
arch/x86/mm/init_64.c
··· 714 714 pos = start_pfn << PAGE_SHIFT; 715 715 end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) 716 716 << (PMD_SHIFT - PAGE_SHIFT); 717 + if (end_pfn > (end >> PAGE_SHIFT)) 718 + end_pfn = end >> PAGE_SHIFT; 717 719 if (start_pfn < end_pfn) { 718 720 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); 719 721 pos = end_pfn << PAGE_SHIFT;