Commit 21c3fcf3 authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar

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 2eaad1fd
| 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: default avatarYinghai Lu <yinghai@kernel.org>
Cc: Mike Travis <travis@sgi.com>
Link: http://lkml.kernel.org/r/1329069237-11483-1-git-send-email-yinghai@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 8df54d62
...@@ -162,6 +162,7 @@ extern void early_cpu_init(void); ...@@ -162,6 +162,7 @@ extern void early_cpu_init(void);
extern void identify_boot_cpu(void); extern void identify_boot_cpu(void);
extern void identify_secondary_cpu(struct cpuinfo_x86 *); extern void identify_secondary_cpu(struct cpuinfo_x86 *);
extern void print_cpu_info(struct cpuinfo_x86 *); extern void print_cpu_info(struct cpuinfo_x86 *);
void print_cpu_msr(struct cpuinfo_x86 *);
extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
extern unsigned short num_cache_leaves; extern unsigned short num_cache_leaves;
......
...@@ -933,7 +933,7 @@ static const struct msr_range msr_range_array[] __cpuinitconst = { ...@@ -933,7 +933,7 @@ static const struct msr_range msr_range_array[] __cpuinitconst = {
{ 0xc0011000, 0xc001103b}, { 0xc0011000, 0xc001103b},
}; };
static void __cpuinit print_cpu_msr(void) static void __cpuinit __print_cpu_msr(void)
{ {
unsigned index_min, index_max; unsigned index_min, index_max;
unsigned index; unsigned index;
...@@ -997,13 +997,13 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) ...@@ -997,13 +997,13 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
else else
printk(KERN_CONT "\n"); printk(KERN_CONT "\n");
#ifdef CONFIG_SMP __print_cpu_msr();
}
void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c)
{
if (c->cpu_index < show_msr) if (c->cpu_index < show_msr)
print_cpu_msr(); __print_cpu_msr();
#else
if (show_msr)
print_cpu_msr();
#endif
} }
static __init int setup_disablecpuid(char *arg) static __init int setup_disablecpuid(char *arg)
......
...@@ -791,9 +791,10 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu) ...@@ -791,9 +791,10 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
schedule(); schedule();
} }
if (cpumask_test_cpu(cpu, cpu_callin_mask)) if (cpumask_test_cpu(cpu, cpu_callin_mask)) {
print_cpu_msr(&cpu_data(cpu));
pr_debug("CPU%d: has booted.\n", cpu); pr_debug("CPU%d: has booted.\n", cpu);
else { } else {
boot_error = 1; boot_error = 1;
if (*(volatile u32 *)TRAMPOLINE_SYM(trampoline_status) if (*(volatile u32 *)TRAMPOLINE_SYM(trampoline_status)
== 0xA5A5A5A5) == 0xA5A5A5A5)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment