diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-09-04 15:09:46 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-04 15:09:46 -0400 |
commit | a0854a46c5eb82588126421a9cbceb973384a644 (patch) | |
tree | 9164ff52bd68d5b7aeb1afbef37caa9766ea9a1f /arch/x86/kernel/cpu/common.c | |
parent | 10a434fcb23a57c385177a0086955fae01003f64 (diff) |
x86: make 32bit support show_msr like 64 bit
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index ee1044ca481d..a79cf5c52b6a 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -616,6 +616,49 @@ void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c) | |||
616 | mtrr_ap_init(); | 616 | mtrr_ap_init(); |
617 | } | 617 | } |
618 | 618 | ||
619 | struct msr_range { | ||
620 | unsigned min; | ||
621 | unsigned max; | ||
622 | }; | ||
623 | |||
624 | static struct msr_range msr_range_array[] __cpuinitdata = { | ||
625 | { 0x00000000, 0x00000418}, | ||
626 | { 0xc0000000, 0xc000040b}, | ||
627 | { 0xc0010000, 0xc0010142}, | ||
628 | { 0xc0011000, 0xc001103b}, | ||
629 | }; | ||
630 | |||
631 | static void __cpuinit print_cpu_msr(void) | ||
632 | { | ||
633 | unsigned index; | ||
634 | u64 val; | ||
635 | int i; | ||
636 | unsigned index_min, index_max; | ||
637 | |||
638 | for (i = 0; i < ARRAY_SIZE(msr_range_array); i++) { | ||
639 | index_min = msr_range_array[i].min; | ||
640 | index_max = msr_range_array[i].max; | ||
641 | for (index = index_min; index < index_max; index++) { | ||
642 | if (rdmsrl_amd_safe(index, &val)) | ||
643 | continue; | ||
644 | printk(KERN_INFO " MSR%08x: %016llx\n", index, val); | ||
645 | } | ||
646 | } | ||
647 | } | ||
648 | |||
649 | static int show_msr __cpuinitdata; | ||
650 | static __init int setup_show_msr(char *arg) | ||
651 | { | ||
652 | int num; | ||
653 | |||
654 | get_option(&arg, &num); | ||
655 | |||
656 | if (num > 0) | ||
657 | show_msr = num; | ||
658 | return 1; | ||
659 | } | ||
660 | __setup("show_msr=", setup_show_msr); | ||
661 | |||
619 | static __init int setup_noclflush(char *arg) | 662 | static __init int setup_noclflush(char *arg) |
620 | { | 663 | { |
621 | setup_clear_cpu_cap(X86_FEATURE_CLFLSH); | 664 | setup_clear_cpu_cap(X86_FEATURE_CLFLSH); |
@@ -644,6 +687,14 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) | |||
644 | printk(KERN_CONT " stepping %02x\n", c->x86_mask); | 687 | printk(KERN_CONT " stepping %02x\n", c->x86_mask); |
645 | else | 688 | else |
646 | printk(KERN_CONT "\n"); | 689 | printk(KERN_CONT "\n"); |
690 | |||
691 | #ifdef CONFIG_SMP | ||
692 | if (c->cpu_index < show_msr) | ||
693 | print_cpu_msr(); | ||
694 | #else | ||
695 | if (show_msr) | ||
696 | print_cpu_msr(); | ||
697 | #endif | ||
647 | } | 698 | } |
648 | 699 | ||
649 | static __init int setup_disablecpuid(char *arg) | 700 | static __init int setup_disablecpuid(char *arg) |