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 3C6C5C636D6 for ; Thu, 9 Feb 2023 15:17:15 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RuLyvkNCzeKsTl/YpmDRcTx3WE7nn5pUzosdDKs8B04=; b=W7jcom4ItzuO4W n6kniZ6FoDv3jnK/i6UGn2qdDCYm+uJyzv55mBOHV7sBX8U4MsNrm3Qgx2/ls4VZ/gMk9c9LVv3NT wISQTVR6O8KuThmy6qMhjTwqPem8AJ7pT8b3/wzm1pudnm37sMPmKK3TlM/cA/MUIvyVW/QCHCwGL gNWkH7HdPIMvvG+71lAh3du/QG60W5hgI0eC3MKqekvuyHEjonofdhsU40TsldlS8NVp6XNSThQeK 4PQ8HQo+TSb7wM7oAoZarsb1cstr14MMLOFwV6sHq6J65Ke5jUFKWI5cOtopIySQF/mSsoM8nwUNz WKZ4kicVFq1zBvmmH5tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ8el-0029BP-V1; Thu, 09 Feb 2023 15:16:16 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ8de-0028UY-75 for linux-arm-kernel@lists.infradead.org; Thu, 09 Feb 2023 15:15:08 +0000 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 E6DAE2F4; Thu, 9 Feb 2023 07:15:43 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.89.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B9F493F703; Thu, 9 Feb 2023 07:14:59 -0800 (PST) Date: Thu, 9 Feb 2023 15:13:06 +0000 From: Mark Rutland To: Ard Biesheuvel Cc: Will Deacon , linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Kees Cook , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen Subject: Re: [PATCH v2 2/3] efi: arm64: Wire up BTI annotation in memory attributes table Message-ID: References: <20230206124938.272988-1-ardb@kernel.org> <20230206124938.272988-3-ardb@kernel.org> <20230208130007.GA13529@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230209_071506_355692_0BFB6E26 X-CRM114-Status: GOOD ( 24.28 ) 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 On Thu, Feb 09, 2023 at 03:21:55PM +0100, Ard Biesheuvel wrote: > On Wed, 8 Feb 2023 at 15:36, Ard Biesheuvel wrote: > > On Wed, 8 Feb 2023 at 15:25, Mark Rutland wrote: > > > I believe that there's no issue with mismatched CPUs, but there *might* might > > > be a different issue with the ordering of feature detection and usage of the > > > cap: > > > > > > * If CONFIG_ARM64_BTI_KERNEL=y, then the ARM64_BTI cap is detected as a strict > > > boot cpu feature, and secondaries without it will be rejected. > > > > > > * If CONFIG_ARM64_BTI_KERNEL=n then the ARM64_BTI cap is detected as a system > > > feature, and so we only set the cap bit after bringing all secondary CPUs > > > online, and only when *all* CPUs support it. > > > > > > The happens under setup_cpu_features(), called from smp_cpus_done(). > > > > > > So there's no issue with mismatch, but if system_supports_bti is called before > > > smp_cpus_done() on a CONFIG_ARM64_BTI_KERNEL kernel it will return false. When > > > do we set up the EFI mappings relative to that? > > > > > > > Currently it is an early initcall so before SMP, but that is not > > really necessary - the EFI table that carries this annotation is an > > overlay that could easily be applied later. > > > > OTOH, what is the penalty for setting the GP attribute and using the > > translation table on a core that does not implement BTI? > > I'll merge this with the CONFIG_ARM64_BTI_KERNEL check re-added, if > nobody minds? That make sense to me; with the CONFIG_ARM64_BTI_KERNEL check: Acked-by: Mark Rutland Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel