From patchwork Mon Dec 4 14:36:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13478569 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 9D570C4167B for ; Mon, 4 Dec 2023 14:37:01 +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=NcMMFhRnGbyEstEGBJxOJq4Foc8Ba2NxatzXAsWKUZ0=; b=B2ZX5hqWlPJpMq PhrlIbcLtCI4ICNSX8ZpbuCrYDWADco9sMAGiTcOPbwU0QYBPj80CiFFB7Dk1NxGlS+i8WUXZ7SO9 EQvK+NnnbPsCgJS80+74/sbnE5TXb8aHBv6XXmDqVmND42hfiC66RW+foMU/u34Z4OqhzmXVcsTrO A1VaDkGYex3JwEuIK9ofgbnk6mw7l+nz8AQWVIm2qcPBKdNN9vQZic9l91yoNCInEofxQt8EFD8os bd7DODrZl9n5micuf9L/N5m6f/3+76llOWZ1scFzVhOW1bwdD2FRYAEguwXJ7RuBebu02ussPKgW4 joSFTHR9hUFPCXgOgAJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rAA3l-004nRy-2H; Mon, 04 Dec 2023 14:36:33 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rAA3Z-004nJ5-1m for linux-arm-kernel@lists.infradead.org; Mon, 04 Dec 2023 14:36:23 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id D9065B8101B; Mon, 4 Dec 2023 14:36:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7444EC43391; Mon, 4 Dec 2023 14:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701700579; bh=P94BNra/R+KkfsC6Uy2bCTh9to9t5Uz2jcj94+O/JVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=unoRh9SnxFhd1DD6kQIAsiW9TF44hi4FvRCJ3ib/+qwSC/vUH9Ch/RwCGBMh+EpY9 dAoG04ccv+DOSBaJo7aT3e0rXDi8jYy5BP5VNOkV/RY5UPuUptRCrBWmGcrQEBU5EH lF9ghvrmZgyyhu3Loo/Zjj4dc3vgBBqQFefD6BAw110UHZk0y4bPH1+7mx66YPlUFf SIFTT1tewEEOsNPgmSvQqJyIVI91UGrX2pNZIOJj2QKwSZDUuDKbnbGvIs8gaS1hHJ VRXtwy6R8rw0He0e6hq3KhUU8eBdAjIrpl5TQSEorpnzGF1usVoVCwqz+MjVr4I76j 3z7ErzIeIGeTQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rAA3V-001GN2-A9; Mon, 04 Dec 2023 14:36:17 +0000 From: Marc Zyngier To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: Will Deacon , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Anshuman Khandual , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: [PATCH v3 2/3] arm64: Kill detection of VPIPT i-cache policy Date: Mon, 4 Dec 2023 14:36:05 +0000 Message-Id: <20231204143606.1806432-3-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204143606.1806432-1-maz@kernel.org> References: <20231204143606.1806432-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, ardb@kernel.org, anshuman.khandual@arm.com, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231204_063622_108025_15EF868F X-CRM114-Status: GOOD ( 11.63 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since the kernel will never run on a system with the VPIPT i-cache policy, drop the detection code altogether. Reviewed-by: Zenghui Yu Reviewed-by: Anshuman Khandual Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/cache.h | 6 ------ arch/arm64/kernel/cpuinfo.c | 5 ----- 2 files changed, 11 deletions(-) diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h index ceb368d33bf4..06a4670bdb0b 100644 --- a/arch/arm64/include/asm/cache.h +++ b/arch/arm64/include/asm/cache.h @@ -58,7 +58,6 @@ static inline unsigned int arch_slab_minalign(void) #define CTR_L1IP(ctr) SYS_FIELD_GET(CTR_EL0, L1Ip, ctr) #define ICACHEF_ALIASING 0 -#define ICACHEF_VPIPT 1 extern unsigned long __icache_flags; /* @@ -70,11 +69,6 @@ static inline int icache_is_aliasing(void) return test_bit(ICACHEF_ALIASING, &__icache_flags); } -static __always_inline int icache_is_vpipt(void) -{ - return test_bit(ICACHEF_VPIPT, &__icache_flags); -} - static inline u32 cache_type_cwg(void) { return SYS_FIELD_GET(CTR_EL0, CWG, read_cpuid_cachetype()); diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index a257da7b56fe..47043c0d95ec 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -36,8 +36,6 @@ static struct cpuinfo_arm64 boot_cpu_data; static inline const char *icache_policy_str(int l1ip) { switch (l1ip) { - case CTR_EL0_L1Ip_VPIPT: - return "VPIPT"; case CTR_EL0_L1Ip_VIPT: return "VIPT"; case CTR_EL0_L1Ip_PIPT: @@ -388,9 +386,6 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info) switch (l1ip) { case CTR_EL0_L1Ip_PIPT: break; - case CTR_EL0_L1Ip_VPIPT: - set_bit(ICACHEF_VPIPT, &__icache_flags); - break; case CTR_EL0_L1Ip_VIPT: default: /* Assume aliasing */