Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp46907lqs; Thu, 13 Jun 2024 03:29:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxj93DH7KJQ8z0iHN+K0JOcSBbg0zo2YLDNLurzZ8ME2CsnNC+scD6DK35suPWQSnBXwvFlZpyO25pyM3OxMBVTvNKji6irq1E+BiyZA== X-Google-Smtp-Source: AGHT+IEfYn4A+QdagpD+Wad/yn0TpErNGvGdONHBJkizfjENkgllomlqvbqSUSdLvnhpHaH62erf X-Received: by 2002:a17:906:8410:b0:a6f:4e1f:e60b with SMTP id a640c23a62f3a-a6f4e1fe637mr228351566b.36.1718274546852; Thu, 13 Jun 2024 03:29:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718274546; cv=pass; d=google.com; s=arc-20160816; b=XrYYm2Mci24peOXpvtx23Z2aj/maIpUufiP3Pq+dHn2pCuBQGM699PU8BA/2Bg1192 /D3wzTOdM8QwfIeFCZABbv06MVMaZjxMge+eGiLQaRcAlC+jW6G+HfqxkNSuC+M0x8me D3s5tcJs+fK/NgPrxRMLTxr+tUqCLVV2WTRA3HK8sHTPs9Mnesk2FbcF+ffTgk/jNkY8 Z8eLB1vbgRgROJND/R8UJdGu4XEsZGqMophqtc9S4xzyDarTEiwdklO2f8scgYrwmVng WhPgfFJDV+Ii6GHqmqxHRBykk3Xw9DHxy1d4Whpw88/2ih0ByJltRq5Str5lP7V/xKLE XXGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=IBv731guuZwHsiY78NyPQBaXOABZl00NV7P8C0q0ICo=; fh=KXZYQEDrdasP/9PmjSmNJrBCJzMbRI8WnaQ+fvBHKF4=; b=GTfWFazcSOQpOOlxL7EAU2w6lrcM9/gTdYwHcytN/KW59QrV5DFn+cm/a6K+lXpJi/ DHXduQaxPiB48CNYY63Dqsb5BA/JByT0BWZxNXg01mj2kQlD/OD9WCUOB0lISXNOSXPt cGdf7rfMLBO25DHqfr01/GyoZpkPUAaTJnmO1XnLlm6UQkJ8drbexP7PonPgV4KJa7DN hBBLNuY4kac101d8oAB7TG5bsvAQAnpbVvuTZjfRsoumNxVPjCFNzTog16xq0bh35wZK uEkkdZt4jcdusNbZy5/XUagGdjVnwXHIy6qdcc7RWC74GGHnbjtOVrGzmDHj0+nWaSAg TJig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-213023-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213023-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56d21942si58782266b.37.2024.06.13.03.29.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 03:29:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213023-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-213023-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213023-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 27F6A1F2389B for ; Thu, 13 Jun 2024 10:27:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD06F142629; Thu, 13 Jun 2024 10:27:30 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C32B61428E0 for ; Thu, 13 Jun 2024 10:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718274450; cv=none; b=QpozFBsi41pDZCj0mxpwg2+ovpsndmpR5GPlBpxo5z+VUu+yOUYOIX8Vjv/ZXxVW+jrp34Yq80hIiFxfyehrvtps3ka8EX1BPgZUW1sCIFd/ujqUulbEqcrp+JW0l0RIXuReBsn0E7od+1IVR8F/+/F7yg5m+bXa2z/FVmdbQDg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718274450; c=relaxed/simple; bh=aVm7apmyW3+WXy/1EaJpeSajblFAwWgSHmkR8lTAnIg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=owEOvNqWaDyzn9yMJ+AicA8pgkw/Lz6E8Udzc3dD0N9UJga6oYwQlrcSoucDaKtSxoFjFAyAuLzE/DL+dDfLHKYKtn+UHqBvo5jxp8NbKUJj0Wr8mvVII5h9pDgkU4KHLkIUQKMNNb1pSodi8xEZAcLnQuseHVVcdH0Ds3hZtlo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 BF6E41063; Thu, 13 Jun 2024 03:27:52 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.44.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3DBA93F5A1; Thu, 13 Jun 2024 03:27:24 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Cc: mark.rutland@arm.com, ryan.roberts@arm.com, Anshuman Khandual , Catalin Marinas , Will Deacon , Mark Brown , linux-kernel@vger.kernel.org Subject: [PATCH V2 2/2] arm64/cpufeature: Replace custom macros with fields from ID_AA64PFR0_EL1 Date: Thu, 13 Jun 2024 15:57:10 +0530 Message-Id: <20240613102710.3295108-3-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240613102710.3295108-1-anshuman.khandual@arm.com> References: <20240613102710.3295108-1-anshuman.khandual@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This replaces custom macros usage (i.e ID_AA64PFR0_EL1_ELx_64BIT_ONLY and ID_AA64PFR0_EL1_ELx_32BIT_64BIT) and instead directly uses register fields from ID_AA64PFR0_EL1 sysreg definition. Finally let's drop off both these custom macros as they are now redundant. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Mark Brown Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/cpufeature.h | 4 ++-- arch/arm64/include/asm/sysreg.h | 4 ---- arch/arm64/kernel/cpufeature.c | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index 8b904a757bd3..558434267271 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -588,14 +588,14 @@ static inline bool id_aa64pfr0_32bit_el1(u64 pfr0) { u32 val = cpuid_feature_extract_unsigned_field(pfr0, ID_AA64PFR0_EL1_EL1_SHIFT); - return val == ID_AA64PFR0_EL1_ELx_32BIT_64BIT; + return val == ID_AA64PFR0_EL1_EL1_AARCH32; } static inline bool id_aa64pfr0_32bit_el0(u64 pfr0) { u32 val = cpuid_feature_extract_unsigned_field(pfr0, ID_AA64PFR0_EL1_EL0_SHIFT); - return val == ID_AA64PFR0_EL1_ELx_32BIT_64BIT; + return val == ID_AA64PFR0_EL1_EL0_AARCH32; } static inline bool id_aa64pfr0_sve(u64 pfr0) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index 9e8999592f3a..1199185a3da9 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -872,10 +872,6 @@ /* Position the attr at the correct index */ #define MAIR_ATTRIDX(attr, idx) ((attr) << ((idx) * 8)) -/* id_aa64pfr0 */ -#define ID_AA64PFR0_EL1_ELx_64BIT_ONLY 0x1 -#define ID_AA64PFR0_EL1_ELx_32BIT_64BIT 0x2 - /* id_aa64mmfr0 */ #define ID_AA64MMFR0_EL1_TGRAN4_SUPPORTED_MIN 0x0 #define ID_AA64MMFR0_EL1_TGRAN4_LPA2 ID_AA64MMFR0_EL1_TGRAN4_52_BIT diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 56583677c1f2..c041b0958f53 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -285,8 +285,8 @@ static const struct arm64_ftr_bits ftr_id_aa64pfr0[] = { S_ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_FP_SHIFT, 4, ID_AA64PFR0_EL1_FP_NI), ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL3_SHIFT, 4, 0), ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL2_SHIFT, 4, 0), - ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL1_SHIFT, 4, ID_AA64PFR0_EL1_ELx_64BIT_ONLY), - ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL0_SHIFT, 4, ID_AA64PFR0_EL1_ELx_64BIT_ONLY), + ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL1_SHIFT, 4, ID_AA64PFR0_EL1_EL1_IMP), + ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL0_SHIFT, 4, ID_AA64PFR0_EL1_EL0_IMP), ARM64_FTR_END, }; -- 2.30.2