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>
This commit is contained in:
parent
e0e5ea3268
commit
6143876651
|
@ -1074,12 +1074,13 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align)
|
||||||
u64 addr;
|
u64 addr;
|
||||||
u64 start;
|
u64 start;
|
||||||
|
|
||||||
start = startt;
|
for (start = startt; ; start += size) {
|
||||||
while (size < sizet && (start + 1))
|
|
||||||
start = find_e820_area_size(start, &size, align);
|
start = find_e820_area_size(start, &size, align);
|
||||||
|
if (!(start + 1))
|
||||||
if (size < sizet)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
if (size >= sizet)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
if (start >= MAXMEM)
|
if (start >= MAXMEM)
|
||||||
|
|
Loading…
Reference in New Issue