Add amd_pmu_refresh_host_guest_eventsel_hw() to recalculate eventsel_hw for all PMCs based on the current vCPU state. This is needed because Host-Only and Guest-Only counters must be enabled/disabled at: - SVME changes: When EFER.SVME is modified, counter... See more
This series adds support for AMD's Host-Only and Guest-Only performance counter eventsel bits in KVM's mediated PMU passthrough implementation. These bits allow an nSVM-enabled guest to configure performance counters that count only during L1 execution (H... See more
Extract the computation of eventsel_hw from amd_pmu_set_msr() into a separate helper function, amd_pmu_set_eventsel_hw(). No functional change intended. Signed-off-by: Jim Mattson --- arch/x86/kvm/svm/pmu.c | 9 -- 1 file changed, 7 insertions(+), 2 deleti... See more
Add a selftest to verify KVM correctly virtualizes the AMD PMU Host-Only (bit 41) and Guest-Only (bit 40) event selector bits across all relevant SVM state transitions. The test programs 4 PMCs simultaneously with all combinations of the Host-Only and Gue... See more
Update amd_pmu_set_eventsel_hw() to clear the event selector's hardware enable bit when the PMC should not count based on the guest's Host-Only and Guest-Only event selector bits and the current vCPU state. Signed-off-by: Jim Mattson --- arch/x86/include/... See more