Skip to content

Commit

Permalink
x86: fix boot hang in early_reserve_e820()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Beulich authored and H. Peter Anvin committed May 8, 2009
1 parent e0e5ea3 commit 6143876
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions arch/x86/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,12 +1074,13 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align)
u64 addr;
u64 start;

start = startt;
while (size < sizet && (start + 1))
for (start = startt; ; start += size) {
start = find_e820_area_size(start, &size, align);

if (size < sizet)
return 0;
if (!(start + 1))
return 0;
if (size >= sizet)
break;
}

#ifdef CONFIG_X86_32
if (start >= MAXMEM)
Expand Down

0 comments on commit 6143876

Please sign in to comment.