Message ID | 20221128025449.39085-1-anshuman.khandual@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5405761wrr; Sun, 27 Nov 2022 19:08:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf53nhA9+TlRchzPtiwoBOBrWs/Q1H4zVSObac0wTTEv70ycOuTQ7lcGGhKZiPFPPvPPfQyN X-Received: by 2002:a17:906:660d:b0:7ba:5085:864 with SMTP id b13-20020a170906660d00b007ba50850864mr18655319ejp.357.1669604907685; Sun, 27 Nov 2022 19:08:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669604907; cv=none; d=google.com; s=arc-20160816; b=1GdE1TB9kTq8CduYpyPvMaPRh/YOwTUZk/a2JGXJHnIeK6e8TfuBzIzBaAnw1ypalG iZS7hJl8t8CGXL9B2gbHps4KonUSs6tebKQ0RmWUBYFwVserzRI+XajBE27K/0yprvcb Zi4Qu2WZPD8553hGp78R4lHDPshxff5kslddaH3NfPZOtJ4XRl98YbshptuEd3YQbpoj s7y1Acl3zKTYZgIxtecHv524MYOshahhulzb9vggpX+p0PykyGMW+MOsiVTXxlSXJjE7 STT/fF2NRXTgwLR7UR9V34U5IkbPKDwe3gNpKL/QxOJSeYSY8l8SlZMTbE6giepp78a6 yVRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=NCbTi3/OfsU1+eoLz210x/kh1AVBkU/ICBue+L00HtM=; b=ESMxGom3wq4Oz1Io8+T17PYeUSH2roFiNELUbxJAU/M1UnIAaISDzKUvitlNRp71X6 anei2HOklWG8VaAI5gYEqpCR7e/60vnFiPEWhS0D/RKybqLHYS6gq+r66QIUc2MWMiC+ 2Eavsb2fDcHcSkqQlOjaNFEuWG5W9tuoz7hDMfVWZx1PlRrOT3KUyySl1xHD7tX4VYwh bW7+VQSfniLARVghzJXCmcLvM+IB3/OEdFTmIKNAjlza8V8UmrjqnPU897RNyguSKnVI A+Ok5Rco9vRCg5o7C6QujdbTNkj9JWrJaT091MMLgwgvQXfhXBuEnboiK/m+xc9PpGqW 8gdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ek12-20020a056402370c00b0046b1ed09862si2066050edb.47.2022.11.27.19.08.01; Sun, 27 Nov 2022 19:08:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229593AbiK1CzC (ORCPT <rfc822;gah0developer@gmail.com> + 99 others); Sun, 27 Nov 2022 21:55:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbiK1CzB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 27 Nov 2022 21:55:01 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5B01B2DFE; Sun, 27 Nov 2022 18:55:00 -0800 (PST) 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 93449D6E; Sun, 27 Nov 2022 18:55:06 -0800 (PST) Received: from a077893.blr.arm.com (unknown [10.162.40.16]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 096A63F73D; Sun, 27 Nov 2022 18:54:56 -0800 (PST) From: Anshuman Khandual <anshuman.khandual@arm.com> To: linux-arm-kernel@lists.infradead.org, will@kernel.org Cc: Anshuman Khandual <anshuman.khandual@arm.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Catalin Marinas <catalin.marinas@arm.com>, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64/perf: Replace PMU version number '0' with ID_AA64DFR0_EL1_PMUVer_NI Date: Mon, 28 Nov 2022 08:24:49 +0530 Message-Id: <20221128025449.39085-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750707635684437047?= X-GMAIL-MSGID: =?utf-8?q?1750707635684437047?= |
Series |
arm64/perf: Replace PMU version number '0' with ID_AA64DFR0_EL1_PMUVer_NI
|
|
Commit Message
Anshuman Khandual
Nov. 28, 2022, 2:54 a.m. UTC
__armv8pmu_probe_pmu() returns if detected PMU is either not implemented or
implementation defined. Extracted ID_AA64DFR0_EL1_PMUVer value, when PMU is
not implemented is '0' which can be replaced with ID_AA64DFR0_EL1_PMUVer_NI
defined as '0b0000'.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-perf-users@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This applies on v6.1-rc6
arch/arm64/kernel/perf_event.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 11/28/22 08:24, Anshuman Khandual wrote: > __armv8pmu_probe_pmu() returns if detected PMU is either not implemented or > implementation defined. Extracted ID_AA64DFR0_EL1_PMUVer value, when PMU is > not implemented is '0' which can be replaced with ID_AA64DFR0_EL1_PMUVer_NI > defined as '0b0000'. > > Cc: Arnaldo Carvalho de Melo <acme@kernel.org> > Cc: Mark Rutland <mark.rutland@arm.com> > Cc: Will Deacon <will@kernel.org> > Cc: Catalin Marinas <catalin.marinas@arm.com> > Cc: linux-perf-users@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> > --- > This applies on v6.1-rc6 > > arch/arm64/kernel/perf_event.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c > index 85a3aaefc0fb..b638f584b4dd 100644 > --- a/arch/arm64/kernel/perf_event.c > +++ b/arch/arm64/kernel/perf_event.c > @@ -1188,7 +1188,8 @@ static void __armv8pmu_probe_pmu(void *info) > dfr0 = read_sysreg(id_aa64dfr0_el1); > pmuver = cpuid_feature_extract_unsigned_field(dfr0, > ID_AA64DFR0_EL1_PMUVer_SHIFT); > - if (pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF || pmuver == 0) > + if (pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF || > + pmuver == ID_AA64DFR0_EL1_PMUVer_NI) > return; > > cpu_pmu->pmuver = pmuver; > -- + Marc Zyngier <maz@kernel.org> There are some KVM related pmuver not-implemented check as well, should they be replaced in this patch or rather in a separate patch ? arch/arm64/kvm/pmu-emul.c: if (pmu->pmuver == 0 || pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF) arch/arm64/kvm/pmu-emul.c: if (pmu->pmuver == 0 || arch/arm64/kvm/pmu-emul.c: pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF) - Anshuman
On Mon, 28 Nov 2022 03:06:15 +0000, Anshuman Khandual <anshuman.khandual@arm.com> wrote: > > > > On 11/28/22 08:24, Anshuman Khandual wrote: > > __armv8pmu_probe_pmu() returns if detected PMU is either not implemented or > > implementation defined. Extracted ID_AA64DFR0_EL1_PMUVer value, when PMU is > > not implemented is '0' which can be replaced with ID_AA64DFR0_EL1_PMUVer_NI > > defined as '0b0000'. > > > > Cc: Arnaldo Carvalho de Melo <acme@kernel.org> > > Cc: Mark Rutland <mark.rutland@arm.com> > > Cc: Will Deacon <will@kernel.org> > > Cc: Catalin Marinas <catalin.marinas@arm.com> > > Cc: linux-perf-users@vger.kernel.org > > Cc: linux-kernel@vger.kernel.org > > Cc: linux-arm-kernel@lists.infradead.org > > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> > > --- > > This applies on v6.1-rc6 > > > > arch/arm64/kernel/perf_event.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c > > index 85a3aaefc0fb..b638f584b4dd 100644 > > --- a/arch/arm64/kernel/perf_event.c > > +++ b/arch/arm64/kernel/perf_event.c > > @@ -1188,7 +1188,8 @@ static void __armv8pmu_probe_pmu(void *info) > > dfr0 = read_sysreg(id_aa64dfr0_el1); > > pmuver = cpuid_feature_extract_unsigned_field(dfr0, > > ID_AA64DFR0_EL1_PMUVer_SHIFT); > > - if (pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF || pmuver == 0) > > + if (pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF || > > + pmuver == ID_AA64DFR0_EL1_PMUVer_NI) > > return; > > > > cpu_pmu->pmuver = pmuver; > > -- > > + Marc Zyngier <maz@kernel.org> > > There are some KVM related pmuver not-implemented check as well, should they be > replaced in this patch or rather in a separate patch ? > > arch/arm64/kvm/pmu-emul.c: if (pmu->pmuver == 0 || pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF) > arch/arm64/kvm/pmu-emul.c: if (pmu->pmuver == 0 || > arch/arm64/kvm/pmu-emul.c: pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF) Separate patch please, as I have a large KVM PMU rework already queued. Thanks, M.
On Mon, Nov 28, 2022 at 08:24:49AM +0530, Anshuman Khandual wrote: > __armv8pmu_probe_pmu() returns if detected PMU is either not implemented or > implementation defined. Extracted ID_AA64DFR0_EL1_PMUVer value, when PMU is > not implemented is '0' which can be replaced with ID_AA64DFR0_EL1_PMUVer_NI > defined as '0b0000'. > > Cc: Arnaldo Carvalho de Melo <acme@kernel.org> > Cc: Mark Rutland <mark.rutland@arm.com> > Cc: Will Deacon <will@kernel.org> > Cc: Catalin Marinas <catalin.marinas@arm.com> > Cc: linux-perf-users@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> This looks fine to me, so: Acked-by: Mark Rutland <mark.rutland@arm.com> I'll leave it to Will to pick this as his convenience. Mark. > --- > This applies on v6.1-rc6 > > arch/arm64/kernel/perf_event.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c > index 85a3aaefc0fb..b638f584b4dd 100644 > --- a/arch/arm64/kernel/perf_event.c > +++ b/arch/arm64/kernel/perf_event.c > @@ -1188,7 +1188,8 @@ static void __armv8pmu_probe_pmu(void *info) > dfr0 = read_sysreg(id_aa64dfr0_el1); > pmuver = cpuid_feature_extract_unsigned_field(dfr0, > ID_AA64DFR0_EL1_PMUVer_SHIFT); > - if (pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF || pmuver == 0) > + if (pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF || > + pmuver == ID_AA64DFR0_EL1_PMUVer_NI) > return; > > cpu_pmu->pmuver = pmuver; > -- > 2.25.1 >
On Mon, 28 Nov 2022 08:24:49 +0530, Anshuman Khandual wrote: > __armv8pmu_probe_pmu() returns if detected PMU is either not implemented or > implementation defined. Extracted ID_AA64DFR0_EL1_PMUVer value, when PMU is > not implemented is '0' which can be replaced with ID_AA64DFR0_EL1_PMUVer_NI > defined as '0b0000'. > > Applied to will (for-next/perf), thanks! [1/1] arm64/perf: Replace PMU version number '0' with ID_AA64DFR0_EL1_PMUVer_NI https://git.kernel.org/will/c/cc91b9481605 Cheers,
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 85a3aaefc0fb..b638f584b4dd 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -1188,7 +1188,8 @@ static void __armv8pmu_probe_pmu(void *info) dfr0 = read_sysreg(id_aa64dfr0_el1); pmuver = cpuid_feature_extract_unsigned_field(dfr0, ID_AA64DFR0_EL1_PMUVer_SHIFT); - if (pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF || pmuver == 0) + if (pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF || + pmuver == ID_AA64DFR0_EL1_PMUVer_NI) return; cpu_pmu->pmuver = pmuver;