android_kernel_asus_sm8350/arch
Kyle Huey f52c4c067a KVM: x86/svm: Account for family 17h event renumberings in amd_pmc_perf_hw_id
commit 5eb849322d7f7ae9d5c587c7bc3b4f7c6872cd2f upstream.

Zen renumbered some of the performance counters that correspond to the
well known events in perf_hw_id. This code in KVM was never updated for
that, so guest that attempt to use counters on Zen that correspond to the
pre-Zen perf_hw_id values will silently receive the wrong values.

This has been observed in the wild with rr[0] when running in Zen 3
guests. rr uses the retired conditional branch counter 00d1 which is
incorrectly recognized by KVM as PERF_COUNT_HW_STALLED_CYCLES_BACKEND.

[0] https://rr-project.org/

Signed-off-by: Kyle Huey <me@kylehuey.com>
Message-Id: <20220503050136.86298-1-khuey@kylehuey.com>
Cc: stable@vger.kernel.org
[Check guest family, not host. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[Backport to 5.15: adjusted context]
Signed-off-by: Kyle Huey <me@kylehuey.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-15 19:54:47 +02:00
..
alpha alpha: Declare virt_to_phys and virt_to_bus parameter as pointer to volatile 2021-09-30 10:09:26 +02:00
arc ARC: entry: fix syscall_trace_exit argument 2022-04-27 13:50:49 +02:00
arm arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 19:54:46 +02:00
arm64 arm64: dts: imx8mn-ddr4-evk: Describe the 32.768 kHz PMIC clock 2022-05-09 09:03:25 +02:00
c6x mm: consolidate pgtable_cache_init() and pgd_cache_init() 2019-09-24 15:54:09 -07:00
csky perf: Protect perf_guest_cbs with RCU 2022-01-20 09:19:18 +01:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-17 10:35:18 +01:00
hexagon hexagon: export raw I/O routines for modules 2021-11-26 10:47:21 +01:00
ia64 ia64: ensure proper NUMA distance and possible map initialization 2022-03-08 19:07:48 +01:00
m68k m68k: set a default value for MEMORY_RESERVE 2021-11-17 09:48:46 +01:00
microblaze uaccess: fix nios2 and microblaze get_user_8() 2022-04-15 14:18:08 +02:00
mips MIPS: Use address-of operator on section symbols 2022-05-15 19:54:46 +02:00
nds32 nds32: fix access_ok() checks in get/put_user 2022-03-28 08:46:48 +02:00
nios2 uaccess: fix nios2 and microblaze get_user_8() 2022-04-15 14:18:08 +02:00
openrisc openrisc: don't printk() unconditionally 2021-09-22 12:26:24 +02:00
parisc parisc: Merge model and model name into one line in /proc/cpuinfo 2022-05-12 12:23:40 +02:00
powerpc powerpc/perf: Fix power9 event alternatives 2022-04-27 13:50:49 +02:00
riscv riscv module: remove (NOLOAD) 2022-04-15 14:18:31 +02:00
s390 s390/hypfs: include z/VM guests with access control group set 2022-02-01 17:24:33 +01:00
sh sh: define __BIG_ENDIAN for math-emu 2021-11-26 10:47:17 +01:00
sparc sparc64: fix pci_iounmap() when CONFIG_PCI is not set 2021-10-09 14:39:49 +02:00
um um: Fix uml_mconsole stop/go 2022-04-15 14:18:31 +02:00
unicore32 mm: treewide: clarify pgtable_page_{ctor,dtor}() naming 2019-09-26 10:10:44 -07:00
x86 KVM: x86/svm: Account for family 17h event renumberings in amd_pmc_perf_hw_id 2022-05-15 19:54:47 +02:00
xtensa xtensa: fix a7 clobbering in coprocessor context load/store 2022-04-27 13:50:49 +02:00
.gitignore
Kconfig Revert: "ring-buffer: Remove HAVE_64BIT_ALIGNED_ACCESS" 2020-12-30 11:51:47 +01:00