aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2012-02-12 12:53:57 -0500
committerIngo Molnar <mingo@elte.hu>2012-02-12 13:12:21 -0500
commit21c3fcf3e39353d4f21d50e257cc74f3204b1988 (patch)
treeefb39e04d8f469cc6e237aa403ce4a3c80bf6e76 /arch/x86
parent8df54d622a120058ee8bec38743c9b8f091c8e58 (diff)
x86/debug: Fix/improve the show_msr=<cpus> debug print out
Found out that show_msr=<cpus> is broken, when I asked a user to use it to capture debug info about broken MTRR's whose MTRR settings are probably different between CPUs. Only the first CPUs MSRs are printed, but that is not enough to track down the suspected bug. For years we called print_cpu_msr from print_cpu_info(), but this commit: | commit 2eaad1fddd7450a48ad464229775f97fbfe8af36 | Author: Mike Travis <travis@sgi.com> | Date: Thu Dec 10 17:19:36 2009 -0800 | | x86: Limit the number of processor bootup messages removed the print_cpu_info() call from all APs. Put it back - it will only print MSRs when the user specifically requests them via show_msr=<cpus>. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Cc: Mike Travis <travis@sgi.com> Link: http://lkml.kernel.org/r/1329069237-11483-1-git-send-email-yinghai@kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/processor.h1
-rw-r--r--arch/x86/kernel/cpu/common.c14
-rw-r--r--arch/x86/kernel/smpboot.c5
3 files changed, 11 insertions, 9 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index aa9088c26931..8bb062bbcbec 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -162,6 +162,7 @@ extern void early_cpu_init(void);
162extern void identify_boot_cpu(void); 162extern void identify_boot_cpu(void);
163extern void identify_secondary_cpu(struct cpuinfo_x86 *); 163extern void identify_secondary_cpu(struct cpuinfo_x86 *);
164extern void print_cpu_info(struct cpuinfo_x86 *); 164extern void print_cpu_info(struct cpuinfo_x86 *);
165void print_cpu_msr(struct cpuinfo_x86 *);
165extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); 166extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
166extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); 167extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
167extern unsigned short num_cache_leaves; 168extern unsigned short num_cache_leaves;
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index d43cad74f166..8b6a3bb57d8e 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -933,7 +933,7 @@ static const struct msr_range msr_range_array[] __cpuinitconst = {
933 { 0xc0011000, 0xc001103b}, 933 { 0xc0011000, 0xc001103b},
934}; 934};
935 935
936static void __cpuinit print_cpu_msr(void) 936static void __cpuinit __print_cpu_msr(void)
937{ 937{
938 unsigned index_min, index_max; 938 unsigned index_min, index_max;
939 unsigned index; 939 unsigned index;
@@ -997,13 +997,13 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
997 else 997 else
998 printk(KERN_CONT "\n"); 998 printk(KERN_CONT "\n");
999 999
1000#ifdef CONFIG_SMP 1000 __print_cpu_msr();
1001}
1002
1003void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c)
1004{
1001 if (c->cpu_index < show_msr) 1005 if (c->cpu_index < show_msr)
1002 print_cpu_msr(); 1006 __print_cpu_msr();
1003#else
1004 if (show_msr)
1005 print_cpu_msr();
1006#endif
1007} 1007}
1008 1008
1009static __init int setup_disablecpuid(char *arg) 1009static __init int setup_disablecpuid(char *arg)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 66d250c00d11..257049d7c657 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -791,9 +791,10 @@ do_rest:
791 schedule(); 791 schedule();
792 } 792 }
793 793
794 if (cpumask_test_cpu(cpu, cpu_callin_mask)) 794 if (cpumask_test_cpu(cpu, cpu_callin_mask)) {
795 print_cpu_msr(&cpu_data(cpu));
795 pr_debug("CPU%d: has booted.\n", cpu); 796 pr_debug("CPU%d: has booted.\n", cpu);
796 else { 797 } else {
797 boot_error = 1; 798 boot_error = 1;
798 if (*(volatile u32 *)TRAMPOLINE_SYM(trampoline_status) 799 if (*(volatile u32 *)TRAMPOLINE_SYM(trampoline_status)
799 == 0xA5A5A5A5) 800 == 0xA5A5A5A5)