From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BB33C433F5 for ; Tue, 28 Sep 2021 15:45:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 26B0961206 for ; Tue, 28 Sep 2021 15:45:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 26B0961206 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=4LjVOVKaG2LP69IxIGNuGwtGyoUQugn8TFB96AY36pA=; b=btxx0dV6dONYqQ N8qaaYcs45tsNLwrbrhqusV7xrMM6b8PM36GD4oc0WzRHwOcP6C83egkZ2hfCYkqyWTjdpdrvBl75 yFvdoI2u1+9yfjJDA7xZF3EjLu7YoFWHD42hAWzHzGd5T4zsuPFDVde0MP1RGKSyDI7GVbhpSGoBr AJQCA56W7I87fFb1ewZPKf1gCQn4rNysNLZwPt/zyuuV1Pl/WGQSl+tNHI9IIYhnHZCPwXJ4exUgW 3xbU3MFRnuyDNl1PIaoNPF0I/PLB8z7btkEa0/YTukOSd0t0axtpJ/epImEJkps/heR7OqZjJhBun owCBy6Pv5oJomZWc/Drg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVFGd-007ocf-Ex; Tue, 28 Sep 2021 15:43:39 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVFFD-007o8N-WF for linux-arm-kernel@lists.infradead.org; Tue, 28 Sep 2021 15:42:13 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF3796124B; Tue, 28 Sep 2021 15:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632843731; bh=ZBngGf1dNCnDo4MEWi+qXj5S4gy442NSnDPEpj1qxIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gvEvIEbKxhG1/nqcMJ2acjMJg+VTozcsnAQpEzJIRIye7Z3mjWSRbUej+JcyUFFbi sOw7qa4lQnYLWrNeZuMup7kd8GTc2WKFo+NyM3cBKA4qz0c0mG3Ra8sGDhzPU67SyJ eBcOsFPcXwha1NrbirPjSEmo2lUUYgWIZh2hu0nWmEeLFjKw3XVnlNws4yzkyTqmy2 CBrj/tEofya0JEY6YvYFjDwROrP+i58o/lNFWA7TloLj1ovnIDsJLMW2Lo3JOBajCi AJI2ojLvJxO7e9CVdiZd40PZbRyKTIxS2KRHEJPiPuBKPM3AfXb8bcVEVoH7zRSSKl 0wOowTnG5DbJA== From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Ard Biesheuvel , Linus Walleij , Nathan Chancellor , Nick Desaulniers , llvm@lists.linux.dev Subject: [PATCH 06/14] ARM: disallow CONFIG_THUMB with ARMv4 Date: Tue, 28 Sep 2021 17:41:35 +0200 Message-Id: <20210928154143.2106903-7-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210928154143.2106903-1-arnd@kernel.org> References: <20210928154143.2106903-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210928_084212_128660_AA94ACF1 X-CRM114-Status: GOOD ( 14.75 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann We can currently build a multi-cpu enabled kernel that allows both ARMv4 and ARMv5 CPUs, and also supports THUMB mode in user space. However, returning to user space in this configuration with the usr_ret macro requires the use of the 'bx' instruction, which is refused by the assembler: arch/arm/kernel/entry-armv.S: Assembler messages: arch/arm/kernel/entry-armv.S:937: Error: selected processor does not support `bx lr' in ARM mode arch/arm/kernel/entry-armv.S:960: Error: selected processor does not support `bx lr' in ARM mode arch/arm/kernel/entry-armv.S:1003: Error: selected processor does not support `bx lr' in ARM mode :2:2: note: instruction requires: armv4t bx lr While it would be possible to handle this correctly in principle, doing so seems to not be worth it, if we can simply avoid the problem by enforcing that a kernel supporting both ARMv4 and a later CPU architecture cannot run THUMB binaries. This turned up while build-testing with clang; for some reason, gcc never triggered the problem. Signed-off-by: Arnd Bergmann --- arch/arm/mm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 82aa990c4180..58afba346729 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -675,7 +675,7 @@ config ARM_PV_FIXUP config ARM_THUMB bool "Support Thumb user binaries" if !CPU_THUMBONLY && EXPERT - depends on CPU_THUMB_CAPABLE + depends on CPU_THUMB_CAPABLE && !CPU_32v4 default y help Say Y if you want to include kernel support for running user space -- 2.29.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel