lkml.org 
[lkml]   [2023]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 3/3] coresight: Support exclude_guest with Feat_TRF and nVHE
Date
With nVHE the filters need to be applied before switching to the guest,
so supply the per-cpu filter status to KVM.

Signed-off-by: James Clark <james.clark@arm.com>
---
drivers/hwtracing/coresight/coresight-etm-perf.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
index 5ca6278baff4..f78f05e656f5 100644
--- a/drivers/hwtracing/coresight/coresight-etm-perf.c
+++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
@@ -9,6 +9,7 @@
#include <linux/coresight-pmu.h>
#include <linux/cpumask.h>
#include <linux/device.h>
+#include <linux/kvm_host.h>
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/init.h>
@@ -510,6 +511,7 @@ static void etm_event_start(struct perf_event *event, int flags)
}

out:
+ kvm_etm_set_events(&event->attr);
/* Tell the perf core the event is alive */
event->hw.state = 0;
/* Save the event_data for this ETM */
@@ -627,6 +629,8 @@ static void etm_event_stop(struct perf_event *event, int mode)

/* Disabling the path make its elements available to other sessions */
coresight_disable_path(path);
+
+ kvm_etm_clr_events();
}

static int etm_event_add(struct perf_event *event, int mode)
--
2.34.1
\
 
 \ /
  Last update: 2023-08-04 12:15    [W:0.081 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site