From patchwork Mon Oct 23 14:42:19 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: 13432981 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 2404EC004C0 for ; Mon, 23 Oct 2023 14:43:06 +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: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:In-Reply-To:References: List-Owner; bh=G6QdC7/iqXh9graJWl7w+6G81tV1RozQJaUFrC1291M=; b=KwKbo9aIJmmUlR mTVzAEXpAYHvaQ4qSVdOmVYJenM7YrHtD4HQbqyvUPh+bz60VvqfVu7XrrLM69I8RbxfeYyXKmssV JFqXMeP5et3jiQ/nWXBHM/2FgAAsDiGSHYT70fnsxY78/CJ/BG6RIvh+TutYxG/62/Ym1kh2QNjOk RrcIiTL5cTTqkzPLXLx0Dwtpc6wvKyFHkMGr8vYsHGoaGV8ba0XUwkSMHkd9+eqcGxRR2AnHhesrG JfqZQjqEdA0LuzKwTIQEEMWR3YGhJ60Tldj9P8gtJyq+Bo5Q+bSwHSvELI6+y7dBGzGFeVQ0RS2+U Yb/izUsA3HtvHnuo/2tA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1quw8d-007bAa-1M; Mon, 23 Oct 2023 14:42:39 +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-007azY-18 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 2E1112188D; Mon, 23 Oct 2023 14:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1698072145; 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; bh=RTYsroAWljaROpiVAPyNscGJ0JLNhWtas14NGofBG64=; b=G7aViXm79Su4cvNDxWqYhqYC+UISHnBFJqW32gY5/ALtclMStDPw4XdGDbh56qLoHOaAi3 qCoARrOQDg5H9DMh5BEnGIJeOc8/fxbzF5DsUKGDzc/Xi1n+ZRMZQogEpFef06FKaAxRuw 3YNIN/1FEp7FV+mgzOZen1xSBcpZJKI= 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 10F63139C2; Mon, 23 Oct 2023 14:42:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id aADMAVGGNmW5dgAAMHmgww (envelope-from ); Mon, 23 Oct 2023 14:42:25 +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 0/4] arm64: Make Aarch32 compatibility enablement optional at boot Date: Mon, 23 Oct 2023 16:42:19 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [1.30 / 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)[]; 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_545776_C4C086CA X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. 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 This is the second attempt of the patch, reviewed as follows: * Reworked subject and description to avoid the term 'emulation' and to address generically 'exceptions' instead of 'syscalls' (mark.rutland) * Moved aarch32_enabled() check inside system_supports_32bit_el0() (mark.rutland) * Renamed AARCH32_EMULATION_DEFAULT_DISABLED to AARCH32_SUPPORT_DEFAULT_DISABLED (mark.rutland) * Fixed a compilation Warning about missing function prototype Closes: https://lore.kernel.org/oe-kbuild-all/202310230423.r2U4Lqr8-lkp@intel.com/ This is just for completeness since other possible solutions have been proposed that could be better suited, see for example: https://lkml.kernel.org/linux-fsdevel/20210916131816.8841-1-will@kernel.org/ and followups. So, this patchset is just for reference, may be useful in the future if some kind of exploit is found to bypass the 32bit process enablement check (letting a process call 32bit syscalls) and nothing better has been proposed meanwhile. Andrea della Porta (4): arm64: Introduce aarch32_enabled() arm64/process: Make loading of 32bit processes depend on aarch32_enabled() arm64/entry-common: Make Aarch32 exceptions' availability depend on aarch32_enabled() arm64: Make Aarch32 support boot time configurable .../admin-guide/kernel-parameters.txt | 7 ++++ arch/arm64/Kconfig | 9 +++++ arch/arm64/include/asm/cpufeature.h | 20 +++++++++-- arch/arm64/include/asm/exception.h | 7 ++++ arch/arm64/kernel/entry-common.c | 33 +++++++++++++++++-- 5 files changed, 71 insertions(+), 5 deletions(-)