Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3350854rwo; Fri, 4 Aug 2023 03:40:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6I/CWcveXreG9KFA4Ig/FUVZw8aa8Cmce8kUMt1RA3sQ162tX0yWgRCo2Z/w6A+uqzXXJ X-Received: by 2002:aa7:c755:0:b0:523:1e0a:e12e with SMTP id c21-20020aa7c755000000b005231e0ae12emr881040eds.23.1691145603570; Fri, 04 Aug 2023 03:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691145603; cv=none; d=google.com; s=arc-20160816; b=VJL7vdYqyJhezxQp5NcLsY1iaBk4iVPGENl2jLN8vL6I9zDWXObMYVCEh8TEVuTJV7 Kwb2Bd/LtoVFd+zpxGCuxWEFJjdpkHOnLCaOQgUx8ORn2gKJoq9vir/WzhLZgc6obHiB w2rtWzlamX2yUQIozpn9kmJ9obaltyt5ZJ2QCtRnH4pOv7cFBriYyxFmMuD/HUE7WRxL GnRNLgbyos6dAsXCQRujSzRnTNIM6c1L+qS01ZPpdBtj7F1hqZYUapNTouoZ1twVjlrD MDcaY8WyEgofGY0Vco4iCnVMYuuPg4F3eSJBnQnN7V0yS7D1BR6D6AHDe7N+704jDxMO msmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wCf1nw/M0EhRjrGgSI5psDm20H13uheTfHu4boy4r+M=; fh=2aTzhFOtuTAUox/fryuGjv4i69lxVLnRHInQo3XCKBw=; b=OMR2HcyWCgO9veyHV9WLS2QCpjP5a7J28AFsNgNbvcYMp7yaeu+JEBIeIT8ofPLPQi +ZJRtpHPx1LL3+Zggxqb8rV6fnER0YB467DmrZhcD0++Y4MKoZpkJ1Cskn+ISqPxMWee Berh9UNH4DKNlblMXl9o1hQkisxow7mpKlAHicDw6XLs3H6C4ADldGP5S7CgsGS2zyrD qurpauT0v6GW+kaRRceTfv2MtGhEQcze2rLuHnovjoXGA8wyQjTsAVob+0UUhlfHndzb ntT6BBY0UINGCko/kG2bi32kp4Cjlvd7l+ozhCiIEQ1YNg0PSkv454mpAFr6eLpFwFq0 5fCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d23-20020a50fb17000000b005231068f3e6si1391641edq.532.2023.08.04.03.39.38; Fri, 04 Aug 2023 03:40:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231447AbjHDKOz (ORCPT + 99 others); Fri, 4 Aug 2023 06:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230288AbjHDKOC (ORCPT ); Fri, 4 Aug 2023 06:14:02 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD52149D4 for ; Fri, 4 Aug 2023 03:13:58 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3146C1007; Fri, 4 Aug 2023 03:14:41 -0700 (PDT) Received: from e127643.arm.com (unknown [10.57.3.154]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A9FDE3F6C4; Fri, 4 Aug 2023 03:13:55 -0700 (PDT) From: James Clark To: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Cc: James Clark , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Mike Leach , Leo Yan , Alexander Shishkin , Anshuman Khandual , Rob Herring , linux-kernel@vger.kernel.org Subject: [RFC PATCH 3/3] coresight: Support exclude_guest with Feat_TRF and nVHE Date: Fri, 4 Aug 2023 11:13:13 +0100 Message-Id: <20230804101317.460697-4-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230804101317.460697-1-james.clark@arm.com> References: <20230804101317.460697-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include #include +#include #include #include #include @@ -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