linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: qcom_l2_pmu: don't allow guest access
@ 2017-12-06 15:55 Neil Leeder
  2017-12-06 16:11 ` Mark Rutland
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Leeder @ 2017-12-06 15:55 UTC (permalink / raw)
  To: linux-arm-kernel

Guests cannot access IMPDEF system registers, which are used
by this driver. Disable the driver if it's running in a guest VM.

Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
---
 drivers/perf/qcom_l2_pmu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/perf/qcom_l2_pmu.c b/drivers/perf/qcom_l2_pmu.c
index 4fdc848..49dc954 100644
--- a/drivers/perf/qcom_l2_pmu.c
+++ b/drivers/perf/qcom_l2_pmu.c
@@ -1057,6 +1057,10 @@ static int __init register_l2_cache_pmu_driver(void)
 {
 	int err;
 
+	/* Don't enable driver if running as guest */
+	if (!is_hyp_mode_available())
+		return 0;
+
 	err = cpuhp_setup_state_multi(CPUHP_AP_PERF_ARM_QCOM_L2_ONLINE,
 				      "AP_PERF_ARM_QCOM_L2_ONLINE",
 				      l2cache_pmu_online_cpu,
-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-07 16:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-06 15:55 [PATCH] perf: qcom_l2_pmu: don't allow guest access Neil Leeder
2017-12-06 16:11 ` Mark Rutland
2017-12-06 21:19   ` Leeder, Neil
2017-12-07 13:38     ` Will Deacon
2017-12-07 15:44       ` Leeder, Neil
2017-12-07 16:00         ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).