linux/arch
Sean Christopherson d06260e99e perf/x86/intel: Don't pointlessly context switch DS_AREA (and PEBS config) if PEBS is unused
When filling the list of MSRs to be loaded by KVM on VM-Enter and VM-Exit,
load the guest values for DS_AREA and (conditionally) MSR_PEBS_DATA_CFG if
and only if PEBS will be active in the guest, i.e. only if a PEBS record
may be generated while running the guest.  As shown by the !pebs_ept path,
it's perfectly safe to run with the host's DS_AREA, so long as PEBS-enabled
counters are disabled via PERF_GLOBAL_CTRL.

Omitting DS_AREA and MSR_PEBS_DATA_CFG when PEBS is unused saves two MSR
writes per MSR on each VMX transition, i.e. eliminates two/four pointless
MSR writes on each VMX roundtrip when PEBS isn't being used by the guest.

Fixes: c59a1f106f ("KVM: x86/pmu: Add IA32_PEBS_ENABLE MSR emulation for extended PEBS")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://patch.msgid.link/20260921191418.950933-4-seanjc@google.com
2026-09-22 11:09:14 +02:00
..
alpha pci-v7.3-changes 2026-08-23 12:44:10 -07:00
arc Treewide timer related cleanups: 2026-08-18 15:58:29 -07:00
arm ARM: socfpga: select the PL310 erratum 753970 workaround 2026-08-31 10:44:39 -05:00
arm64 soc: fixes for 7.3 2026-09-18 09:34:57 -07:00
csky mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
hexagon Treewide timer related cleanups: 2026-08-18 15:58:29 -07:00
loongarch kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
m68k m68knommu: updates and fixes for v7.3 2026-08-28 08:44:36 -07:00
microblaze Treewide timer related cleanups: 2026-08-18 15:58:29 -07:00
mips - Fix kconfig dependencies for ECONET 2026-09-18 09:25:07 -07:00
nios2 mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
openrisc OpenRISC 7.3 updates 2026-08-30 09:26:54 -07:00
parisc parisc architecture fixes and updates for kernel v7.3-rc1: 2026-08-23 10:30:02 -07:00
powerpc powerpc/iommu: Fix the overflow validation in iommu_tce_check_ioba 2026-09-16 13:43:58 +05:30
riscv RISC-V updates for v7.3-rc3 2026-09-11 13:15:13 -07:00
s390 s390/crypto: Enable CONTEXT_ANALYSIS 2026-09-08 15:53:41 +02:00
sh gpio updates for v7.3-rc1 2026-08-19 09:10:07 -07:00
sparc mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
um um: Use asm-generic/timex.h over the host architecture one 2026-08-24 17:10:35 -07:00
x86 perf/x86/intel: Don't pointlessly context switch DS_AREA (and PEBS config) if PEBS is unused 2026-09-22 11:09:14 +02:00
xtensa Xtensa updates for v7.3 2026-08-28 08:55:47 -07:00
.gitignore
Kconfig VDSO updates: 2026-08-18 16:56:25 -07:00