Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp909401rwb; Sat, 5 Aug 2023 03:48:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzyArIYCOnqUCcOcvxoGtxrdUszauRzq25ma1DYzCqA3IC3cnP1bBGEWX+hDIjGtID08xF X-Received: by 2002:a17:906:5307:b0:99c:56d0:8720 with SMTP id h7-20020a170906530700b0099c56d08720mr2976575ejo.3.1691232493907; Sat, 05 Aug 2023 03:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691232493; cv=none; d=google.com; s=arc-20160816; b=F+31JP1K0xD6eENMi1lhsohjnIiR8Btf11DzSNQl/IWiFbiK0I6Cycb0Qm+1xtsjIv ARDiFda5yPypJzW5Oo3pCpKRQu+nkvQEJAqPARasr7s+vETqwkKXddfO5YLyqO6PErIa JykWlhFd/dRGY3XN6M4sCF5DrzmTflkClI8G5ClBtzKl+ZLp80MUlbMDaSZgdk4PL5v9 e3Cwj04KTp8R1hWT/PtzHRaMzqXf175x3/+IbuzI8kYpcFJuB+x6D1hld30IPiHzUwfa +Lz9C1jy+7bpe9hKcadmhZRs8tOdlvokAutpOemKeGuIUc/CxY/x64rrpU5pPxdj8513 wieA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=AFRKNkAsOjIy3EoJ2GlDeIxfV1Rls6//46+2nB3PMUQ=; fh=xMhcjV8rjvGJDfEe4cSFzCN/HGbHkXv+NP3b6C2OVh0=; b=yvx/XfQ268TJQSuX5pJx+Gc2lcmao+BSu4gwYV8sGeuGVznpuH1IrvFCnc+8t/7hf5 /WCwGaOfmebhPJ5eeOMFNx7tjp8o9pplXEftmjgMABW/i2HajRGEwysh0mAZpKPgTKEe PqcxuppulsxBRTivzSsfL6zn3a9pmX3wfrnrea8WX/L8qcHAj0iMgte9G4+foLXtilNU nocWoUD5y7rM6UWLoJihDkZxF/GvuCJdg/eaU3YkFtMVRWTvNGPS3K9vCJvK9f8PUoxw WZ0rk7hxb4TK/H+88KzQ6ZPQjZJ6Y3HHz+gH+cs+UBJiPn5ocXnDX89VzrEWs7ztJwDu UP5w== 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 l18-20020a1709061c5200b00991df86ac08si2819231ejg.256.2023.08.05.03.47.47; Sat, 05 Aug 2023 03:48:13 -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 S229777AbjHEKOz (ORCPT + 99 others); Sat, 5 Aug 2023 06:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjHEKOy (ORCPT ); Sat, 5 Aug 2023 06:14:54 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1841646B2 for ; Sat, 5 Aug 2023 03:14:50 -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 1E5BE1FB; Sat, 5 Aug 2023 03:15:32 -0700 (PDT) Received: from [10.57.90.200] (unknown [10.57.90.200]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A5BD03F5A1; Sat, 5 Aug 2023 03:14:46 -0700 (PDT) Message-ID: <63e20343-b95c-308f-ac43-8285ef164caf@arm.com> Date: Sat, 5 Aug 2023 11:14:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [RFC PATCH 0/3] coresight: Support exclude_guest with Feat_TRF and nVHE To: James Clark , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Cc: Marc Zyngier , Oliver Upton , James Morse , Zenghui Yu , Catalin Marinas , Will Deacon , Mike Leach , Leo Yan , Alexander Shishkin , Anshuman Khandual , Rob Herring , linux-kernel@vger.kernel.org, Steve Clevenger , Tanmay Jagdale , Ganapatrao Kulkarni References: <20230804101317.460697-1-james.clark@arm.com> From: Suzuki K Poulose In-Reply-To: <20230804101317.460697-1-james.clark@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 Cc: Ganpatrao, Steve, Tanmay On 04/08/2023 11:13, James Clark wrote: > Hi, > > I'm looking for help in testing this and for feedback on whether it's > useful to anyone. Testing it requires hardware that has Feat_TRF (v8.4) > but no TRBE. This is because TRBE usage is disabled in nVHE guests. > > I don't currently have any access to any hardware, and the FVP model > can only do self hosted trace using TRBE. If you have a v8.4+ (and not v9) HW, please could you give this a spin ? Suzuki > > Currently with nVHE you would always get trace from guests, and > filtering out isn't possible without this patchset. In comparison, with > VHE guests, they never generate guest trace without [1]. I think the > existence of trace rather than lack of could suggest that this change is > less useful than [1]. Also the restricted set of hardware that it works > on supports that too. > > Apart from compilation and checking that the exclude guest settings > are correctly programmed on guest switch, this is untested by me. > > Applies to kvmarm/next (3b4e3afb2032) > > [1]: https://lore.kernel.org/linux-arm-kernel/20230804085219.260790-3-james.clark@arm.com/ > > James Clark (3): > arm64: KVM: Add support for exclude_guest and exclude_host for ETM > arm64: KVM: Support exclude_guest for Coresight trace in nVHE > coresight: Support exclude_guest with Feat_TRF and nVHE > > arch/arm64/include/asm/kvm_host.h | 10 +++- > arch/arm64/kvm/Makefile | 1 + > arch/arm64/kvm/arm.c | 1 + > arch/arm64/kvm/debug.c | 7 +++ > arch/arm64/kvm/etm.c | 48 ++++++++++++++++ > arch/arm64/kvm/hyp/nvhe/debug-sr.c | 56 +++++++++++++++++-- > .../hwtracing/coresight/coresight-etm-perf.c | 4 ++ > include/kvm/etm.h | 43 ++++++++++++++ > 8 files changed, 165 insertions(+), 5 deletions(-) > create mode 100644 arch/arm64/kvm/etm.c > create mode 100644 include/kvm/etm.h >