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 E0793CDB47E for ; Wed, 18 Oct 2023 12:53:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231134AbjJRMxI (ORCPT ); Wed, 18 Oct 2023 08:53:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230492AbjJRMxF (ORCPT ); Wed, 18 Oct 2023 08:53:05 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 22335127 for ; Wed, 18 Oct 2023 05:52:59 -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 D8AB02F4; Wed, 18 Oct 2023 05:53:39 -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 D8B613F762; Wed, 18 Oct 2023 05:52:57 -0700 (PDT) Date: Wed, 18 Oct 2023 13:52:55 +0100 From: Mark Rutland To: Andrea della Porta Cc: 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 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? Mark. > --- > arch/arm64/kernel/process.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c > index 657ea273c0f9..96832f1ec3ee 100644 > --- a/arch/arm64/kernel/process.c > +++ b/arch/arm64/kernel/process.c > @@ -601,7 +601,7 @@ unsigned long arch_align_stack(unsigned long sp) > #ifdef CONFIG_COMPAT > int compat_elf_check_arch(const struct elf32_hdr *hdr) > { > - if (!system_supports_32bit_el0()) > + if (!system_supports_32bit_el0() || !aarch32_enabled()) > return false; > > if ((hdr)->e_machine != EM_ARM) > -- > 2.35.3 >