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 2FC99C7EE23 for ; Thu, 1 Jun 2023 14:25:08 +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=4j5Qz53U20OO7XuxrfrzzcHhb6jXhENiDRRVjLl/dhs=; b=N4xDFA8upraLQp BTBkdi2Th0DKeMhGQmiSjICQoEDEATxevKNX3cYNd0zQQF7dk3rpXfIwx9tyRoEZhD0kLSjZ5gekM rOy337qRRHJbM+Gcj8uJNifkORTEG+SgKw5dZpAjooURmArxQRvyfx/Ri3vruCrqYFDYGC2YP4k2Z j7gvYkkn2E3RcKjOKTh7QLzmdg8RP2BciVd7GDEs3EHwzfN7DGG2HQ5H6Tzsdbv1/t2ZeKVemaZhD hbUDoJFFeoyV3S9yg0YriKMq2J1dLNYxOBbvyk+jzKQCbSh858V+Q6FANApS2HXvxFIQZ9wX8RKkU c3WAOuJhtxz6Aa9WaZJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4jEL-003qF5-1i; Thu, 01 Jun 2023 14:24:45 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4jEI-003qB2-0u for linux-arm-kernel@lists.infradead.org; Thu, 01 Jun 2023 14:24:43 +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 dfw.source.kernel.org (Postfix) with ESMTPS id C2458645D3; Thu, 1 Jun 2023 14:24:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A5A9C433A1; Thu, 1 Jun 2023 14:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685629481; bh=zWleo526SBHCNCPpmvccVS39oPn4F0gjyvM0jgCD4hk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kJdPRFrydxP57mKy22i8UbbfLsB67AHVOfCSTYKbtFjVNGJn7wz2mVqUJPmDAa09+ 4jtMZ820J4sq/JhdAphSE6lOYkd6yqZxoV2kJ1Al8SS8ukznNsQ7/PnscUo/4nOqs3 v+B2CP6koG1OSY4tUD5fuWE3p62s4Jf4egK7qmEl039K/GWTBsiVGanFuceWIib+Tz mSfmAqgomVTFYoZLEwki7CIiCLDJNqk6ozE+hAXf3YAEgmXuWINBvuyB/AY1OCHbfz le2LjUwMZ3pIE/d1IO5zSsCvkNKK70hd808LlWySBpwIhZ2MdyXhpSGZo+pt1386Q5 gyd6SL3X2CWyw== Received: from 90.4.23.109.rev.sfr.net ([109.23.4.90] helo=localhost.localdomain) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1q4jEF-0024XU-8i; Thu, 01 Jun 2023 15:24:39 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Cc: Catalin Marinas , Will Deacon , Mark Rutland , Ard Biesheuvel , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Vladimir Murzin Subject: [PATCH 1/5] arm64: Remove CnP detection Date: Thu, 1 Jun 2023 15:24:25 +0100 Message-Id: <20230601142429.12835-2-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230601142429.12835-1-maz@kernel.org> References: <20230601142429.12835-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 109.23.4.90 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, ardb@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, vladimir.murzin@arm.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-20230601_072442_415662_E0835896 X-CRM114-Status: GOOD ( 15.85 ) 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 order to get rid of CnP one bit at a time without messing up the build nor the runtime behaviour of the kernel, let's start by dropping the feature detection. Signed-off-by: Marc Zyngier --- arch/arm64/kernel/cpufeature.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 7d7128c65161..ca4e7e1fc9fa 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1594,23 +1594,6 @@ static bool has_cache_dic(const struct arm64_cpu_capabilities *entry, return ctr & BIT(CTR_EL0_DIC_SHIFT); } -static bool __maybe_unused -has_useable_cnp(const struct arm64_cpu_capabilities *entry, int scope) -{ - /* - * Kdump isn't guaranteed to power-off all secondary CPUs, CNP - * may share TLB entries with a CPU stuck in the crashed - * kernel. - */ - if (is_kdump_kernel()) - return false; - - if (cpus_have_const_cap(ARM64_WORKAROUND_NVIDIA_CARMEL_CNP)) - return false; - - return has_cpuid_feature(entry, scope); -} - /* * This check is triggered during the early boot before the cpufeature * is initialised. Checking the status on the local CPU allows the boot @@ -2446,16 +2429,6 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .matches = has_cpuid_feature, ARM64_CPUID_FIELDS(ID_AA64PFR1_EL1, SSBS, IMP) }, -#ifdef CONFIG_ARM64_CNP - { - .desc = "Common not Private translations", - .capability = ARM64_HAS_CNP, - .type = ARM64_CPUCAP_SYSTEM_FEATURE, - .matches = has_useable_cnp, - .cpu_enable = cpu_enable_cnp, - ARM64_CPUID_FIELDS(ID_AA64MMFR2_EL1, CnP, IMP) - }, -#endif { .desc = "Speculation barrier (SB)", .capability = ARM64_HAS_SB, -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel