Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14187193rwb; Sun, 27 Nov 2022 19:27:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Kr/udhlEX4e0fpukqlxmoQPfC4h/OGOFFxukGoTGCMk6nEZaYh9zIlzLewhLU0GihQtWm X-Received: by 2002:a65:4c85:0:b0:46f:59bd:6125 with SMTP id m5-20020a654c85000000b0046f59bd6125mr43874201pgt.147.1669606060717; Sun, 27 Nov 2022 19:27:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669606060; cv=none; d=google.com; s=arc-20160816; b=FcnG1JcgaRcQ5W8k3uA6NCvKJuxmO6DZSPiys3F2Io4QXqFSFVClrLIdAAhfD8RAks 47JZ8XM2Xq7zGT/ZYCmtrrDbpTBbvqE0VD+DBtJGIyTFC5me148vj1ugBCP5/3j4AMvm bgQdzj4bhzgYcbEon83kTmgQNp8RPqtD96tBJT+okSjQVMv9uPsXVVIS9uo129QifdnN usZ3KrYwkRUHzvFPI2caFFWbFLIZSLbtXL40Xk2SCbZFCZa3sb8D9wceHW3qsLSwwIt3 hD/MqaqWs0pi5OayORowz8YJbBHXt0lMUm4jgbBYnEInydCifiG0lDk85on7L+tO1+T5 wdFw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r18-20020aa79ed2000000b00537b1bc9683si9827014pfq.36.2022.11.27.19.27.28; Sun, 27 Nov 2022 19:27:40 -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 + 84 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 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: X-Mailing-List: linux-kernel@vger.kernel.org __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 --- 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