]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
perf/x86/kvm: Fix Broadwell Xeon stepping in isolation_ucodes[]
authorJim Mattson <jmattson@google.com>
Thu, 22 Apr 2021 00:18:34 +0000 (17:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Apr 2021 11:19:15 +0000 (13:19 +0200)
[ Upstream commit 4b2f1e59229b9da319d358828cdfa4ddbc140769 ]

The only stepping of Broadwell Xeon parts is stepping 1. Fix the
relevant isolation_ucodes[] entry, which previously enumerated
stepping 2.

Although the original commit was characterized as an optimization, it
is also a workaround for a correctness issue.

If a PMI arrives between kvm's call to perf_guest_get_msrs() and the
subsequent VM-entry, a stale value for the IA32_PEBS_ENABLE MSR may be
restored at the next VM-exit. This is because, unbeknownst to kvm, PMI
throttling may clear bits in the IA32_PEBS_ENABLE MSR. CPUs with "PEBS
isolation" don't suffer from this issue, because perf_guest_get_msrs()
doesn't report the IA32_PEBS_ENABLE value.

Fixes: 9b545c04abd4f ("perf/x86/kvm: Avoid unnecessary work in guest filtering")
Signed-off-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Peter Shier <pshier@google.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Link: https://lkml.kernel.org/r/20210422001834.1748319-1-jmattson@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/events/intel/core.c

index 90760393a9643a7b8d14a957810beb637e82c872..9cb3266e148dcffbfc01579a4223c009fa6f2c6c 100644 (file)
@@ -3999,7 +3999,7 @@ static const struct x86_cpu_desc isolation_ucodes[] = {
        INTEL_CPU_DESC(INTEL_FAM6_BROADWELL_D,           3, 0x07000009),
        INTEL_CPU_DESC(INTEL_FAM6_BROADWELL_D,           4, 0x0f000009),
        INTEL_CPU_DESC(INTEL_FAM6_BROADWELL_D,           5, 0x0e000002),
-       INTEL_CPU_DESC(INTEL_FAM6_BROADWELL_X,           2, 0x0b000014),
+       INTEL_CPU_DESC(INTEL_FAM6_BROADWELL_X,           1, 0x0b000014),
        INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_X,             3, 0x00000021),
        INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_X,             4, 0x00000000),
        INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_X,             5, 0x00000000),