Skip to content

KVM: x86/pmu: Globally enable GP counters at "RESET"

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Applied to kvm-x86 fixes, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: x86/pmu: Set enable bits for GP counters in PERF_GLOBAL_CTRL at "RESET"arch/x86/kvm/pmu.c+14 -21 reply
2/2KVM: selftests: Verify post-RESET value of PERF_GLOBAL_CTRL in PMCs testtools/testing/selftests/kvm/x86_64/pmu_counters_test.c+19 -10 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDapeng MiBabu Moger
SeriesR-b T-b
1/2T-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: x86/pmu: Globally enable GP counters at "RESET"

Globally enable GP counters in PERF_GLOBAL_CTRL when refreshing a vCPU's PMU to emulate the architecturally defined post-RESET behavior of the MSR.

Extend pmu_counters_test.c to verify the behavior.

Note, this is slightly different than what I "posted" before: it keeps PERF_GLOBAL_CTRL '0' if there are no counters. That's technically not what the SDM dictates, but I went with the common sense route of interpreting the SDM to mean "globally enable all GP counters".

I figured it was much more likely that the SDM writers didn't think about virtual CPUs that can have a PMU without any GP counters, versus Intel really wanting to set _all_ bits in PERF_GLOBAL_CTRL :-)

Sean Christopherson (2):
KVM: x86/pmu: Set enable bits for GP counters in PERF_GLOBAL_CTRL at

    "RESET"

KVM: selftests: Verify post-RESET value of PERF_GLOBAL_CTRL in PMCs
test

 arch/x86/kvm/pmu.c                            | 16 +++++++++++++--
 .../selftests/kvm/x86_64/pmu_counters_test.c  | 20 ++++++++++++++++++-
 2 files changed, 33 insertions(+), 3 deletions(-)

base-commit: 964d0c614c7f71917305a5afdca9178fe8231434

Signature · 1 line
2.44.0.278.ge034bb2e1d-goog