]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/pmu: Don't truncate the PerfEvtSeln MSR when creating a perf event
authorJim Mattson <jmattson@google.com>
Thu, 3 Feb 2022 01:48:12 +0000 (17:48 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 14 Feb 2022 12:43:46 +0000 (07:43 -0500)
commit0813d8efb74becc3c32301deaf8d6d55c11c1f75
treeb5c35979c5af7db992a271a50d593f33ea7d8b6e
parent8d17326377a4dab4813ab86290928df6fbb99717
KVM: x86/pmu: Don't truncate the PerfEvtSeln MSR when creating a perf event

AMD's event select is 3 nybbles, with the high nybble in bits 35:32 of
a PerfEvtSeln MSR. Don't drop the high nybble when setting up the
config field of a perf_event_attr structure for a call to
perf_event_create_kernel_counter().

Fixes: c97977012838 ("KVM: x86/vPMU: Implement AMD vPMU code for KVM")
Reported-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Message-Id: <20220203014813.2130559-1-jmattson@google.com>
Reviewed-by: David Dunn <daviddunn@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/pmu.c