]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: x86/pmu: do not mask the value that is written to fixed PMUs
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 20 May 2019 15:34:30 +0000 (17:34 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 May 2019 19:27:14 +0000 (21:27 +0200)
commit2924b52117b2812e9633d5ea337333299166d373
tree74d34bd0be154d800b5409ff9e365b3f48ab3a8b
parent0e6f467ee28ec97f68c7b74e35ec1601bb1368a7
KVM: x86/pmu: do not mask the value that is written to fixed PMUs

According to the SDM, for MSR_IA32_PERFCTR0/1 "the lower-order 32 bits of
each MSR may be written with any value, and the high-order 8 bits are
sign-extended according to the value of bit 31", but the fixed counters
in real hardware are limited to the width of the fixed counters ("bits
beyond the width of the fixed-function counter are reserved and must be
written as zeros").  Fix KVM to do the same.

Reported-by: Nadav Amit <nadav.amit@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/pmu_intel.c