Skip to contentSkip to conversation

x86: print microcode revision on PEBs errors

PATCH In review Michael S. Tsirkin 3 participants 3 messages Oct 30, 2013 – Oct 31, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: print microcode revision on PEBs errors

On Sandy bridge CPUs with old microcode, PEBs fails and suggests a microcode update. Print out the required and the actual revision to make it easier to figure out what's wrong.

---
 arch/x86/kernel/cpu/perf_event_intel.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/cpu/perf_event_intel.c +2 -0
index f31a165..81f2789 100644
@@ -2105,6 +2105,8 @@ static int intel_snb_pebs_broken(int cpu)
 		}
 	}
 
+	pr_info("PEBS checking: microcode 0x%x min legal 0x%x\n",
+		cpu_data(cpu).microcode, rev);
 	return (cpu_data(cpu).microcode < rev);
 }
 
Signature · 1 line
MST
#1 lore raw
Quoted 4 lines · Michael S. Tsirkin

On Sandy bridge CPUs with old microcode, PEBs fails and suggests a microcode update. Print out the required and the actual revision to make it easier to figure out what's wrong.

[]

arch/x86/kernel/cpu/perf_event_intel.c

Quoted 1 line
arch/x86/kernel/cpu/perf_event_intel.c +0 -0

[]

arch/x86/kernel/cpu/perf_event_intel.c static int intel_snb_pebs_broken(int cpu) · line 2109

Quoted 6 lines
arch/x86/kernel/cpu/perf_event_intel.c +2 -0
@@ -2105,6 +2105,8 @@ static int intel_snb_pebs_broken(int cpu)
 		}
 	}
 
+	pr_info("PEBS checking: microcode 0x%x min legal 0x%x\n",
+		cpu_data(cpu).microcode, rev);

Maybe only emit this with microcode < rev otherwise it gets emitted once for each online cpu

Quoted 3 lines
arch/x86/kernel/cpu/perf_event_intel.c +0 -0
 	return (cpu_data(cpu).microcode < rev);
 }
 
#2 lore raw
In reply to Michael S. Tsirkin
Quoted 15 lines · Michael S. Tsirkin

On Sandy bridge CPUs with old microcode, PEBs fails and suggests a microcode update. Print out the required and the actual revision to make it easier to figure out what's wrong.

---
 arch/x86/kernel/cpu/perf_event_intel.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/cpu/perf_event_intel.c +0 -0
index f31a165..81f2789 100644

arch/x86/kernel/cpu/perf_event_intel.c static int intel_snb_pebs_broken(int cpu) · line 2109

Quoted 5 lines
arch/x86/kernel/cpu/perf_event_intel.c +2 -0
@@ -2105,6 +2105,8 @@ static int intel_snb_pebs_broken(int cpu)
 		}
 	}
 
+	pr_info("PEBS checking: microcode 0x%x min legal 0x%x\n",
+		cpu_data(cpu).microcode, rev);

That's not a very informative message though.

Something like:

"x86/perf/intel: PEBS turned off due to too old microcode version 0x%x\n" "x86/perf/intel: Minimum required microcode version for PEBS: 0x%x\n"

would work better I think.

Also, only output this once, and only output it if the check _fails_.

arch/x86/kernel/cpu/perf_event_intel.c static int intel_snb_pebs_broken(int cpu) · line 2110

Quoted 1 line
arch/x86/kernel/cpu/perf_event_intel.c +0 -0
 	return (cpu_data(cpu).microcode < rev);

Btw., please also fix the return statement, it doesn't need parentheses.

Thanks,

Ingo