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: 13432978 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AAE5DC004C0 for ; Mon, 23 Oct 2023 14:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8qoBwRn4qdSLhv4Q3Zf2DhWWo5BCPl4nmmV4AmbOsZc=; b=PY0um9SJ3h+AT/ yE1hoVR7U9WL6MrP1g3EL1fuSO5nDktpsWKrnzwhdwxdBDRdajglp3Of4cBZqeb3AL3K3AQBHfP7y Q6eH6Ol78Ytcn69Wfy65PsuIZfzFftDOB+rQwMFY2qHtT2XmbyIHXm2lut6iVOAXZgvKB1g5NzD/0 fiY+TOjXY5TCu/1g3oFMYUFqiYBag96uGfaxTca7ea7tBcQTsK6kMcrkkd/zkhRjEDa2cNrTxw+N+ TzPDArPPrFcGz53A8CUd4c1sdJiNTKJsLjZOdrsBbDLPs0IhDeZAU1DwyJxn747ULFz6mh5rUdCLk QAr12rC6FRwtKSvKyQgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1quw8c-007b9w-2a; Mon, 23 Oct 2023 14:42:38 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1quw8W-007azW-1B for linux-arm-kernel@lists.infradead.org; Mon, 23 Oct 2023 14:42:34 +0000 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-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231023_074232_580590_DEF332F9 X-CRM114-Status: GOOD ( 11.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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)