x86: fix boot hang in early_reserve_e820()

If the first non-reserved (sub-)range doesn't fit the size requested,
an endless loop will be entered. If a range returned from
find_e820_area_size() turns out insufficient in size, the range must
be skipped before calling the function again.

[ Impact: fixes boot hang on some platforms ]

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>

authored by Jan Beulich and committed by H. Peter Anvin 61438766 e0e5ea32

+6 -5
+6 -5
arch/x86/kernel/e820.c
··· 1074 u64 addr; 1075 u64 start; 1076 1077 - start = startt; 1078 - while (size < sizet && (start + 1)) 1079 start = find_e820_area_size(start, &size, align); 1080 - 1081 - if (size < sizet) 1082 - return 0; 1083 1084 #ifdef CONFIG_X86_32 1085 if (start >= MAXMEM)
··· 1074 u64 addr; 1075 u64 start; 1076 1077 + for (start = startt; ; start += size) { 1078 start = find_e820_area_size(start, &size, align); 1079 + if (!(start + 1)) 1080 + return 0; 1081 + if (size >= sizet) 1082 + break; 1083 + } 1084 1085 #ifdef CONFIG_X86_32 1086 if (start >= MAXMEM)