aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2009-03-13 17:08:49 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-14 07:27:06 -0400
commitd4c90e37a21154c1910b2646e9544bdd32d5bc3a (patch)
tree82b496e20ca9548c9ed6670a24c44637489ddcc0 /arch/x86
parent63516ef6d6a8379ee5c32463efc6a75f9da8a309 (diff)
x86: print the continous part of fixed mtrrs together
Impact: print out fewer lines 1. print continuous range with same type together 2. change _INFO to _DEBUG Signed-off-by: Yinghai Lu <yinghai@kernel.org> LKML-Reference: <49BACB61.8000302@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c58
1 files changed, 48 insertions, 10 deletions
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 641ee3507d06..37f28fc7cf95 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -208,13 +208,47 @@ void mtrr_save_fixed_ranges(void *info)
208 get_fixed_ranges(mtrr_state.fixed_ranges); 208 get_fixed_ranges(mtrr_state.fixed_ranges);
209} 209}
210 210
211static void print_fixed(unsigned base, unsigned step, const mtrr_type*types) 211static unsigned __initdata last_fixed_start;
212static unsigned __initdata last_fixed_end;
213static mtrr_type __initdata last_fixed_type;
214
215static void __init print_fixed_last(void)
216{
217 if (!last_fixed_end)
218 return;
219
220 printk(KERN_DEBUG " %05X-%05X %s\n", last_fixed_start,
221 last_fixed_end - 1, mtrr_attrib_to_str(last_fixed_type));
222
223 last_fixed_end = 0;
224}
225
226static void __init update_fixed_last(unsigned base, unsigned end,
227 mtrr_type type)
228{
229 last_fixed_start = base;
230 last_fixed_end = end;
231 last_fixed_type = type;
232}
233
234static void __init print_fixed(unsigned base, unsigned step,
235 const mtrr_type *types)
212{ 236{
213 unsigned i; 237 unsigned i;
214 238
215 for (i = 0; i < 8; ++i, ++types, base += step) 239 for (i = 0; i < 8; ++i, ++types, base += step) {
216 printk(KERN_INFO " %05X-%05X %s\n", 240 if (last_fixed_end == 0) {
217 base, base + step - 1, mtrr_attrib_to_str(*types)); 241 update_fixed_last(base, base + step, *types);
242 continue;
243 }
244 if (last_fixed_end == base && last_fixed_type == *types) {
245 last_fixed_end = base + step;
246 continue;
247 }
248 /* new segments: gap or different type */
249 print_fixed_last();
250 update_fixed_last(base, base + step, *types);
251 }
218} 252}
219 253
220static void prepare_set(void); 254static void prepare_set(void);
@@ -225,22 +259,26 @@ static void __init print_mtrr_state(void)
225 unsigned int i; 259 unsigned int i;
226 int high_width; 260 int high_width;
227 261
228 printk(KERN_INFO "MTRR default type: %s\n", mtrr_attrib_to_str(mtrr_state.def_type)); 262 printk(KERN_DEBUG "MTRR default type: %s\n",
263 mtrr_attrib_to_str(mtrr_state.def_type));
229 if (mtrr_state.have_fixed) { 264 if (mtrr_state.have_fixed) {
230 printk(KERN_INFO "MTRR fixed ranges %sabled:\n", 265 printk(KERN_DEBUG "MTRR fixed ranges %sabled:\n",
231 mtrr_state.enabled & 1 ? "en" : "dis"); 266 mtrr_state.enabled & 1 ? "en" : "dis");
232 print_fixed(0x00000, 0x10000, mtrr_state.fixed_ranges + 0); 267 print_fixed(0x00000, 0x10000, mtrr_state.fixed_ranges + 0);
233 for (i = 0; i < 2; ++i) 268 for (i = 0; i < 2; ++i)
234 print_fixed(0x80000 + i * 0x20000, 0x04000, mtrr_state.fixed_ranges + (i + 1) * 8); 269 print_fixed(0x80000 + i * 0x20000, 0x04000, mtrr_state.fixed_ranges + (i + 1) * 8);
235 for (i = 0; i < 8; ++i) 270 for (i = 0; i < 8; ++i)
236 print_fixed(0xC0000 + i * 0x08000, 0x01000, mtrr_state.fixed_ranges + (i + 3) * 8); 271 print_fixed(0xC0000 + i * 0x08000, 0x01000, mtrr_state.fixed_ranges + (i + 3) * 8);
272
273 /* tail */
274 print_fixed_last();
237 } 275 }
238 printk(KERN_INFO "MTRR variable ranges %sabled:\n", 276 printk(KERN_DEBUG "MTRR variable ranges %sabled:\n",
239 mtrr_state.enabled & 2 ? "en" : "dis"); 277 mtrr_state.enabled & 2 ? "en" : "dis");
240 high_width = ((size_or_mask ? ffs(size_or_mask) - 1 : 32) - (32 - PAGE_SHIFT) + 3) / 4; 278 high_width = ((size_or_mask ? ffs(size_or_mask) - 1 : 32) - (32 - PAGE_SHIFT) + 3) / 4;
241 for (i = 0; i < num_var_ranges; ++i) { 279 for (i = 0; i < num_var_ranges; ++i) {
242 if (mtrr_state.var_ranges[i].mask_lo & (1 << 11)) 280 if (mtrr_state.var_ranges[i].mask_lo & (1 << 11))
243 printk(KERN_INFO " %u base %0*X%05X000 mask %0*X%05X000 %s\n", 281 printk(KERN_DEBUG " %u base %0*X%05X000 mask %0*X%05X000 %s\n",
244 i, 282 i,
245 high_width, 283 high_width,
246 mtrr_state.var_ranges[i].base_hi, 284 mtrr_state.var_ranges[i].base_hi,
@@ -250,10 +288,10 @@ static void __init print_mtrr_state(void)
250 mtrr_state.var_ranges[i].mask_lo >> 12, 288 mtrr_state.var_ranges[i].mask_lo >> 12,
251 mtrr_attrib_to_str(mtrr_state.var_ranges[i].base_lo & 0xff)); 289 mtrr_attrib_to_str(mtrr_state.var_ranges[i].base_lo & 0xff));
252 else 290 else
253 printk(KERN_INFO " %u disabled\n", i); 291 printk(KERN_DEBUG " %u disabled\n", i);
254 } 292 }
255 if (mtrr_tom2) { 293 if (mtrr_tom2) {
256 printk(KERN_INFO "TOM2: %016llx aka %lldM\n", 294 printk(KERN_DEBUG "TOM2: %016llx aka %lldM\n",
257 mtrr_tom2, mtrr_tom2>>20); 295 mtrr_tom2, mtrr_tom2>>20);
258 } 296 }
259} 297}