summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/e820_64.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel.send@gmail.com>2008-04-29 01:59:49 -0700
committerThomas Gleixner <tglx@linutronix.de>2008-05-25 10:55:09 +0200
commit42651f15824d003e8357693ab72c4dbb3e280836 (patch)
tree1114071a407bfeb38edc12b7c822039641cd5c13 /arch/x86/kernel/e820_64.c
parent95ffa2438d0e9c48779f0106b1c0eb36165e759c (diff)
x86: fix trimming e820 with MTRR holes.
converting MTRR layout from continous to discrete, some time could run out of MTRRs. So add gran_sizek to prevent that by dumpping small RAM piece less than gran_sizek. previous trimming only can handle highest_pfn from mtrr to end_pfn from e820. when have more than 4g RAM installed, there will be holes below 4g. so need to check ram below 4g is coverred well. need to be applied after [PATCH] x86: mtrr cleanup for converting continuous to discrete layout v7 Signed-off-by: Yinghai Lu <yinghai.lu@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/e820_64.c')
-rw-r--r--arch/x86/kernel/e820_64.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c
index 124480c0008d..848b2cd2d1dd 100644
--- a/arch/x86/kernel/e820_64.c
+++ b/arch/x86/kernel/e820_64.c
@@ -829,10 +829,11 @@ void __init finish_e820_parsing(void)
}
}
-void __init update_memory_range(u64 start, u64 size, unsigned old_type,
+u64 __init update_memory_range(u64 start, u64 size, unsigned old_type,
unsigned new_type)
{
int i;
+ u64 real_updated_size = 0;
BUG_ON(old_type == new_type);
@@ -844,6 +845,7 @@ void __init update_memory_range(u64 start, u64 size, unsigned old_type,
/* totally covered? */
if (ei->addr >= start && ei->size <= size) {
ei->type = new_type;
+ real_updated_size += ei->size;
continue;
}
/* partially covered */
@@ -853,7 +855,9 @@ void __init update_memory_range(u64 start, u64 size, unsigned old_type,
continue;
add_memory_region(final_start, final_end - final_start,
new_type);
+ real_updated_size += final_end - final_start;
}
+ return real_updated_size;
}
void __init update_e820(void)