Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3771811rdg; Wed, 18 Oct 2023 05:53:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdNxqFauX/0+UDc0KaSjYlqc4hODAS9VfUuB9/GKGdLCicFioaO6q+v9Zh2in/Ykr2nC9O X-Received: by 2002:a05:6830:3107:b0:6cd:8c8:1654 with SMTP id b7-20020a056830310700b006cd08c81654mr1477213ots.2.1697633599769; Wed, 18 Oct 2023 05:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697633599; cv=none; d=google.com; s=arc-20160816; b=jwdxHV6IpDG8u5Uk/+NmFIlbcC39W3a7oplGWnZvH82RfXEmCXflfu5enpU9BEBeXG Qv9gH2gzkVME9ZApelzrgeFfDR5K6w/NGWli/bPm69pROM2mJaB52DyHl26m6j6J60GF zPv5kl91dHxteqvn/O8yzQE09kOWBq9KOM/BzMcRzsyw+rBmQQjqUdjkVt1QrySEwDjc /x3VGjLDacuEx+mugKkb2pMsbFlzrzO76DjG+i9pxJb+7a6uUJdfRQ+J/9xoBPXxEdws nQatnzE+E4pupD+P0prxUhdNKA1GpjiUQRtOOAP94YGM+6q9xXiA0jf4VkB63kWvabOQ STPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=16Yz9pOOB36VkVBezMLJXUgO9+DkwObubwwwBm8e6ms=; fh=hCPobr24DmA9maJD9j0iJQVs2bF3FJ0EU8dYUrAN60Y=; b=q3uobkjqo75sXSyrMRx/qc07+oFbLmYEAr2ngsV9CGuY1XQz8rvS5ew+cJY4FkPXBZ LVCdjNmObxkGKxy/i/3b2jsNqensotQIEV7CFwLa7tJ3JpLD0/yGzKNRlYK4qXRk5wLM 2koLF+s/BxeRbgmsYzt5Gsp/K9uix3ypkgOf9Vc95oXysLIUbCNeJoJP9xMq5BYZYwyA vQJIQHuesi1RzGMR5N82QikzTItMC4qQgcH8yfHWdwo7HnC3vJwDt7hx6guYZlxQfs3A KgEQLUby/4gGk2zF59y0Ry6ZK2oDuOzmQbbXoMqCn/NoTctCI2n6G21gWGjKM8+E5ZNZ Vkvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id d20-20020a056a0024d400b0068ff3a3c9d0si4137145pfv.91.2023.10.18.05.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 05:53:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 012778029C75; Wed, 18 Oct 2023 05:53:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbjJRMxH (ORCPT + 99 others); Wed, 18 Oct 2023 08:53:07 -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: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 18 Oct 2023 05:53:15 -0700 (PDT) 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 >