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 4761AC43334 for ; Wed, 29 Jun 2022 10:33:17 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QnOJr8wp4RCxItr2h/b+E2Ctwra2F8pUHsIdE2HQaVQ=; b=0kRCKRn7vhHGqb sWYsWU4fFp3wDTm1mljYWfR4ORL3fENTNZ3VgwVjhiN9qkjZasoxk1He2lGo4XP4hYd7dOAWcBi9y nMqjh7igT/m9WU2xskq3jKowFPA4M4AApbLIIM0LgCmmOIUBzEzK8JLljTlQZjzbO0v4P/KctAmI2 VNTOmlK1Mt1eKKIWn3C3KZH+8f5+E1920NLUYtOESK2Md7QQRUoRUhHTvlwZ8oL5thXyNAt8874FR 0pTKmDXN9aAKd0GUwbl4Uvst+N4b+GOJttSPvid/CQMird/HH06cq0KLMPkLEiayWuullqeXW9DvU l8h74RDfM9zapvUmXh0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6UzD-00B2us-Ho; Wed, 29 Jun 2022 10:31:56 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Uwq-00B20H-AE for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2022 10:29:31 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 7E963CE2570; Wed, 29 Jun 2022 10:29:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89690C341CD; Wed, 29 Jun 2022 10:29:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656498560; bh=YIg1tpqqKFrvOzrBQjEhwOdSspOg1mwtUkoXYc5nyqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JveN9UfcYVQtzxlC8OkbwhASTZBwNqyaXjIEKUo8laiSkcOmb/xR46uwxJmtaKgDI wD2MaEJpXSuHvUAAH65d9K/g5baUo99HmfTe/WljZYMNaidfMUyrhiv/L4AJeUiNbY iyYXIHg8yCYCzcxhN1jgnzp9UNimXOJbIHlepRFn6VreZsa5a/Xh7jjAKkI92WXwvS x5F51KNu/1TrjENNEtRH2m0hR2/PivSUkM1UudmzErVFDLW6Xo+P4FRDJ4sOa1i0L2 GDc245XGlE4YAKozLbFfiksSkd995b6nVDBojmS1WvsrWExbDRQz18p+r3jM6chYys WgK7lrgYEk12A== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Mark Rutland , Joey Gouly , linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v6 01/27] arm64/cpuinfo: Remove refrences to reserved cache type Date: Wed, 29 Jun 2022 11:28:08 +0100 Message-Id: <20220629102834.36569-2-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629102834.36569-1-broonie@kernel.org> References: <20220629102834.36569-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2728; h=from:subject; bh=YIg1tpqqKFrvOzrBQjEhwOdSspOg1mwtUkoXYc5nyqM=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBivCk72X9vKwyKO0rovVkfFQXq6AJgO1F7kH/tTCiX GUU/mb2JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYrwpOwAKCRAk1otyXVSH0NjJB/ 4+7OG/csaiQIiNc/Sh2977XAh9HWDIwgwbLg6Ge/aQbd08ZCjSPwwb988yanVwUTiIKljkdmcVzwmo xO34Pmy2Qz5StiJ0VQvEPESVt8vJF/rTE8SXwlg0hRbhMSFj1hKmSnnneBFgoupunHC8oBnI/FnfOf M1zldvDEwkS1j5tfYKXnwWAuv3C5Zx8saSeleB/6UeeZDiAZnHDciOfNWqpCNkbFNkE0WWDUAf8wZc ReOnkHBwFRUjHg0bPzGbgf3BAURs1mBJgtz8c7NM+c6GQ4PbvlIpA4qltZyuU3NgSrPbmQtv6aRgw4 GFFPxTrhK7kS8jazzrObIkY1VgmgdP X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220629_032928_785264_7B5663BF X-CRM114-Status: GOOD ( 17.04 ) 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 In 155433cb365ee466 ("arm64: cache: Remove support for ASID-tagged VIVT I-caches") we removed all the support fir AIVIVT cache types and renamed all references to the field to say "unknown" since support for AIVIVT caches was removed from the architecture. Some confusion has resulted since the corresponding change to the architecture left the value named as AIVIVT but documented it as reserved in v8, refactor the code so we don't define the constant instead. This will help with automatic generation of this register field since it means we care less about the correspondence with the ARM. No functional change, the value displayed to userspace is unchanged. Signed-off-by: Mark Brown --- arch/arm64/include/asm/cache.h | 1 - arch/arm64/kernel/cpuinfo.c | 23 +++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h index 7c2181c72116..0cbe75b9e4e5 100644 --- a/arch/arm64/include/asm/cache.h +++ b/arch/arm64/include/asm/cache.h @@ -25,7 +25,6 @@ #define CTR_L1IP(ctr) (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK) #define ICACHE_POLICY_VPIPT 0 -#define ICACHE_POLICY_RESERVED 1 #define ICACHE_POLICY_VIPT 2 #define ICACHE_POLICY_PIPT 3 diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 8eff0a34ffd4..629197feb513 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -33,12 +33,19 @@ DEFINE_PER_CPU(struct cpuinfo_arm64, cpu_data); static struct cpuinfo_arm64 boot_cpu_data; -static const char *icache_policy_str[] = { - [ICACHE_POLICY_VPIPT] = "VPIPT", - [ICACHE_POLICY_RESERVED] = "RESERVED/UNKNOWN", - [ICACHE_POLICY_VIPT] = "VIPT", - [ICACHE_POLICY_PIPT] = "PIPT", -}; +static inline const char *icache_policy_str(int l1ip) +{ + switch (l1ip) { + case ICACHE_POLICY_VPIPT: + return "VPIPT"; + case ICACHE_POLICY_VIPT: + return "VIPT"; + case ICACHE_POLICY_PIPT: + return "PIPT"; + default: + return "RESERVED/UNKNOWN"; + } +} unsigned long __icache_flags; @@ -347,14 +354,14 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info) case ICACHE_POLICY_VPIPT: set_bit(ICACHEF_VPIPT, &__icache_flags); break; - case ICACHE_POLICY_RESERVED: case ICACHE_POLICY_VIPT: + default: /* Assume aliasing */ set_bit(ICACHEF_ALIASING, &__icache_flags); break; } - pr_info("Detected %s I-cache on CPU%d\n", icache_policy_str[l1ip], cpu); + pr_info("Detected %s I-cache on CPU%d\n", icache_policy_str(l1ip), cpu); } static void __cpuinfo_store_cpu_32bit(struct cpuinfo_32bit *info) -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel