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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E600C41513 for ; Thu, 19 Oct 2023 14:28:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346063AbjJSO2A (ORCPT ); Thu, 19 Oct 2023 10:28:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345688AbjJSO16 (ORCPT ); Thu, 19 Oct 2023 10:27:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2380F134 for ; Thu, 19 Oct 2023 07:27:56 -0700 (PDT) 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 ED4E91007; Thu, 19 Oct 2023 07:28:36 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.31.158]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F2A2E3F762; Thu, 19 Oct 2023 07:27:54 -0700 (PDT) Date: Thu, 19 Oct 2023 15:27:52 +0100 From: Mark Rutland To: Andrea della Porta , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, nik.borisov@suse.com Subject: Re: [PATCH 2/4] arm64/process: Make loading of 32bit processes depend on aarch32_enabled() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 19, 2023 at 02:38:32PM +0200, Andrea della Porta wrote: > On 13:52 Wed 18 Oct , Mark Rutland wrote: > > On Wed, Oct 18, 2023 at 01:13:20PM +0200, Andrea della Porta wrote: > > > Major aspect of Aarch32 emulation is the ability to load 32bit > > > processes. > > > That's currently decided (among others) by compat_elf_check_arch(). > > > > > > Make the macro use aarch32_enabled() to decide if Aarch32 compat is > > > enabled before loading a 32bit process. > > > > > > Signed-off-by: Andrea della Porta > > > > Why can't you make system_supports_32bit_el0() take the option into account > > instead? > > > > I may be wrong here, but it seems to me that system_supports_32bit_el0() > answers teh question "can this system supports compat execution?" rather than > "do I want this system to run any compat execution?". That's the point of > aarch32_enabled(), to state whether we want teh system to run A32 code or not, > regardless of the system supporting it (of course, if the system does not > support A32 in EL0, this is a no-no, but that's another story). That's what the implementation does today, but we're really using it as a "do we intend for 32-bit EL0 to work?" predicate, and generally the system_supports_${FEATURE}() helpers are affected by the combination of actual HW support, kernel config options, *and* kernel command line options. For example, system_supports_sve() is affected by both CONFIG_ARM64_SVE and the "arm64.nosve" command line option. Thanks, Mark.