From mboxrd@z Thu Jan 1 00:00:00 1970 From: rusty@rustcorp.com.au (Rusty Russell) Date: Wed, 19 Sep 2012 13:39:34 +0930 Subject: [kvmarm] [PATCH 05/15] ARM: Expose PMNC bitfields for KVM use In-Reply-To: <20120918130821.GN32204@mudshark.cambridge.arm.com> References: <20120915153359.21241.86002.stgit@ubuntu> <20120915153502.21241.13218.stgit@ubuntu> <20120918130821.GN32204@mudshark.cambridge.arm.com> Message-ID: <87fw6epsap.fsf@rustcorp.com.au> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Will Deacon writes: > On Sat, Sep 15, 2012 at 04:35:02PM +0100, Christoffer Dall wrote: >> From: Rusty Russell >> >> We want some of these for use in KVM, so pull them out of >> arch/arm/kernel/perf_event_v7.c into their own asm/perf_bits.h. >> >> Signed-off-by: Rusty Russell >> Signed-off-by: Christoffer Dall >> --- >> arch/arm/include/asm/perf_bits.h | 56 ++++++++++++++++++++++++++++++++++++++ >> arch/arm/kernel/perf_event_v7.c | 51 +---------------------------------- >> 2 files changed, 57 insertions(+), 50 deletions(-) >> create mode 100644 arch/arm/include/asm/perf_bits.h > > I don't like this I'm afraid. These bit definitions, although useful for > kvm, are only applicable to ARMv7 PMUs. Perf does a reasonable job of > separating the low-level CPU-specific code and adding the v7 definitions > into their own global header feels like a step backwards. I also want to > move a load of this into drivers/ at some point and this won't help with > that effort. > > Is KVM just using this for world switch? If so, why does it care about the > bit definitions (and what do you do for things like debug regs)? Is there > anything I could add to perf that you could call instead? No, we need these definitions if we ever want to actually implement PMU for the guest.[1] But we don't do this yet, so you can defer this patch until then if you want. Cheers, Rusty. [1] Which we should do, since you NAKed the patch which would allow the guest to detect that we don't have a PMU, insisting that "all A15s have a PMU", despite the fact that we don't. I assume this means you're busy implementing it right now :) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [kvmarm] [PATCH 05/15] ARM: Expose PMNC bitfields for KVM use Date: Wed, 19 Sep 2012 13:39:34 +0930 Message-ID: <87fw6epsap.fsf@rustcorp.com.au> References: <20120915153359.21241.86002.stgit@ubuntu> <20120915153502.21241.13218.stgit@ubuntu> <20120918130821.GN32204@mudshark.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "linux-arm-kernel\@lists.infradead.org" , "kvm\@vger.kernel.org" , "kvmarm\@lists.cs.columbia.edu" To: Will Deacon , Christoffer Dall Return-path: Received: from ozlabs.org ([203.10.76.45]:36213 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753112Ab2ISFpA (ORCPT ); Wed, 19 Sep 2012 01:45:00 -0400 In-Reply-To: <20120918130821.GN32204@mudshark.cambridge.arm.com> Sender: kvm-owner@vger.kernel.org List-ID: Will Deacon writes: > On Sat, Sep 15, 2012 at 04:35:02PM +0100, Christoffer Dall wrote: >> From: Rusty Russell >> >> We want some of these for use in KVM, so pull them out of >> arch/arm/kernel/perf_event_v7.c into their own asm/perf_bits.h. >> >> Signed-off-by: Rusty Russell >> Signed-off-by: Christoffer Dall >> --- >> arch/arm/include/asm/perf_bits.h | 56 ++++++++++++++++++++++++++++++++++++++ >> arch/arm/kernel/perf_event_v7.c | 51 +---------------------------------- >> 2 files changed, 57 insertions(+), 50 deletions(-) >> create mode 100644 arch/arm/include/asm/perf_bits.h > > I don't like this I'm afraid. These bit definitions, although useful for > kvm, are only applicable to ARMv7 PMUs. Perf does a reasonable job of > separating the low-level CPU-specific code and adding the v7 definitions > into their own global header feels like a step backwards. I also want to > move a load of this into drivers/ at some point and this won't help with > that effort. > > Is KVM just using this for world switch? If so, why does it care about the > bit definitions (and what do you do for things like debug regs)? Is there > anything I could add to perf that you could call instead? No, we need these definitions if we ever want to actually implement PMU for the guest.[1] But we don't do this yet, so you can defer this patch until then if you want. Cheers, Rusty. [1] Which we should do, since you NAKed the patch which would allow the guest to detect that we don't have a PMU, insisting that "all A15s have a PMU", despite the fact that we don't. I assume this means you're busy implementing it right now :)