Skip to content

Commit

Permalink
x86: fix e820_update_range size when overlapping
Browse files Browse the repository at this point in the history
before that we relay on sanitize_e820_map to remove the overlap.

but e820_update_range(,,E820_RESERVED, E820_RAM) will not work

this patch fix that

who is going to use this?

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Jul 8, 2008
1 parent 3a58a2a commit 976dd4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ u64 __init e820_update_range(u64 start, u64 size, unsigned old_type,
e820_add_region(final_start, final_end - final_start,
new_type);
real_updated_size += final_end - final_start;

ei->size -= final_end - final_start;
if (ei->addr < final_start)
continue;
ei->addr = final_end;
}
return real_updated_size;
}
Expand Down

0 comments on commit 976dd4d

Please sign in to comment.