Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1188331pxu; Fri, 16 Oct 2020 06:12:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnJ3qx1qLAYB7q72f9FnhjpFwqEyANRa0RvRaZrfr3RK0iKAdufBIoSBdGrSaNa4YmcuHk X-Received: by 2002:a2e:b8cc:: with SMTP id s12mr1566570ljp.2.1602853952195; Fri, 16 Oct 2020 06:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602853952; cv=none; d=google.com; s=arc-20160816; b=dXU310TRHswDAvIKcz+cUrjbj95ajPb2ckOdGq3Gh8ytHCcmdv6tnugmAU0S/VYwti oCnB7XM2xe2S8jSVhGyBeokvCPwnCb7TWC6jt4Uks0C/xe99YzzTR/yBAaAX/2gmzJWS Y1/1OX1OZ8z9nMKToxhuq2cXlU3uVSkdiC5sI2Ouczf+zWF9ZF2tTrenmeWJJdbfW97o b9J38rjlfqkFNX0rEHYI9xsDCjkNxUb2oQSsuMN0o2o4AExcv3mRy6MDppSf+AyZQb6t wmZx0G7xFABSwwhqG4eqBiFu0a3BMJF/x8m9bnlPy/LU5eulL91PMDiRlJnPhOBqJjn7 X5MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=+Ax969ic+yTa0u7yNEurIUDT5S4tz6vc0Rvc54Kysgk=; b=DOqcK4EybgFdn+h4FE7J/IexvUeDn6ODmK+sISp/+9BAwbjSYVzBcByO0/bdoh3rqZ ubecegUnEmi9jP/Y0ET+78fd0dFTyFk3LufGwrWV92S6JCa+UNR9Ix1TloRanpPTWCPF ah7Vw0a3KkNafpVyMP0m4lcT7Ghm0hM2l2GK7lMKgo0luqj//YRjnZpZfcWSuKbY0lc7 pLRi5M/jitNR5tXTSizFagb/lGIhMIbcjrkHr8HYVSFBhImig6uM8GlVJJQ1WwWHlJZS QmCVlkn7ktxu/Yk7gCT8ZNwblW9/5OQmpCEYeeG5Ndhen26HpXKuqEQZ2RsDLF7+t2GB yCWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s12si1570523edy.583.2020.10.16.06.12.09; Fri, 16 Oct 2020 06:12:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2406838AbgJPLix (ORCPT + 99 others); Fri, 16 Oct 2020 07:38:53 -0400 Received: from foss.arm.com ([217.140.110.172]:35278 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404884AbgJPLiw (ORCPT ); Fri, 16 Oct 2020 07:38:52 -0400 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 BEBBDD6E; Fri, 16 Oct 2020 04:38:51 -0700 (PDT) Received: from [10.57.50.28] (unknown [10.57.50.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 972553F719; Fri, 16 Oct 2020 04:38:49 -0700 (PDT) Subject: Re: [PATCH] coresight: etm4x: Add config to exclude kernel mode tracing To: Leo Yan , Sai Prakash Ranjan Cc: Denis Nikitin , Mathieu Poirier , linux-arm-msm@vger.kernel.org, coresight@lists.linaro.org, linux-kernel@vger.kernel.org, Stephen Boyd , linux-arm-kernel@lists.infradead.org, Mike Leach References: <20201015124522.1876-1-saiprakash.ranjan@codeaurora.org> <20201015160257.GA1450102@xps15> <20201016072401.GC4646@leoy-ThinkPad-X240s> <20201016092450.GG4646@leoy-ThinkPad-X240s> From: Suzuki Poulose Message-ID: Date: Fri, 16 Oct 2020 12:38:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <20201016092450.GG4646@leoy-ThinkPad-X240s> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/16/20 10:24 AM, Leo Yan wrote: > Hi Sai, > > On Fri, Oct 16, 2020 at 02:10:47PM +0530, Sai Prakash Ranjan wrote: >> Hi Leo, >> >> On 2020-10-16 12:54, Leo Yan wrote: >>> On Thu, Oct 15, 2020 at 11:40:05PM -0700, Denis Nikitin wrote: >>>> Hi Mathieu, >>>> >>>> I think one of the use cases could be VMs. >>>> Is there isolation between EL1 guest kernels which we can control >>>> from perf >>>> in a system wide mode? >>> >>> Sorry for suddenly jumping in. >>> >>> For KVM, I think we need to implement mechanism for saving/restoring >>> CoreSight context for every guest OS, the CPU PMUs has implemented >>> related features [1]. >>> >>> Thanks, >>> Leo >>> >>> [1] >>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/kvm/pmu.c >>> Its not as easy as the CPU PMU for virtualizing the ETMs (with memory mapped access only), i.e supporting ETMs from VMs. We could definitely stop/resume on guest entry/exit, to support attr.exclude_guest. >> >> What happens to the sysfs mode of tracing? For that we would still >> need a config right to exclude kernel mode tracing completely. > > IIUC, sysfs mode and perf mode both can apply the same approach, the > guest OS runs a thread context for the host, so when a guest OS is > switched in or out, the hypervisor can save/restore the context for > the guest OS; thus every guest OS will have its dedicated context and > trace data ideally. I don't think Guest Context is something we can support as mentioned above, at least for systems without sysreg access for ETMs (and virtualizing ETRs is a different story !) Cheers Suzuki