linux-stable/arch
Like Xu 254f73e235 perf/x86/amd: Don't touch the AMD64_EVENTSEL_HOSTONLY bit inside the guest
commit df51fe7ea1 upstream.

If we use "perf record" in an AMD Milan guest, dmesg reports a #GP
warning from an unchecked MSR access error on MSR_F15H_PERF_CTLx:

  [] unchecked MSR access error: WRMSR to 0xc0010200 (tried to write 0x0000020000110076) at rIP: 0xffffffff8106ddb4 (native_write_msr+0x4/0x20)
  [] Call Trace:
  []  amd_pmu_disable_event+0x22/0x90
  []  x86_pmu_stop+0x4c/0xa0
  []  x86_pmu_del+0x3a/0x140

The AMD64_EVENTSEL_HOSTONLY bit is defined and used on the host,
while the guest perf driver should avoid such use.

Fixes: 1018faa6cf ("perf/x86/kvm: Fix Host-Only/Guest-Only counting with SVM disabled")
Signed-off-by: Like Xu <likexu@tencent.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Tested-by: Kim Phillips <kim.phillips@amd.com>
Tested-by: Liam Merwick <liam.merwick@oracle.com>
Link: https://lkml.kernel.org/r/20210802070850.35295-1-likexu@tencent.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-15 13:03:32 +02:00
..
alpha
arc ARCv2: save ABI registers across signal handling 2021-06-30 08:48:54 -04:00
arm omap5-board-common: remove not physically existing vdds_1v8_main fixed-regulator 2021-08-15 13:03:28 +02:00
arm64 arm64: dts: ls208xa: remove bus-num from dspi node 2021-07-28 11:12:14 +02:00
blackfin
c6x
cris
frv
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-23 14:00:33 +01:00
hexagon hexagon: use common DISCARDS macro 2021-07-20 16:17:54 +02:00
ia64 ia64: mca_drv: fix incorrect array size calculation 2021-07-20 16:17:34 +02:00
m32r
m68k
metag
microblaze
mips MIPS: Malta: Do not byte-swap accesses to the CBUS UART 2021-08-15 13:03:32 +02:00
mn10300
nios2
openrisc openrisc: Define memory barrier mb 2021-06-03 08:36:22 +02:00
parisc parisc: avoid a warning on u8 cast for cmpxchg on u8 pointers 2021-04-16 11:57:48 +02:00
powerpc KVM: PPC: Book3S: Fix H_RTAS rets buffer overflow 2021-07-28 11:12:19 +02:00
s390 s390/ftrace: fix ftrace_update_ftrace_func implementation 2021-07-28 11:12:18 +02:00
score
sh sh: dma: fix kconfig dependency for G2_DMA 2021-01-30 13:31:15 +01:00
sparc sparc64: Fix opcode filtering in handling of no fault loads 2021-03-30 14:40:09 +02:00
tile
um um: fix error return code in winch_tramp() 2021-07-20 16:17:53 +02:00
unicore32
x86 perf/x86/amd: Don't touch the AMD64_EVENTSEL_HOSTONLY bit inside the guest 2021-08-15 13:03:32 +02:00
xtensa
.gitignore
Kconfig