linux/drivers/perf
Alexandre Ghiti cc4c07c89a
drivers: perf: Implement perf event mmap support in the SBI backend
We used to unconditionnally expose the cycle and instret csrs to
userspace, which gives rise to security concerns.

So now we only allow access to hw counters from userspace through the perf
framework which will handle context switches, per-task events...etc. A
sysctl allows to revert the behaviour to the legacy mode so that userspace
applications which are not ready for this change do not break.

But the default value is to allow userspace only through perf: this will
break userspace applications which rely on direct access to rdcycle.
This choice was made for security reasons [1][2]: most of the applications
which use rdcycle can instead use rdtime to count the elapsed time.

[1] https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/REWcwYnzsKE?pli=1
[2] https://www.youtube.com/watch?v=3-c4C_L2PRQ&ab_channel=IEEESymposiumonSecurityandPrivacy

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
2023-08-16 07:28:20 -07: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_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_acpi.c arm_pmu: acpi: handle allocation failure 2022-11-08 12:42:46 +00:00
arm_pmu_platform.c perf/arm_pmu_platform: fix tests for platform_get_irq() failure 2022-09-01 12:01:40 +01:00
arm_pmu.c - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in 2023-06-28 10:59:38 -07:00
arm_pmuv3.c - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in 2023-06-28 10:59:38 -07: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
arm-cci.c perf/arm-cci: Slightly optimize cci_pmu_sync_counters() 2023-06-05 14:53:04 +01:00
arm-ccn.c drivers/perf:Directly use ida_alloc()/free() 2022-06-23 15:44:45 +01:00
arm-cmn.c perf/arm-cmn: Add sysfs identifier 2023-06-16 10:28:21 +01: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_legacy.c drivers: perf: Implement perf event mmap support in the legacy backend 2023-08-16 07:28:19 -07:00
riscv_pmu_sbi.c drivers: perf: Implement perf event mmap support in the SBI backend 2023-08-16 07:28:20 -07:00
riscv_pmu.c drivers: perf: Implement perf event mmap support in the SBI backend 2023-08-16 07:28:20 -07:00
thunderx2_pmu.c perf: Replace acpi_bus_get_device() 2022-02-08 15:14:53 +00:00
xgene_pmu.c perf: replace bitmap_weight with bitmap_empty where appropriate 2022-02-15 14:38:57 +00:00