Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14224443rwb; Sun, 27 Nov 2022 20:17:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf677VVwhcdfGZyVKEgK18Oq6SgNazTiyNZQ/ly9Wz4pqMNoTqK+D5W6mVi4dhnxSLTZ+HTy X-Received: by 2002:a17:906:19d5:b0:780:93d2:8510 with SMTP id h21-20020a17090619d500b0078093d28510mr27730249ejd.457.1669609074265; Sun, 27 Nov 2022 20:17:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669609074; cv=none; d=google.com; s=arc-20160816; b=q513NnCTcs8lf1iK9S9srgy/t6BKXt1Fc5U+OBD9xJCMrOYOmDA96y2QU5/V+VnZeh aVXuyGoH3og2CRSxukgDYu6H26TgO3UZ0vFD44ksilAXqo9dsljAKQYStvzYIH0B8bVs hcVPgiK+iUf2vOhl//QSIzflwF309ZaPequ2P9iRvx8Lewm5WR0U1FAiX/atWsRoJ/RG A7DXLGxGWNXdiuyWFikDhzUBAshhA6F0aD9gvMFVMQ1HzKD2iRNGV2cNwKH4e8kv/fho WQcsJv+vGZsE0x2OcbRgx9Iwx0ANpLWR61qS/PWI1m83rQJRXWw+uVrYbzMjEYnHhSil vq0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=gRzWfi+Ws6pGjvkUD01E8z2plAJqT9X8oG/pUttkD8Q=; b=aDek9nIBzEcouqygAZsLAj7EVRz5Gc1crfE+N9VO8KRxtrTZzwiYurSHSOVe0NjSJg Ino741VgLv4zQtcO2PPRAEVBA88WblJuCjKByG39Ht9sjsAiP2ikZDHtVKd921dEz6Ao fGEdG+Dm3C+XJey93155V8Ifv28/a9S46I6MjTRPSA3kQd0pwSvGJeKQsJ8pXNVK1Jrq RM2JvInlV0qT3DuusuCsRy0OTEgN8nmrLDoMGts9MyPNgDLkKn4ip/JGy4Ljx+Op+nGJ SWctFvyWe9Lu9KqZXwMUw5clD5RaaoeCUakg3EoGenzT+E/l84XgAa0YGqHZEPsn8b+f X9MA== 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 hc37-20020a17090716a500b007c00de4e8d5si1082153ejc.798.2022.11.27.20.17.34; Sun, 27 Nov 2022 20:17:54 -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 S229704AbiK1DGY (ORCPT + 84 others); Sun, 27 Nov 2022 22:06:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiK1DGX (ORCPT ); Sun, 27 Nov 2022 22:06:23 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 07D8AB7F2; Sun, 27 Nov 2022 19:06:22 -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 5E3A4D6E; Sun, 27 Nov 2022 19:06:28 -0800 (PST) Received: from [10.162.40.16] (unknown [10.162.40.16]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0833E3F73D; Sun, 27 Nov 2022 19:06:18 -0800 (PST) Message-ID: <60767243-2f3e-a7aa-06e1-674e43f18e9c@arm.com> Date: Mon, 28 Nov 2022 08:36:15 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] arm64/perf: Replace PMU version number '0' with ID_AA64DFR0_EL1_PMUVer_NI To: linux-arm-kernel@lists.infradead.org, will@kernel.org, Marc Zyngier Cc: Arnaldo Carvalho de Melo , Mark Rutland , Catalin Marinas , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221128025449.39085-1-anshuman.khandual@arm.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <20221128025449.39085-1-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 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 > 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; > -- + Marc Zyngier 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