linux/drivers/perf
Marc Zyngier b1f778a223 KVM: arm64: pmu: Resync EL0 state on counter rotation
Huang Shijie reports that, when profiling a guest from the host
with a number of events that exceeds the number of available
counters, the reported counts are wildly inaccurate. Without
the counter oversubscription, the reported counts are correct.

Their investigation indicates that upon counter rotation (which
takes place on the back of a timer interrupt), we fail to
re-apply the guest EL0 enabling, leading to the counting of host
events instead of guest events.

In order to solve this, add yet another hook between the host PMU
driver and KVM, re-applying the guest EL0 configuration if the
right conditions apply (the host is VHE, we are in interrupt
context, and we interrupted a running vcpu). This triggers a new
vcpu request which will apply the correct configuration on guest
reentry.

With this, we have the correct counts, even when the counters are
oversubscribed.

Reported-by: Huang Shijie <shijie@os.amperecomputing.com>
Suggested-by: Oliver Upton <oliver.upton@linux.dev>
Tested_by: Huang Shijie <shijie@os.amperecomputing.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20230809013953.7692-1-shijie@os.amperecomputing.com
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20230820090108.177817-1-maz@kernel.org
2023-08-22 13:35:51 +01:00
..
amlogic arm64 updates for 6.4 2023-04-25 12:39:01 -07:00
arm_cspmu perf: arm_cspmu: Add missing MODULE_DEVICE_TABLE 2023-06-16 10:32:32 +01:00
hisilicon drivers/perf: hisi: Add support for HiSilicon UC PMU driver 2023-06-16 12:27:38 +01:00
alibaba_uncore_drw_pmu.c drivers/perf: Use devm_platform_get_and_ioremap_resource() 2023-03-27 15:09:09 +01:00
apple_m1_cpu_pmu.c drivers/perf: apple_m1: Force 63bit counters for M2 CPUs 2023-06-05 15:39:59 +01:00
arm-cci.c perf/arm-cci: Slightly optimize cci_pmu_sync_counters() 2023-06-05 14:53:04 +01:00
arm-ccn.c
arm-cmn.c perf/arm-cmn: Add sysfs identifier 2023-06-16 10:28:21 +01:00
arm_dmc620_pmu.c perf/arm_dmc620: Add cpumask 2023-06-16 10:24:12 +01:00
arm_dsu_pmu.c perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init() 2022-11-15 13:45:01 +00:00
arm_pmu.c - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in 2023-06-28 10:59:38 -07:00
arm_pmu_acpi.c arm_pmu: acpi: handle allocation failure 2022-11-08 12:42:46 +00:00
arm_pmu_platform.c
arm_pmuv3.c KVM: arm64: pmu: Resync EL0 state on counter rotation 2023-08-22 13:35:51 +01:00
arm_smmuv3_pmu.c perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init() 2022-11-15 13:47:04 +00:00
arm_spe_pmu.c perf: arm_spe: Print the version of SPE detected 2023-02-07 11:52:21 +00:00
cxl_pmu.c perf: CXL Performance Monitoring Unit driver 2023-06-25 17:47:09 -07:00
fsl_imx8_ddr_perf.c drivers/perf: fsl_imx8_ddr_perf: Remove set-but-not-used variable 2023-02-03 13:04:22 +00:00
fsl_imx9_ddr_perf.c drivers/perf: imx_ddr: Add support for NXP i.MX9 SoC DDRC PMU driver 2023-06-09 12:01:10 +01:00
Kconfig cxl for v6.5 2023-07-01 08:58:41 -07:00
Makefile cxl for v6.5 2023-07-01 08:58:41 -07:00
marvell_cn10k_ddr_pmu.c perf/marvell: Add ACPI support to DDR uncore driver 2023-01-19 18:30:21 +00:00
marvell_cn10k_tad_pmu.c perf/marvell: Add ACPI support to TAD uncore driver 2023-01-19 18:30:22 +00:00
qcom_l2_pmu.c perf: qcom_l2_pmu: Make l2_cache_pmu_probe_cluster() more robust 2023-06-05 15:01:27 +01:00
qcom_l3_pmu.c perf: qcom: Use devm_platform_get_and_ioremap_resource() 2023-03-27 15:03:01 +01:00
riscv_pmu.c perf: RISC-V: Remove PERF_HES_STOPPED flag checking in riscv_pmu_start() 2023-07-12 07:41:23 -07:00
riscv_pmu_legacy.c RISC-V Patches for the 6.1 Merge Window, Part 1 2022-10-09 13:24:01 -07:00
riscv_pmu_sbi.c perf: RISC-V: Limit the number of counters returned from SBI 2023-06-20 12:55:24 -07:00
thunderx2_pmu.c
xgene_pmu.c