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 X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 324B6C64E7B for ; Tue, 1 Dec 2020 16:57:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD5D020758 for ; Tue, 1 Dec 2020 16:57:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="u2htcCfO"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ySzyQkKm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD5D020758 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=rYdRJ2bYmVhBRTyTRjTHfeU5SFw5vE2MtfW57746B8M=; b=u2htcCfOOdfFx2isncoya11Uq 9mkgLwrj9TuiUgoG4kIqn6IT4+eGKXYAekrwcZE7ItEUKmcJZz3O5/P80Vlifw5I8SSzcf0dnLon2 d9K9akMWRPOQowFd3OrW5HObyi22YZQXRHMCNFBqzmM0TlJZFIkH82rnW9cJZiYjnsjXoEFVZa8ts 4HFBrn9I0vW26I7rWVlUHPxnYEjoKXqSSV2Cai9kKHsB4rBWJcfB9nuAJkoHnXi6HfH9C9weH6z06 sB/6+NdFET8Z/SUUbWWt1L2FnfYN0RPCQKvmbSEzKGdr9zI0T9oIY0zuC/gWFcjvIk/z63hQyojRI UivhTOcMA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk8x6-0003l3-6z; Tue, 01 Dec 2020 16:56:32 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk8x4-0003kN-7W for linux-arm-kernel@lists.infradead.org; Tue, 01 Dec 2020 16:56:31 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EED51208FE; Tue, 1 Dec 2020 16:56:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606841789; bh=g3X3ttP3AwCBVr8F5vieRLoKEI3HdmrwGG8BQB3NfyE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ySzyQkKm6yR3vZvsp0wlY8TIKOrpgzGkQX1U5nGecPhgodrD9cowBALu8935/+nSD qtatbNsSWuaHIyZi5TiK2AFdgcuxlt6IdBoPOdFQ3CVqyZUlttmfEz9XGX3d23LnMu Vy1g9BW8884IkjFJ4FtFXV6NAQULalRWc6aEf3qM= Date: Tue, 1 Dec 2020 16:56:21 +0000 From: Will Deacon To: Qais Yousef Subject: Re: [PATCH v4 02/14] arm64: Allow mismatched 32-bit EL0 support Message-ID: <20201201165621.GB27783@willie-the-truck> References: <20201124155039.13804-1-will@kernel.org> <20201124155039.13804-3-will@kernel.org> <20201127130941.pr3grbcir6jdtzwa@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201127130941.pr3grbcir6jdtzwa@e107158-lin.cambridge.arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201201_115630_532488_010F12A2 X-CRM114-Status: GOOD ( 27.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Marc Zyngier , kernel-team@android.com, Vincent Guittot , Juri Lelli , Quentin Perret , Peter Zijlstra , Catalin Marinas , Johannes Weiner , linux-kernel@vger.kernel.org, Ingo Molnar , Li Zefan , Greg Kroah-Hartman , Tejun Heo , Suren Baghdasaryan , Morten Rasmussen , linux-arm-kernel@lists.infradead.org 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 Fri, Nov 27, 2020 at 01:09:41PM +0000, Qais Yousef wrote: > On 11/24/20 15:50, Will Deacon wrote: > > When confronted with a mixture of CPUs, some of which support 32-bit > > Confronted made me laugh, well chosen word! :D > > For some reason made me think of this :p > > https://www.youtube.com/watch?v=NJbXPzSPzxc&t=1m33s I think it just about sums it up! > > applications and others which don't, we quite sensibly treat the system > > as 64-bit only for userspace and prevent execve() of 32-bit binaries. > > > > Unfortunately, some crazy folks have decided to build systems like this > > with the intention of running 32-bit applications, so relax our > > sanitisation logic to continue to advertise 32-bit support to userspace > > on these systems and track the real 32-bit capable cores in a cpumask > > instead. For now, the default behaviour remains but will be tied to > > a command-line option in a later patch. > > > > Signed-off-by: Will Deacon > > --- > > arch/arm64/include/asm/cpucaps.h | 2 +- > > arch/arm64/include/asm/cpufeature.h | 8 ++- > > arch/arm64/kernel/cpufeature.c | 106 ++++++++++++++++++++++++++-- > > 3 files changed, 107 insertions(+), 9 deletions(-) > > > > diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h > > index e7d98997c09c..e6f0eb4643a0 100644 > > --- a/arch/arm64/include/asm/cpucaps.h > > +++ b/arch/arm64/include/asm/cpucaps.h > > @@ -20,7 +20,7 @@ > > #define ARM64_ALT_PAN_NOT_UAO 10 > > #define ARM64_HAS_VIRT_HOST_EXTN 11 > > #define ARM64_WORKAROUND_CAVIUM_27456 12 > > -#define ARM64_HAS_32BIT_EL0 13 > > +#define ARM64_HAS_32BIT_EL0_DO_NOT_USE 13 > > nit: would UNUSED be better here? Worth adding a comment as to why too? UNUSED sounds like you could delete it, but I'll add a comment. > > #define ARM64_HARDEN_EL2_VECTORS 14 > > #define ARM64_HAS_CNP 15 > > #define ARM64_HAS_NO_FPSIMD 16 > > [...] > > > +static bool has_32bit_el0(const struct arm64_cpu_capabilities *entry, int scope) > > +{ > > + if (!has_cpuid_feature(entry, scope)) > > + return allow_mismatched_32bit_el0; > > If a user passes the command line by mistake on a 64bit only system, this will > return true. I'll be honest, I'm not entirely sure what the impact is. I get > lost in the features maze. It is nicely encapsulated, but hard to navigate for > the none initiated :-) The thing is, we can't generally detect a 64-bit-only system because a 32-bit-capable CPU could be hotplugged on late. So passing this option just controls what the behaviour is at the point that the 32-bit-capable CPU appears. If one doesn't appear, then there won't be a difference. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel