From patchwork Mon Oct 23 14:42:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea della Porta X-Patchwork-Id: 156923 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1345044vqx; Mon, 23 Oct 2023 07:44:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFX43QbOUwWb7T8EsB+imZyATmPyAsMS2EZ+gNWiWZAPew5bPbNs6dw/RGJ1gwYUEtfyvib X-Received: by 2002:a05:6358:7295:b0:168:cdee:155e with SMTP id w21-20020a056358729500b00168cdee155emr6322227rwf.3.1698072257908; Mon, 23 Oct 2023 07:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698072257; cv=none; d=google.com; s=arc-20160816; b=dGhaZ39TYlrcLCLBO7vl7UA/OWYQ2AFXv+EttydGZXLUBImicUQ5YxE9d35Eu4LS7C ABabz6qFRHlGGg2/GqSyh7uRCaUBdBFG7MVeA6XFTqzn6DgWSNiIYkBR6DVOMSkY4J+r nKvuaOFJYc/nbikt6jjXLhRS8Zh+ZwaPV1Ogg+KQS/2UZ5ktqfJ0pvqvz3izD0ez2YYN o9hhWVc/sTXRGQ5Y69V5qU9JQ5dXV9kKLT06EQaXTHr7HWkXUH+oRrPZdln3wTOaW0mp MjS5BlaSy9o+AKAzXzYEljHTzPz9qMamf/TKIhCAIBNUOMqZkjFCk01gupH+21OjUs7o kFqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ptLMqv6iaACOOpI3/GceNmmJmtBYsEsFiVZhrERtJcU=; fh=Mt283RDXEoutdgZ0ioYgkrGAUpbBAwJ7lRTaJXIGXS8=; b=atA9N/Ox2cOgcaBEFHRrCOd38eyI46v6cgx8I2uoSqnwvcqG3VBCMmKfjB7qPZL3J0 AG+hUGM5IQSKAHpiRitgtmIg+sEW33KUvXgJkUKNhfsKiP7wmrvItzGXnwFocMZlsr9O dhpBH4LnwyW4goqR6ORH2PqYwQLSqCshHl4MEi9XTWoVeXAow8BjBkFPizkH0dgpFsJn /SkhL+Kbvfvj/H29JVxJeGk00rlQP4R4BO77m4NNby/+QChhmioOpfBpnRtOozi68dG1 7AggOiep3a8gVSB1tt9b+eL7M8dItvp0JeoY4Gfp+Jt6uO80ocaEH+8thmpnUIDMVF6L Ozzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=HpFvhsGR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cb21-20020a056a02071500b0057777451a91si7019047pgb.581.2023.10.23.07.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 07:44:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=HpFvhsGR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D94548061B45; Mon, 23 Oct 2023 07:44:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233746AbjJWOoH (ORCPT + 27 others); Mon, 23 Oct 2023 10:44:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233807AbjJWOnq (ORCPT ); Mon, 23 Oct 2023 10:43:46 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C7CA1FD3 for ; Mon, 23 Oct 2023 07:42:28 -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 9011B2188F; Mon, 23 Oct 2023 14:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1698072146; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ptLMqv6iaACOOpI3/GceNmmJmtBYsEsFiVZhrERtJcU=; b=HpFvhsGRqrkWuoKHGLQpCHaNEeX0hCZU8Ns5O630i2hGaSX8F5c1wRpCrav8t6nLksfcoJ 6UwowYxJJBXRuTNz7bgCFJuvAzm8bfwtOP5kEueXj2qutCxLwiu8lLt+JXWoyQv5JNT7nd +UVGsPwwPFbHAXjdujBBcGqmrw6XfvY= 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 73BD2139C2; Mon, 23 Oct 2023 14:42:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WPj+GVKGNmXBdgAAMHmgww (envelope-from ); Mon, 23 Oct 2023 14:42:26 +0000 From: Andrea della Porta To: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: nik.borisov@suse.com, arnd@arndb.de, mark.rutland@arm.com, Andrea della Porta Subject: [PATCH v2 2/4] arm64/process: Make loading of 32bit processes depend on aarch32_enabled() Date: Mon, 23 Oct 2023 16:42:21 +0200 Message-ID: <2d105c9d8184686fe5aadf646bea7f46ec68ff8b.1698069331.git.andrea.porta@suse.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -2.70 X-Spamd-Result: default: False [-2.70 / 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)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-3.00)[-1.000]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_SEVEN(0.00)[8]; MID_CONTAINS_FROM(1.00)[]; FORGED_SENDER(0.30)[andrea.porta@suse.com,aporta@suse.de]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.10)[andrea.porta@suse.com,aporta@suse.de]; RCVD_TLS_ALL(0.00)[] X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 23 Oct 2023 07:44:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780557815526868527 X-GMAIL-MSGID: 1780557815526868527 Major aspect of Aarch32 support is the ability to load 32bit processes. That's currently decided (among others) by compat_elf_check_arch() and system_supports_32bit_el0(). Make the macro use aarch32_enabled() to decide if Aarch32 compat is enabled before loading a 32bit process. Signed-off-by: Andrea della Porta --- arch/arm64/include/asm/cpufeature.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index 1180d68daaff..778f2f3b2c7d 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -679,8 +679,9 @@ static inline bool system_supports_32bit_el0(void) { u64 pfr0 = read_sanitised_ftr_reg(SYS_ID_AA64PFR0_EL1); - return static_branch_unlikely(&arm64_mismatched_32bit_el0) || - id_aa64pfr0_32bit_el0(pfr0); + return (static_branch_unlikely(&arm64_mismatched_32bit_el0) || + id_aa64pfr0_32bit_el0(pfr0)) && + aarch32_enabled(); } static inline bool system_supports_4kb_granule(void)