Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp390683rdb; Thu, 19 Oct 2023 07:28:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPoBVoqSSfV74SHOOa0/shmmzJAzcymPIQtYs0VaM6zlu6YQfpMEY5+hDKGP/5jhPMNI3k X-Received: by 2002:a05:6a00:2494:b0:6be:7ee:9900 with SMTP id c20-20020a056a00249400b006be07ee9900mr2329845pfv.8.1697725696037; Thu, 19 Oct 2023 07:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697725696; cv=none; d=google.com; s=arc-20160816; b=C7TUMA/HsMraUG51eJtIFr+UtevuGhupWvnFBe7GwqhPiVuDbT3HKqG6xwE3E4g2l+ 8exdPHX0QXBl5nh3AGs3BwwGUbY3S7IpwsBzlOV5CSMcW1LoCebQhuZwcGX7TUT79N7c wvH9c3fK4HU/5qtz1TXMzMMatKL7GR3hiV72z4z7ruH2HJxLRAIZoEsNPrw+7jf+Utjs hAyEUZyBF3j/GnwJsNVGC+Hh/Ij2Sp/uDp3MSeFejk8btD6hQMSFQ2cNtbvlA2u2H9jj xes2Skmub0lkzX9FPLF2VixIkO00AjSU+CjTTK1umzdZrFq33vIUv3rOT2b64Jiq8v+R 1yGQ== 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:to:from:date; bh=Xsslb7zk90dRf/RMm17olgVqvyDvgioPIJVwf9W+tVw=; fh=OdjW/4U8oe4iGuSLr/ab8n2RdSSo4NdWc4IQEtjvYSI=; b=PgyXkuR2h8H+E3L7Y9BfR4Z1Sr8vySxkKOKj3Uxky/i+gVj+507BzsUcuBdJDNt5XY jaC6jHNgAexZ1wJVhHS25YtPedDr4aGiLzHNUb/yYpm048GwKC3UmBdAo11xLkm29Dq3 0mVslyOA/zShNIsdwz3DTZ+FdNE6QpUZQy5zuzGdoprExD8lgEYsyV9Cw0eIV+q6Kmmm 9HTowAHTJKonufSoGK1MTRBBM85lD9cGJfgvE0ED6XmMj4wztMpMIncnB+26ZWb0aflg RynYjKqIdSKKdPGkAafJL7fBFRMmqORIudVf+F6K2fruVzndyqbZcXbdVy8gpFBFGzU6 7qyQ== 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 h18-20020a056a001a5200b0068fe12b361dsi6397239pfv.249.2023.10.19.07.28.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 07:28:16 -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 9CC038242F4D; Thu, 19 Oct 2023 07:28:13 -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 S1346042AbjJSO2A (ORCPT + 99 others); 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: 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]); Thu, 19 Oct 2023 07:28:13 -0700 (PDT) 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.