Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp394762rdb; Thu, 19 Oct 2023 07:33:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2CF0C+RK2mbjSFsF63zA4rLqsZgJawd6Irn2u1bvkY8yT9trO3CoOfSUa2916OD1p7IgS X-Received: by 2002:a05:6a21:4887:b0:16b:8488:babf with SMTP id av7-20020a056a21488700b0016b8488babfmr1956089pzc.35.1697726020170; Thu, 19 Oct 2023 07:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697726020; cv=none; d=google.com; s=arc-20160816; b=JJ/oZRo7AXVlhO2H3CGp/pXZcbSIb9nq65uJdDKeHLikuKIPVC9/qcrvXtz4ArXTnr xGcnpaZG+CTKNN4/lbADfRPYKqjpS/fvYrlQuhHweOJtM7Ws0eXsw06IMQFWZzdWBCkA sYpHxq1niY9rf37WYNaAiZLRbQ5iyFHndeWCis6QQqdT5M/H9N8hcrsibQid4SZzcvbB wbGOFXZvCfV0LAz4qAUY5H0kWUSUHloJ5z0QhcqtHXKH+PtaR5oojW4WJpnbgBW88Jb8 VEky3bHH+1+fFaJ5Hr8A7qXDovCpMegfwqEGD/soKWnv7weCQObRqn8WqhuOyXY618mQ JKIg== 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:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=rFw3BFzNgR6Y8k558tesln7UDDifhhF8E5WljQRYxcQ=; fh=YElFkqDxIzKQQanb5bRwHpEwnm6kPOq9iTKP1g+/qK8=; b=jqK2vwDxD5CdR4UcmoQjCuOYLFFNcY3OfQfkq4LZYxTMpsYE09qPiLB44u6S9P5FDn bElp0PEkjTv2gtgcMaTAzzJzEhHbXe5LIApV3SLsMitkR/IyNVu3pxeBb8E2yrvGQl51 j2KK0BIvQa9qPYEDfNmKjbCRC9Mgb2C9ZYxJ+37JSMxe9AFfDKWNnDLEnhUXCyzHxslZ 1j5TRCtpStbJTmdxUpmwFd3N4GDG9X7V2r2+kMdggIUWyl1AcKm40FHq2zStZp29dy5Q G9PXN1rECwlh3JpPkKx0wCepCvPGmYhuAkvBvKjod7lgh03Eyv3S6ZLqZXX9w2ZXUD+I W2+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="v/1+7Fbs"; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b8-20020a6567c8000000b005775e17f552si4227481pgs.249.2023.10.19.07.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 07:33:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="v/1+7Fbs"; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3E2B781143C1; Thu, 19 Oct 2023 07:33:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235479AbjJSOdP (ORCPT + 99 others); Thu, 19 Oct 2023 10:33:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235474AbjJSOdD (ORCPT ); Thu, 19 Oct 2023 10:33:03 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3448710DB for ; Thu, 19 Oct 2023 07:32:30 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 86DE0210EA; Thu, 19 Oct 2023 14:32:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1697725948; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rFw3BFzNgR6Y8k558tesln7UDDifhhF8E5WljQRYxcQ=; b=v/1+7FbsqBDKWQ3FAyisSAjNJeTOrWHvujOxCqm3mJwCttfa2BywKyEl8DRQslHrGC3lCA 97+QPqS0jsZIharafjjHAVLch8nm+Ql0ie93i59BL6d6NibAovvOrGXkT4lgEujlymHDuV aXlBWQ7tkbskew7UjucmCqkgYAlOM6g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1697725948; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rFw3BFzNgR6Y8k558tesln7UDDifhhF8E5WljQRYxcQ=; b=m1xYoHlrTf8kbA7y/12fwXuyP5obCIUUbghMHUbPelnrgIMpWAUgMXWwyuyb7Ka0Vw876q FlHak9+BbY2ER9Ag== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6C5B3139C2; Thu, 19 Oct 2023 14:32:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 98VPGPw9MWVBBAAAMHmgww (envelope-from ); Thu, 19 Oct 2023 14:32:28 +0000 Date: Thu, 19 Oct 2023 16:32:27 +0200 From: Andrea della Porta To: Mark Rutland Cc: 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: Mail-Followup-To: Mark Rutland , Andrea della Porta , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, nik.borisov@suse.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -8.20 X-Spamd-Result: default: False [-8.20 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-3.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.60)[81.82%] X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 19 Oct 2023 07:33:35 -0700 (PDT) On 15:27 Thu 19 Oct , Mark Rutland wrote: > 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. Many thanks for the explanation, then inserting aach32_enabled() in system_supports_32bit_el0() is the way to go. Andrea