linux-stable/arch/x86/events
Like Xu f2aeea5750 perf/x86/core: Completely disable guest PEBS via guest's global_ctrl
When a guest PEBS counter is cross-mapped by a host counter, software
will remove the corresponding bit in the arr[global_ctrl].guest and
expect hardware to perform a change of state "from enable to disable"
via the msr_slot[] switch during the vmx transaction.

The real world is that if user adjust the counter overflow value small
enough, it still opens a tiny race window for the previously PEBS-enabled
counter to write cross-mapped PEBS records into the guest's PEBS buffer,
when arr[global_ctrl].guest has been prioritised (switch_msr_special stuff)
to switch into the enabled state, while the arr[pebs_enable].guest has not.

Close this window by clearing invalid bits in the arr[global_ctrl].guest.

Fixes: 854250329c ("KVM: x86/pmu: Disable guest PEBS temporarily in two rare situations")
Signed-off-by: Like Xu <likexu@tencent.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220831033524.58561-1-likexu@tencent.com
2022-09-01 11:19:42 +02:00
..
amd perf/x86/amd/uncore: Add PerfMonV2 RDPMC assignments 2022-06-13 10:15:14 +02:00
intel perf/x86/core: Completely disable guest PEBS via guest's global_ctrl 2022-09-01 11:19:42 +02:00
zhaoxin x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
core.c x86: events: Do not return bogus capabilities if PMU is broken 2022-06-08 13:06:15 -04:00
Kconfig perf/x86/Kconfig: Fix indentation in the Kconfig file 2022-05-25 15:54:26 +02:00
Makefile perf/x86/rapl: Fix RAPL config variable bug 2020-06-02 11:52:56 +02:00
msr.c perf/x86/msr: Add new Alder Lake and Raptor Lake support 2022-05-11 16:27:08 +02:00
perf_event.h perf/x86/intel: Fix unchecked MSR access error for Alder Lake N 2022-09-01 11:19:41 +02:00
probe.c perf/x86/rapl: Add msr mask support 2021-02-10 14:44:54 +01:00
probe.h perf/x86/rapl: Add msr mask support 2021-02-10 14:44:54 +01:00
rapl.c perf/x86/rapl: fix AMD event handling 2022-01-18 12:09:48 +01:00