aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-08-22 04:32:50 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-22 04:43:21 -0400
commitb05f78f5c713eda2c34e495d92495ee4f1c3b5e1 (patch)
tree87dd57341abc375131d3268d33c504e3eb609462 /arch/x86/kernel
parentc9c3dddd8f9a05b25d4ce53e8e80cc0ea1759d18 (diff)
x86_64: printout msr -v2
commandline show_msr=1 for bsp, show_msr=32 for all 32 cpus. [ mingo@elte.hu: added documentation ] Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/cpu/common_64.c51
-rw-r--r--arch/x86/kernel/paravirt.c1
2 files changed, 52 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common_64.c b/arch/x86/kernel/cpu/common_64.c
index dd6e3f15017e..bca2d6980e82 100644
--- a/arch/x86/kernel/cpu/common_64.c
+++ b/arch/x86/kernel/cpu/common_64.c
@@ -394,6 +394,49 @@ static __init int setup_noclflush(char *arg)
394} 394}
395__setup("noclflush", setup_noclflush); 395__setup("noclflush", setup_noclflush);
396 396
397struct msr_range {
398 unsigned min;
399 unsigned max;
400};
401
402static struct msr_range msr_range_array[] __cpuinitdata = {
403 { 0x00000000, 0x00000418},
404 { 0xc0000000, 0xc000040b},
405 { 0xc0010000, 0xc0010142},
406 { 0xc0011000, 0xc001103b},
407};
408
409static void __cpuinit print_cpu_msr(void)
410{
411 unsigned index;
412 u64 val;
413 int i;
414 unsigned index_min, index_max;
415
416 for (i = 0; i < ARRAY_SIZE(msr_range_array); i++) {
417 index_min = msr_range_array[i].min;
418 index_max = msr_range_array[i].max;
419 for (index = index_min; index < index_max; index++) {
420 if (rdmsrl_amd_safe(index, &val))
421 continue;
422 printk(KERN_INFO " MSR%08x: %016llx\n", index, val);
423 }
424 }
425}
426
427static int show_msr __cpuinitdata;
428static __init int setup_show_msr(char *arg)
429{
430 int num;
431
432 get_option(&arg, &num);
433
434 if (num > 0)
435 show_msr = num;
436 return 1;
437}
438__setup("show_msr=", setup_show_msr);
439
397void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) 440void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
398{ 441{
399 if (c->x86_model_id[0]) 442 if (c->x86_model_id[0])
@@ -403,6 +446,14 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
403 printk(KERN_CONT " stepping %02x\n", c->x86_mask); 446 printk(KERN_CONT " stepping %02x\n", c->x86_mask);
404 else 447 else
405 printk(KERN_CONT "\n"); 448 printk(KERN_CONT "\n");
449
450#ifdef CONFIG_SMP
451 if (c->cpu_index < show_msr)
452 print_cpu_msr();
453#else
454 if (show_msr)
455 print_cpu_msr();
456#endif
406} 457}
407 458
408static __init int setup_disablecpuid(char *arg) 459static __init int setup_disablecpuid(char *arg)
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 94da4d52d798..c6044682e1e7 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -330,6 +330,7 @@ struct pv_cpu_ops pv_cpu_ops = {
330#endif 330#endif
331 .wbinvd = native_wbinvd, 331 .wbinvd = native_wbinvd,
332 .read_msr = native_read_msr_safe, 332 .read_msr = native_read_msr_safe,
333 .read_msr_amd = native_read_msr_amd_safe,
333 .write_msr = native_write_msr_safe, 334 .write_msr = native_write_msr_safe,
334 .read_tsc = native_read_tsc, 335 .read_tsc = native_read_tsc,
335 .read_pmc = native_read_pmc, 336 .read_pmc = native_read_pmc,