All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/x86/kvm: Fix inverted pebs_no_isolation check
@ 2021-03-10 15:23 Andi Kleen
  2021-03-10 15:35 ` Jim Mattson
  0 siblings, 1 reply; 2+ messages in thread
From: Andi Kleen @ 2021-03-10 15:23 UTC (permalink / raw)
  To: peterz; +Cc: linux-kernel, Andi Kleen, jmattson

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.

Cc: jmattson@google.com
Fixes: 9b545c04abd4 ("perf/x86/kvm: Avoid unnecessary work ...")
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/events/intel/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 5bac48d5c18e..d74deadd3a6d 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -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)
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] perf/x86/kvm: Fix inverted pebs_no_isolation check
  2021-03-10 15:23 [PATCH] perf/x86/kvm: Fix inverted pebs_no_isolation check Andi Kleen
@ 2021-03-10 15:35 ` Jim Mattson
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Mattson @ 2021-03-10 15:35 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Peter Zijlstra, LKML

On Wed, Mar 10, 2021 at 7:24 AM Andi Kleen <ak@linux.intel.com> wrote:
>
> 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 !.
The original code was correct because of the double negative. A "good"
CPU _has_ PEBS isolation. It's bad to have pebs_no_isolation.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-10 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 15:23 [PATCH] perf/x86/kvm: Fix inverted pebs_no_isolation check Andi Kleen
2021-03-10 15:35 ` Jim Mattson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.