Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp694292imu; Tue, 20 Nov 2018 05:35:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/UOvZgueOuqHBE73+m3gzAvMvyZNZpYFQ4dy7YhBSMDiDWwsspAScomk+Jscg966HOnTODu X-Received: by 2002:a63:374e:: with SMTP id g14mr1953711pgn.59.1542720931516; Tue, 20 Nov 2018 05:35:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542720931; cv=none; d=google.com; s=arc-20160816; b=sa9LwfyerKNnxr9zVD/Z9IuBXsmqs1snx2HSHmKhqq8Gav9GgakEudRt4bdgl04lPq BSiO4/hUlwKaZnLq9BidoapPFTevV1pTV9lRvLCb7xYIwXYG5B1yYhTNQK5wF7e0J+UO xYSy03q7T80qwvucssQHtON0J9aw5JeLSmTDC9wzTQW6iOWhZ0XVm4xLA5WEW8HNp2RS GKQ11N5PnYo0bFtPs6NkaRroUGPXMZ2iQ7q6EzLisfR1Lcw412nGO7Y8cN1wFCRSr/ec W7YvQ828E6Lf+zDcpakUMapSdazkXlIQz6NgnY5mNig38KR0jt6bCxiRLy4h1pBbL7Ex 15cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PE+aSv4njxi5uQQh+Mxg/hNA8zmXwkp8DkvUGeLCGSg=; b=A8KJgqDlGo48GnkyFx6Tnsh968+Nl1zstcb8G6dpsnmRk1cJn0HIdpxKKrxyZsndRV aqfAI9GJFCkt3W4kVqfBEG1z1ebhGYsHJBSFE5ijo7L1twmPLP5S080c26Qs796i3qe/ 3DKUrv/i5MT27/fLSKb2bWQqthBt+ZImlVSCVSbOw542UjqHe1dXPyUihEjzeg1f+l2W fjyairekcf9RJ/ObCncJACABJz9AzIw8RKyJ2QDi59Jthxi6h6LpX93JmSdVUgY1q8sO +OVx7em8JcxKv7hJ09MLCKwzfZniBTlrfxAf9noKytL4Z2IlQBrD377L+OnzgB8pBkr5 +vXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si42661347pgl.595.2018.11.20.05.35.17; Tue, 20 Nov 2018 05:35:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726505AbeKUABP (ORCPT + 99 others); Tue, 20 Nov 2018 19:01:15 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:48952 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbeKUABO (ORCPT ); Tue, 20 Nov 2018 19:01:14 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DEF1FEBD; Tue, 20 Nov 2018 05:32:04 -0800 (PST) Received: from localhost (unknown [10.37.6.11]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 25EE83F5A0; Tue, 20 Nov 2018 05:32:04 -0800 (PST) Date: Tue, 20 Nov 2018 13:32:02 +0000 From: Andrew Murray To: Michael Ellerman Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Shawn Guo , Sascha Hauer , Will Deacon , Mark Rutland , Benjamin Herrenschmidt , Thomas Gleixner , Borislav Petkov , x86@kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joerg Roedel , "paulus@samba.org" Subject: Re: [PATCH 10/10] perf/doc: update design.txt for exclude_{host|guest} flags Message-ID: <20181120133202.GH35798@e119886-lin.cambridge.arm.com> References: <1542363853-13849-1-git-send-email-andrew.murray@arm.com> <1542363853-13849-11-git-send-email-andrew.murray@arm.com> <87pnv00yuf.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pnv00yuf.fsf@concordia.ellerman.id.au> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 20, 2018 at 10:31:36PM +1100, Michael Ellerman wrote: > Andrew Murray writes: > > > Update design.txt to reflect the presence of the exclude_host > > and exclude_guest perf flags. > > > > Signed-off-by: Andrew Murray > > --- > > tools/perf/design.txt | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/tools/perf/design.txt b/tools/perf/design.txt > > index a28dca2..7de7d83 100644 > > --- a/tools/perf/design.txt > > +++ b/tools/perf/design.txt > > @@ -222,6 +222,10 @@ The 'exclude_user', 'exclude_kernel' and 'exclude_hv' bits provide a > > way to request that counting of events be restricted to times when the > > CPU is in user, kernel and/or hypervisor mode. > > > > +Furthermore the 'exclude_host' and 'exclude_guest' bits provide a way > > +to request counting of events restricted to guest and host contexts when > > +using virtualisation. > > How does exclude_host differ from exclude_hv ? I believe exclude_host / exclude_guest are intented to distinguish between host and guest in the hosted hypervisor context (KVM). Whereas exclude_hv allows to distinguish between guest and hypervisor in the bare-metal type hypervisors. In the case of arm64 - if VHE extensions are present then the host kernel will run at a higher privilege to the guest kernel, in which case there is no distinction between hypervisor and host so we ignore exclude_hv. But where VHE extensions are not present then the host kernel runs at the same privilege level as the guest and we use a higher privilege level to switch between them - in this case we can use exclude_hv to discount that hypervisor role of switching between guests. Thanks, Andrew Murray > > cheers