From patchwork Mon Nov 28 02:54:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 26476 Return-Path: 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 + 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 ); 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 To: linux-arm-kernel@lists.infradead.org, will@kernel.org Cc: Anshuman Khandual , Arnaldo Carvalho de Melo , Mark Rutland , Catalin Marinas , 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 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: 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?= __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 Cc: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas 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 Acked-by: Mark Rutland --- 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;