linux/arch/x86
Like Xu 8ae8ccd240 KVM: x86/pmu: Fix reserved bits for AMD PerfEvtSeln register
[ Upstream commit cb1d220da0faa5ca0deb93449aff953f0c2cce6d ]

If we run the following perf command in an AMD Milan guest:

  perf stat \
  -e cpu/event=0x1d0/ \
  -e cpu/event=0x1c7/ \
  -e cpu/umask=0x1f,event=0x18e/ \
  -e cpu/umask=0x7,event=0x18e/ \
  -e cpu/umask=0x18,event=0x18e/ \
  ./workload

dmesg will report a #GP warning from an unchecked MSR access
error on MSR_F15H_PERF_CTLx.

This is because according to APM (Revision: 4.03) Figure 13-7,
the bits [35:32] of AMD PerfEvtSeln register is a part of the
event select encoding, which extends the EVENT_SELECT field
from 8 bits to 12 bits.

Opportunistically update pmu->reserved_bits for reserved bit 19.

Reported-by: Jim Mattson <jmattson@google.com>
Fixes: ca724305a2 ("KVM: x86/vPMU: Implement AMD vPMU code for KVM")
Signed-off-by: Like Xu <likexu@tencent.com>
Message-Id: <20211118130320.95997-1-likexu@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-12-08 09:01:13 +01:00
..
boot
configs
crypto
entry
events perf/x86/intel/uncore: Fix IIO event constraints for Skylake Server 2021-11-26 10:47:20 +01:00
hyperv x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails 2021-11-26 10:47:21 +01:00
ia32
include x86: Increase exception stack sizes 2021-11-17 09:48:28 +01:00
kernel x86/irq: Ensure PI wakeup handler is unregistered before module unload 2021-11-17 09:48:19 +01:00
kvm KVM: x86/pmu: Fix reserved bits for AMD PerfEvtSeln register 2021-12-08 09:01:13 +01:00
lib
math-emu
mm x86/sme: Use #define USE_EARLY_PGTABLE_L5 in mem_encrypt_identity.c 2021-11-17 09:48:19 +01:00
net bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-15 09:47:38 +02:00
oprofile
pci
platform x86/platform/olpc: Correct ifdef symbol to intended CONFIG_OLPC_XO15_SCI 2021-10-13 10:08:20 +02:00
power
purgatory
ras
realmode
tools
um
video
xen xen/x86: fix PV trap handling on secondary processors 2021-09-30 10:09:21 +02:00
.gitignore
Kbuild
Kconfig x86/Kconfig: Do not enable AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT automatically 2021-10-20 11:40:15 +02:00
Kconfig.cpu
Kconfig.debug
Makefile
Makefile_32.cpu
Makefile.um