Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp708147rwo; Wed, 2 Aug 2023 02:58:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlEEu6iIoujpCJ4aLNeQOszLCW5K6fD/dMWYXwyZiTCNKZyXI6pMY+B7ECd6xKn1RD3gVHMI X-Received: by 2002:a05:6a00:21c3:b0:686:baf2:35f4 with SMTP id t3-20020a056a0021c300b00686baf235f4mr16824444pfj.29.1690970312525; Wed, 02 Aug 2023 02:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690970312; cv=none; d=google.com; s=arc-20160816; b=iXzv9F9hp5z/dX6XpUHberSi4b2h7AtDzM8K1G169WqIJQZ2h6B8xShUlaNvuyzZek f4y+sOX/zJiUmOR1Mv5uuQ6CUIU2TP1yYt4ZGsJUiQHASvY7tJX1iWGeb08jgZmvdEt0 cWZVbG73gBlLNicPkorAJAdTB/9LScmj6Irgl3cEef9TUM4m9zlkgeoIieQBFUCZrHbr C4EmQY2EKu2sT2sSs+ULb9mioChpsCvfTmaP0pImgIpiK+mJ5anRzxTmIci4v9X00I6n SAHEwFVBYeAnkN1EoyoK2LwfRF2CtX1Ynp2rcPmV11x+Y7zrQOuByiAyC3/ruAIVfv3i SvXA== 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=Lv+uctBJWjHntbt9ymS7BV6w7seTi5jBu2wXQEtBkL0=; fh=iJItedLP8EllUDtKiMC9Kc27aeMpZ+N/9KONWsQqvrk=; b=EZb89QwR/B5tWA9RFXMHUq4cLd0ai04NvlM6Dgz9tqOdp112pjIbxSUDD4dAp34MhW ixNYMQpXOo6y2hvv8oXTenISUganD/e2BABzukKgs7Z+miKdGB56eFN12i4Jn6YAtVXO HCLBVk+2kz30l8sM3D/SdybggEG7+ZT8Cp7eUcz88kgc+GVFG/lHJm69xTlzDs93bQAV rUk+ctlAzvaBK9zbleanZ6/FYOfX0yz+pIUMa4tr7+54KSgC75CjieXsLdCoCxxHNRgK +5hLGSpbjNI029bPP0AI7VrT4ycF7JOMr0+dnoB/BPB9KqP4rPhSN0OC7P6VKjdOU48b 7fVQ== 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 t33-20020a056a0013a100b006871c2c7cfasi7379293pfg.175.2023.08.02.02.58.18; Wed, 02 Aug 2023 02:58:32 -0700 (PDT) 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 S232824AbjHBIzZ (ORCPT + 99 others); Wed, 2 Aug 2023 04:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232713AbjHBIzO (ORCPT ); Wed, 2 Aug 2023 04:55:14 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4B5722D4B for ; Wed, 2 Aug 2023 01:55:12 -0700 (PDT) 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 4DDEE113E; Wed, 2 Aug 2023 01:55:55 -0700 (PDT) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 296183F5A1; Wed, 2 Aug 2023 01:55:11 -0700 (PDT) Message-ID: <558cfef3-8ebf-e59f-af20-7a262b2d2de7@arm.com> Date: Wed, 2 Aug 2023 09:55:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] coresight: trbe: Directly use ID_AA64DFR0_EL1_TraceBuffer_IMP To: Anshuman Khandual , linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: Mike Leach , Leo Yan , coresight@lists.linaro.org, linux-kernel@vger.kernel.org References: <20230802063658.1069813-1-anshuman.khandual@arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20230802063658.1069813-1-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 02/08/2023 07:36, Anshuman Khandual wrote: > is_trbe_available() checks for the TRBE support via extracting TraceBuffer > field value from ID_AA64DFR0_EL1, and ensures that it is implemented. This > replaces the open encoding '0b0001' with 'ID_AA64DFR0_EL1_TraceBuffer_IMP' > which is now available via sysreg tools. Functional change is not intended. > > Cc: Suzuki K Poulose > Cc: Mike Leach > Cc: James Clark > Cc: Leo Yan > Cc: coresight@lists.linaro.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > drivers/hwtracing/coresight/coresight-trbe.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hwtracing/coresight/coresight-trbe.h b/drivers/hwtracing/coresight/coresight-trbe.h > index 94e67009848a..ebb9108d8e24 100644 > --- a/drivers/hwtracing/coresight/coresight-trbe.h > +++ b/drivers/hwtracing/coresight/coresight-trbe.h > @@ -24,7 +24,7 @@ static inline bool is_trbe_available(void) > unsigned int trbe = cpuid_feature_extract_unsigned_field(aa64dfr0, > ID_AA64DFR0_EL1_TraceBuffer_SHIFT); > > - return trbe >= 0b0001; > + return trbe >= ID_AA64DFR0_EL1_TraceBuffer_IMP; > } > > static inline bool is_trbe_enabled(void) Reviewed-by: James Clark Kind of unrelated to this change, but it seems like a lot of feature checks like this avoid using any value altogether when it's just 0 or 1. For example the same check for TRBE in kvm: /* Check if we have TRBE implemented and available at the host */ if (cpuid_feature_extract_unsigned_field(dfr0, ID_AA64DFR0_EL1_TraceBuffer_SHIFT) && ...