From: Marc Zyngier Subject: Re: [PATCH v8 4/5] arm64: arm_pmu: Add support for exclude_host/exclude_guest attributes Date: Tue, 08 Jan 2019 11:50:59 +0000 Message-ID: <868szvbc64.wl-marc.zyngier@arm.com> References: <1544610573-28446-1-git-send-email-andrew.murray@arm.com> <1544610573-28446-5-git-send-email-andrew.murray@arm.com> <20181218120226.GC25383@e113682-lin.lund.arm.com> <20190104153205.GA31479@edgewater-inn.cambridge.arm.com> <20190108101843.GH10769@e113682-lin.lund.arm.com> <20190108112512.GA56789@e119886-lin.cambridge.arm.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 06C784A437 for ; Tue, 8 Jan 2019 06:51:16 -0500 (EST) Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hZLEuynEVTfS for ; Tue, 8 Jan 2019 06:51:14 -0500 (EST) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D2A494A42C for ; Tue, 8 Jan 2019 06:51:14 -0500 (EST) In-Reply-To: <20190108112512.GA56789@e119886-lin.cambridge.arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: Andrew Murray Cc: Catalin Marinas , joro@8bytes.org, Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org List-Id: kvmarm@lists.cs.columbia.edu On Tue, 08 Jan 2019 11:25:13 +0000, Andrew Murray wrote: Hi Andrew, > My only doubt about this is as follows. If, on a KVM host you run this: > > perf stat -e cycles:H lkvm run ... > > then on the VHE host the cycles reported represents the entire non-guest cycles > associated with running the guest. > > On a !VHE, the cycles reported exclude EL2 (with or without this patch) and > thus you don't get a representation of all the non-guest cycles associated with > the guest. However without this patch you could at least still run: > > perf stat -e cycles:H -e cycles:h lkvm run ... > > and then add the two cycle counts together to get something comparative with > the VHE host. > > If the above patch represents the desired semantics, then perhaps we must count > both EL1 and *EL2* for !exclude_kernel on !VHE. In fact I think we should do > this anyway and remove a little complexity from armv8pmu_set_event_filter. > Thoughts? I'm not sure we should hide the architectural differences between VHE and !VHE. If you're trying to measure what is happening at in the hypervisor, you can't reason about it while ignoring the dual nature of !VHE. Thanks, M. -- Jazz is not dead, it just smell funny.