From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BAD96C001DE for ; Wed, 2 Aug 2023 08:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QIINRkl+9CcjmCTjX/LBOxM02ufG404A7bDEL/rWx38=; b=F3byG4K8u98PRK CZ3O1x9fBJNrsED4W85he15Obv0Gvp/A0mck29THySHalXaXYy7SqJm3nWbO42kGHd/i17jFuVigj +Jk/sgDZ2Ccm+FADR4/RJee9WinSRJq8Qb6aOoXjwqdceYWaXAD88Cdkn0TKye4JzZpJY0ELOEPZH EoNYg0jv11BnyDh2cUy4eUqZb5TktLLoCfj6l2dUiUuUJUCM0nkTLv4AwncWAVx8v+YAy9gvUk84x eHNJFymRrnD12aXMXEbb4F52UK+rzAUgb0muGzMowtzFeQkXutEVnfYiJniflG6PJlH50Wb5LBEa3 ccs3jVYTZnhNiI0g736g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qR7dV-004QCJ-0q; Wed, 02 Aug 2023 08:55:17 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qR7dT-004QBa-0C for linux-arm-kernel@lists.infradead.org; Wed, 02 Aug 2023 08:55:16 +0000 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230802_015515_150525_A420B29E X-CRM114-Status: GOOD ( 18.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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) && ... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11293C001DE for ; Wed, 2 Aug 2023 08:55:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233232AbjHBIz1 (ORCPT ); Wed, 2 Aug 2023 04:55:27 -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 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) && ...