perf/x86/kvm: Fix inverted pebs_no_isolation check
Subsystems (2)
PATCH 1/1 perf/x86/kvm: Fix inverted pebs_no_isolation check
The pebs_no_isolation optimization check is inverted. We want to disable PEBS isolation when the microcode is at least the revision in the table, not for older microcode. So remove the extra !.
It meant that the new microcodes did unnecessary work, and the old microcodes could crash the PEBS. Presumably most people already running with newer microcodes, so that functional impact is small. But it should speed up the newer systems by the 2-4% claimed in the original patch.
--- arch/x86/events/intel/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/core.c +1 -1
@@ -4532,7 +4532,7 @@ static const struct x86_cpu_desc isolation_ucodes[] = {static void intel_check_pebs_isolation (void ) { - x86_pmu.pebs_no_isolation = !x86_cpu_has_min_microcode_rev (isolation_ucodes); + x86_pmu.pebs_no_isolation =x86_cpu_has_min_microcode_rev (isolation_ucodes); }static __init void intel_pebs_isolation_quirk (void )
Signature · 1 line
2.25.4
Quoted 4 lines · Andi Kleen
The
pebs_no_isolationoptimization check is inverted. We want to disable PEBS isolation when the microcode is at least the revision in the table, not for older microcode. So remove the extra !.
The original code was correct because of the double negative. A "good" CPU _has_ PEBS isolation. It's bad to have pebs_no_isolation.