Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5008275pxb; Tue, 28 Sep 2021 08:43:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqc4JR2ys6GCa+jVHf2UOrszFWpA7y2oueN06/TUeRdEi3+4zKNl0c3uSCB9lUseSm8ZDx X-Received: by 2002:a17:90a:bf82:: with SMTP id d2mr559421pjs.201.1632843825598; Tue, 28 Sep 2021 08:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632843825; cv=none; d=google.com; s=arc-20160816; b=BO5D+EkMZk8iT0jfp7Jq0mb+x2yJMi5MbG2zfdQmofnnsarLS1KKAlq1w8vuy8sHmc 8E3yqJzWwGJggf9f0pjJZzInylKml2wzywFpYlqdtWoLFOWuf3DZgODNXRNHvPK2jBuX hOJrCBRxRhUAHU5tZd3YZzSsP/+UJw4XU8kcbbDFLX3jC90YdP6f4IxmA5uzawClE1LC E0KoJl742XtnYYhZxph+QdLM0/lC3swb9TJa8DWy1w2nFzSOmN4ujwvpUPdF2MFD7Zzp 6LowZySnObYemhxuzo9VDg+a4NysdRgfKt1xYnsQzKAVW+/gWdv0V4LSsTgk1TSYYPX7 Ettg== 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=uXuAsj/gdhCCsy827uOSQgPYxLMzbBMtOUet+a2QiSk=; b=NP+k8s9jYREY7Ek8pcXSAvCty0W/WpmO51cDkIJEPcSgN3xRhcaBJJZB8eYJGZWRNK FjIsRzd2at1rEnR/PmQVRjpxfeqkIRX12LpGByJvwwoTZur2hag41zG12PfSYc+QhhrM d1Bxcup/a7oe0bOuSiYpv1qXNbZGS79LnrelYqStiJoAuM5EOB/bCV2BcDiRWBlxQOF3 rpC3YpUu4t/MFKJNBSmLEFX6R6XFipHyXwKIOHnP+HmpZGdBkWsu0jxYOhleQzx2bPDw DF10Reoboz3G8fQKIOBc8yOiCkZff6clZBmgl/TfPThxwPwUWccxBoePqEw92niVfFQ8 69MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gvEvIEbK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s66si25215648pfb.288.2021.09.28.08.43.32; Tue, 28 Sep 2021 08:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gvEvIEbK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241648AbhI1Pnz (ORCPT + 99 others); Tue, 28 Sep 2021 11:43:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:60608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241747AbhI1Pnu (ORCPT ); Tue, 28 Sep 2021 11:43:50 -0400 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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