aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/mtrr
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-10-03 02:26:59 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-03 03:50:04 -0400
commit8bb39311bf461243f6cade3644764d848516dd23 (patch)
treed0518eb77136e254a8e0352045a988d9ea3dff52 /arch/x86/kernel/cpu/mtrr
parent834836ee6a3a9deadff9394b23db965a08bcde35 (diff)
x86, debug: mtrr_cleanup print out var mtrr before change it
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/mtrr')
-rw-r--r--arch/x86/kernel/cpu/mtrr/main.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index b4a3f0c1a5e3..406074c46f1e 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -1211,13 +1211,14 @@ static unsigned long __initdata min_loss_pfn[RANGE_NUM];
1211static int __init mtrr_cleanup(unsigned address_bits) 1211static int __init mtrr_cleanup(unsigned address_bits)
1212{ 1212{
1213 unsigned long extra_remove_base, extra_remove_size; 1213 unsigned long extra_remove_base, extra_remove_size;
1214 unsigned long i, base, size, def, dummy; 1214 unsigned long base, size, def, dummy;
1215 mtrr_type type; 1215 mtrr_type type;
1216 int nr_range, nr_range_new; 1216 int nr_range, nr_range_new;
1217 u64 chunk_size, gran_size; 1217 u64 chunk_size, gran_size;
1218 unsigned long range_sums, range_sums_new; 1218 unsigned long range_sums, range_sums_new;
1219 int index_good; 1219 int index_good;
1220 int num_reg_good; 1220 int num_reg_good;
1221 int i;
1221 1222
1222 /* extra one for all 0 */ 1223 /* extra one for all 0 */
1223 int num[MTRR_NUM_TYPES + 1]; 1224 int num[MTRR_NUM_TYPES + 1];
@@ -1259,6 +1260,28 @@ static int __init mtrr_cleanup(unsigned address_bits)
1259 num_var_ranges - num[MTRR_NUM_TYPES]) 1260 num_var_ranges - num[MTRR_NUM_TYPES])
1260 return 0; 1261 return 0;
1261 1262
1263 /* print original var MTRRs at first, for debugging: */
1264 printk(KERN_DEBUG "original variable MTRRs\n");
1265 for (i = 0; i < num_var_ranges; i++) {
1266 char start_factor = 'K', size_factor = 'K';
1267 unsigned long start_base, size_base;
1268
1269 size_base = range_state[i].size_pfn << (PAGE_SHIFT - 10);
1270 if (!size_base)
1271 continue;
1272
1273 size_base = to_size_factor(size_base, &size_factor),
1274 start_base = range_state[i].base_pfn << (PAGE_SHIFT - 10);
1275 start_base = to_size_factor(start_base, &start_factor),
1276
1277 printk(KERN_DEBUG "reg %d, base: %ld%cB, range: %ld%cB, type %s\n",
1278 i, start_base, start_factor,
1279 size_base, size_factor,
1280 (type == MTRR_TYPE_UNCACHABLE) ? "UC" :
1281 ((type == MTRR_TYPE_WRBACK) ? "WB" : "Other")
1282 );
1283 }
1284
1262 memset(range, 0, sizeof(range)); 1285 memset(range, 0, sizeof(range));
1263 extra_remove_size = 0; 1286 extra_remove_size = 0;
1264 if (mtrr_tom2) { 1287 if (mtrr_tom2) {