From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2CA7C636D6 for ; Wed, 8 Feb 2023 11:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VJUN6eA6sKcRzYcB3Js6Bof5MjO7SMeYlLObwvEogc4=; b=gv3Kad3WbvxhDv 96iJ0Oloc69FBrQLYEzXpFRXvP6ncEOw/3NF0I2H0I3jKSiosb8w0zo+XigbgMYN+pbC6ETCRqoWQ 4LTwTkat56IsWURPxwWFzKCCF2fgbnaaCGIsC/wTG65INvv5CBSryWiS5kvIPJeEILAtliNXIFnDk p6XY1jKxeSYavnuIvcXgtXXh4GsEjtmPtDr53myyukOaaM601UIWXlPNhkpnWrebT/UFsbalNGvb4 +7RezVoafJ0ZTtY349NNnip/iNdkwj2txBWd1hHo8DD0OMeSIRNxgwoYhuPpyAX5ZxLc5NxyY/4gO KPF64d5GcnDZt2iwiDzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPiZT-00FTHw-GP; Wed, 08 Feb 2023 11:25:03 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPiZO-00FTFn-L6 for linux-arm-kernel@lists.infradead.org; Wed, 08 Feb 2023 11:25:00 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3BE51B81D42; Wed, 8 Feb 2023 11:24:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6AF1C433D2; Wed, 8 Feb 2023 11:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675855495; bh=wsd1S5kOu4Opqg5TZyZpc4u1xf28GoANoypPqb/j024=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jOnVSS1ZAfBcPLH4eEhAWHHxZEUnlmuTa8O2ug/bOvrb3pEEUd1dyrloNXZwhNaoJ hG40ih4ERo7hGsDK2KcpXhmGHhcsI7ZR556JncaUxizvMHhgI3eWiYv7AAuDprYnWq JDuArNISeHBw2PwXDZxrg4YxX3PJBYsnWlYCs1dA0cckcdt+1wGIKrUPLM/3Ju6iUc cysrUMMefKmdmUaa+GJcScL2ovIvQV7KPJiL0w/oe7SjjBQicNh4NAusoIiscu2Lu9 l4e5nN+quZnFkKWCfqqNCrHMO7X16j+/LBhOhLmmCjXX9Dh3hOVzqwYnY1nJWXKBkk /YnXIdk19cLBw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pPiZJ-008dpq-Id; Wed, 08 Feb 2023 11:24:53 +0000 Date: Wed, 08 Feb 2023 11:24:53 +0000 Message-ID: <86lel8z9fe.wl-maz@kernel.org> From: Marc Zyngier To: Zaid Al-Bassam Cc: Jesus Sanchez-Palencia , Russell King , Catalin Marinas , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu Subject: Re: [PATCH 4/8] perf: pmuv3: Add wrappers for KVM accesses In-Reply-To: <20230126204444.2204061-5-zalbassam@google.com> References: <20230126204444.2204061-1-zalbassam@google.com> <20230126204444.2204061-5-zalbassam@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: zalbassam@google.com, jesussanp@google.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230208_032459_014060_E8571D6A X-CRM114-Status: GOOD ( 27.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 26 Jan 2023 20:44:40 +0000, Zaid Al-Bassam wrote: > > KVM host support is available only on arm64. This patch adds wrappers > to the KVM host function references in the arm_pmuv3.c, so that it is > up to architecture to populate these wrappers if supported. > > Signed-off-by: Zaid Al-Bassam > --- > arch/arm64/include/asm/arm_pmuv3.h | 16 ++++++++++++++++ > drivers/perf/arm_pmuv3.c | 11 +++++------ > 2 files changed, 21 insertions(+), 6 deletions(-) > > diff --git a/arch/arm64/include/asm/arm_pmuv3.h b/arch/arm64/include/asm/arm_pmuv3.h > index f41a354d1022..9f2a48f5340c 100644 > --- a/arch/arm64/include/asm/arm_pmuv3.h > +++ b/arch/arm64/include/asm/arm_pmuv3.h > @@ -20,6 +20,7 @@ > > #include > #include > +#include "linux" includes must be placed before the "asm" ones. > > /* > * This code is really good > @@ -191,4 +192,19 @@ static inline u32 read_pmceid1(void) > return read_sysreg(pmceid1_el0); > } > > +static inline void armv8pmu_kvm_set_events(u32 set, struct perf_event_attr *attr) > +{ > + kvm_set_pmu_events(set, attr); > +} > + > +static inline void armv8pmu_kvm_clr_events(u32 clr) > +{ > + kvm_clr_pmu_events(clr); > +} > + > +static inline bool armv8pmu_kvm_counter_deferred(struct perf_event_attr *attr) > +{ > + return kvm_pmu_counter_deferred(attr); > +} > + > #endif > diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c > index 505f0758260c..d7063dd52827 100644 > --- a/drivers/perf/arm_pmuv3.c > +++ b/drivers/perf/arm_pmuv3.c > @@ -16,7 +16,6 @@ > > #include > #include > -#include > #include > #include > #include > @@ -607,10 +606,10 @@ static inline void armv8pmu_enable_event_counter(struct perf_event *event) > struct perf_event_attr *attr = &event->attr; > u32 mask = armv8pmu_event_cnten_mask(event); > > - kvm_set_pmu_events(mask, attr); > + armv8pmu_kvm_set_events(mask, attr); Why the change of name? given that you will implement empty helpers in the AArch32 code, you might as well keep the names and reduce the churn. At the end of the day, the only thing you need to do in this patch is to move the "#include " from this file into the arch-specific file. Nothing else. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel