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 67CF4C43334 for ; Mon, 4 Jul 2022 17:04:58 +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=ApWnJlBvvaoeI3jnEn+mjjOLA+osjyrs9fmAna1nw8w=; b=UD8r1nyWzDReqZ 76AeyR5MUtoUUsOIAqiADojV1NJtoBA40NhKbGm0MIjTRuRzbivKeoYRP93k63El07ZwMxgqOCgKr ZZFsuvhoyGsLIIN2BONH8CJoQiluxpSxD9DkTP0+kw+0mkdFcwU2QpXM6JsYe0HfGfJ1NU71J0DRv sRKDpyF00coVxY2MJyo1KQ7mxFZhh1pw1bS/UVwDWB1wLdovD/5eu04tA9KUT5TDOd2z2grxqg6Du /3exGSo0Q93bHqiSn3cPUD6HLe75paX5sV/oNfrYv8mdmeFHPlDGO+DbAAOOEyRwuseh2AyrJskc0 8bgqW1zXtF4whPoXauXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8PUG-00A9Oh-BG; Mon, 04 Jul 2022 17:03:52 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8PTw-00A9GT-P8 for linux-arm-kernel@lists.infradead.org; Mon, 04 Jul 2022 17:03:34 +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 ams.source.kernel.org (Postfix) with ESMTPS id 4E210B81174; Mon, 4 Jul 2022 17:03:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FFDAC341CE; Mon, 4 Jul 2022 17:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656954207; bh=e9sCeThn+QRq5ltJQsw2gUyA8wjOgLKds6GBUEmN9EQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o8RDwYAmuPvHwH8j81oA8MVWZKPez8Ia+AYhd/Ug7QjYbWUi858p1pbcD7EGCuuJ5 mvgoyxHAtuMKhGSnDvR+HMIcS/8+mEtbCJXWZVdiQxoilcoanf3v1pZUb/jbOajSz4 aSBRN9VONPMAd88fo8ZKvHalTWGQJvhcyWlN04Vh88ln/fUp6kNmFJMRWqVqfdKfQW aWMBc+3puj3qQisfAzxCBxJXP2H12XxhVZrmpJe4XQlDtLttP2tiswd7QQQXh48MxP 9lel+nMaoCI94AvVJnAuVK5nlw+fJEwPFvMXP8OF0cJbiJszF7xjOOBURzSOApDLvD 8yhGs4VzbDnGA== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Mark Rutland , Joey Gouly , linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v7 01/28] arm64/cpuinfo: Remove references to reserved cache type Date: Mon, 4 Jul 2022 18:02:35 +0100 Message-Id: <20220704170302.2609529-2-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220704170302.2609529-1-broonie@kernel.org> References: <20220704170302.2609529-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2707; h=from:subject; bh=e9sCeThn+QRq5ltJQsw2gUyA8wjOgLKds6GBUEmN9EQ=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBiwx0uWbnKwUY3dhWJ/rWiuDZWU/lSF/Y5tGdVe/qL J7tcLlaJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYsMdLgAKCRAk1otyXVSH0L4rB/ 0YOapK0nYrbzciFat5XMp5UHf+i0vOuhXgyXgbFCqr7gs6mgkCJpFjnMClbX3qKIe7behGq3gkbJBd 6q9KnQL9iDzpyfeetacK/ETK9qtq/5weLtwyw2w0AsgDg4pxx19pem0fdl2534bpIY0wD9HeH5UBn7 5GD0MgkhsgOTtbofoAZSMzPJarlkQ5flzpCbvwOgxwkRFKFeJOTLOWGOwPt5+FTjyqaS3yWOzOXait B4cbjbw1qlmlOHKxSnXTJQAiDHZy6vcHYeaes+uYbRJ8aOn0TxGGjme2Q0xT6nqKvO0E/EBvGJy4Xm O8o4sO0HX1gCZ0mg6FYlf9z2IahS1p 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-20220704_100333_140236_A188477C X-CRM114-Status: GOOD ( 17.06 ) 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..deaaa9438fc2 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