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 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 7346BCA5FDD for ; Sat, 3 Oct 2026 10:46: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Subject:References:In-Reply-To:Message-Id:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LbsAV9q1BJGs+RkHnrhLC9PjudY2w8K1olk814fYDss=; b=i/tdiLctgjv06h6Ydb3nzeXXEC 8xggUvZEjwUa+2BkYCHBuvYfmdOmWtyjU40NgiUVVbIuS+OD5PSL12iXdSOvbWsCXQlxx2Ir2k8YH b8AwtFOZtHH0LkMEqSziEJQxRkDYbWn1jdbV+pb2VNyZbP5z/fFaDyrgICS4srxws3bl1Op8+ccLp fSxqcsXdI3Dq90agWdLu6aY0a1Ecrx5jN29H+BK6JRzC2jSRWiq3zYh8eL+Luq2IoW7fiCyH9xmw3 PQatHqTdZawC8CYiX/qjJXP2pQXfhOXpeD15cfEvyAxfPSmIrOId/39mUyTXdGbmMYa/d8dpFw5pB bCihKsvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xCxFa-0000000DNpa-2hUo; Sat, 03 Oct 2026 10:45:54 +0000 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xCxFV-0000000DNp8-4AWu for linux-arm-kernel@lists.infradead.org; Sat, 03 Oct 2026 10:45:52 +0000 Received: from ams-compute-02.internal (ams-compute-02.internal [10.64.2.62]) by mailfhigh.phl.internal (Postfix) with ESMTP id C6CFA14000B3 for ; Sat, 3 Oct 2026 06:45:46 -0400 (EDT) Received: from ams-imap-03 ([10.64.2.23]) by ams-compute-02.internal (MEProxy); Sat, 03 Oct 2026 06:45:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1791024337; x=1791110737; bh=LbsAV9q1BJGs+RkHnrhLC9PjudY2w8K1olk814fYDss=; b= YLqUkDSLnOO5W2+kr3uyDUJms2s0k1nxGPVMI587cpcNfbbJinuDNNKBZULzoO0k VR43naVRki4CFgPaAWlo57/uuv0KbDiEohnV/ZcwfUwR0sNZMirQQDgdS1DhFxYO v6DyvC99DtCCnCECQpVUujjesdTs15J5BUiSPxik6AmW9JpsEj6hXp3k2REeYf0h Zai7P928NxVEiiXatDLohLMLCdbBgSQqQ0ryzyAGCM+AMHlTC+C+wpFG4bQC394j 4SHNYj0TefUA8SFu0EfiJYkbdjSVYFHBdlmTLem1M0yqdvSrpSO1qXm2oRKRonOR nPrw/HpLL3NQ2SwfKMEGQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1791024337; x= 1791110737; bh=LbsAV9q1BJGs+RkHnrhLC9PjudY2w8K1olk814fYDss=; b=y osQDK5zING56/JOqlIJng/59CIrDqlEUjX4E5aeGvmHoZcR0CQC5lnwLmQc3f2NW Bh5aZilJtw+kppB/qC683hjzDcNmZrxyt00nplehAlHE58Icp4YqZTkd7eK9DbLz DclJOLn6A1VDzCVB2Tf6sjbQfjFwlyVaaRhe1/xqphs2SKPqeKTerazVYGz97sEh 9JB1i0XrPp33wqyIfA8ZHsgoh5UfZJXbIft1j++dFtKhXpW13+1ngi0Uy6Gs/KE0 ZCO2pN0y2sDxii2JBv/NZQkmP1nwwsehkBhGGcuDob1xPCdBRBFFWSdbYr2YzOV6 Do+pLTuLtvp4oTxdRc1ew== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-09-30; sw=lmtpprox; action=sign d=arndb.de a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1791024337; d=arndb.de; mf=PGFybmRAYXJuZGIuZGU+; rt=PGxpbnV4LWFybS1rZXJuZWxAbGlzdHMuaW5mcmFkZWFkLm9yZz4=; s=fm1:rsa-sha256:A9lZ1eLmOygq30AtXmrVsd5K7D6IhKtX0Mo/Fn4AAN6pTvL PCawS7JT9MLDB4BrxdPUr7mHst+sbAuoB67m+4mqTHIa4CeYJ4mO/B9cluPF4zWX 4V5BTvEIGsG0Uhw9Wf7BLBF/wdCDLvx2tlsDxrg1d5ldr0ztYY2zy7Sg5zGhtYyp TcAEUGrSizdsINHw0uNicVWkvlyaKZW0e/R10gbJkUpbXIfbIgvuq0KwLdU9Idp8 W1P10hAgG55VbR5P5i+rtCn/LzcBbakL+wn4f17al0NSeVE1h0D0eBYVzPB/6jwd KehfSo6XDqL09iW0Hzv+QoW4TYq2bYBi9REtbVg==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-09-30; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-transfer-encoding,content-type,date,feedback-id, from,in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:j/98+heVyS4qQGyuupafB+vXRsAdPzNdRaTDbkxL6S0=:zN8NwfOwTEFS4HgV6P2aMwyRYwUoOzd9vCuBgwE1hmQ=; X-ME-Sender: X-ME-Proxy-Cause: dmFkZTEbg1jSKr1GfSmMC2AVkUcfFCIwA/48EoLzIZqsaRTiyliBq5GUXDoG8OlN3hWdR+ OEoCH1iWD3Q6XYpoN9n/8kZ9MPqWLGQ/udEmnZSbPkpNZh2+bu0kE5lQgc8rFMxqJsrqIR gnlaHSqxSCzM3B5uSm2+4yJ26fS/OChfxe1+y2kn/yvPHuWFMeGzn7GPqgF688lRAEj8uJ jIMXjAqn2DFn88jbkSGLfIAzF9I/9Yd73/Ns54OHAWmmelfD/6rDlG2nwLJWBekaldgcO9 59F0L2sSVceLXlQehYTRjBnUyER5PgS9zM1W3X9qKCQ3LtibKaf39+pv7TFSTWKPvbjPRA jskfXeD4lBCzvwU12IUiMxxRL7xUuvoXjLytayh0P/q6Vgvvym+a/pAM9/YYU5ImasQxs5 RKoo1fIpbhwIqUc9nERpU9/218tv2aXj7QsdD7JV7iE1pgcbEtpqHgK54U90KeehazFHYN MtxGIwg1SSu1eR8gYoc/jBOZXy3KOJX2lTDWuBM+3DPK6buGSidzxGDFOGuL0ZANPgK244 0s+cOyxFmJS8crMbyk3FZ0qmJ+Tq7cqIFej63zAgf5gwDI3YaHxNvFjLAMheDyduozNKtb /iAQWSlkfDZB4yXU2nklwlVHw279+nx5FJrsV3j/NnxEgkk6/6OLFoeX/hpQ X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id 070D132A008A; Sat, 3 Oct 2026 06:45:28 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: A-PcLBAcdglw Date: Sat, 03 Oct 2026 12:45:07 +0200 From: "Arnd Bergmann" To: "Karl Mehltretter" , "Russell King" , "Miguel Ojeda" Cc: "Boqun Feng" , "Gary Guo" , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Danilo Krummrich" , "Daniel Almeida" , "Tamir Duberstein" , "Alexandre Courbot" , =?UTF-8?Q?Onur_=C3=96zkan?= , "Linus Walleij" , "Christian Schrefl" , "Bradley Morgan" , "Paul E. McKenney" , "Nathan Chancellor" , "Nick Desaulniers" , "Bill Wendling" , "Justin Stitt" , linux-arm-kernel@lists.infradead.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: <33197b82-3eff-4c87-b370-c677ca31a02a@app.fastmail.com> In-Reply-To: <20261003093827.77857-3-kmehltretter@gmail.com> References: <20261003093827.77857-1-kmehltretter@gmail.com> <20261003093827.77857-3-kmehltretter@gmail.com> Subject: Re: [PATCH 2/2] ARM: rust: Enable Rust support for ARMv5TE Content-Type: text/plain Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261003_034551_297248_D4141460 X-CRM114-Status: GOOD ( 19.49 ) 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 On Sat, Oct 3, 2026, at 11:38, Karl Mehltretter wrote: > HAVE_RUST is currently selected for CPU_32v7 only. The > arm-unknown-linux-gnueabi target used for ARMv7 emits ARMv6 > instructions (+v6), so it cannot be used for ARMv5. Use rustc's > built-in armv5te-unknown-linux-gnueabi target instead. It keeps the > Linux EABI (no short enums, unlike the -none-eabi targets) and is > soft-float and strict-align. > > Kernels that also contain ARMv4 or ARMv4T CPUs are built for the > lowest architecture and stay excluded. CPU_32v5 also covers the ARMv5T > ARM1020. C code is already built with -march=armv5te there, so Rust > matches. None of this makes sense to me: The target should not control the instruction set, that is what the -march= flag is needed for. Does that not get passed for Rust? If an ARMv7 kernel includes ARMv6 instructions, that is broken on ARMv8 CPUs that are lacking the CP15 barriers and swp style atomics, so that needs to be fixed. I don't see what part of rust would depend on ARMv5 instructions, it should just work on ARMv4T as well, though ARMv4 may be trickier because missing bx instructions etc. > ============================================== > -``arm`` Maintained ARMv7 Little Endian only. > +``arm`` Maintained ARMv5TE and ARMv7, Little Endian only. Here you exclude ARMv6K and ARMv8-A-aarch32... > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index ffbc7f386131..f6b14d9f0e1f 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -138,7 +138,7 @@ config ARM > select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE > select HAVE_REGS_AND_STACK_ACCESS_API > select HAVE_RSEQ > - select HAVE_RUST if CPU_LITTLE_ENDIAN && CPU_32v7 && !KASAN > + select HAVE_RUST if CPU_LITTLE_ENDIAN && (CPU_32v7 || (CPU_32v5 && > !CPU_32v4T && !CPU_32v4)) && !KASAN but here you allow it, so I think one of them should change, and you need to better explain what the dependency on !CPU_32v4T is about, and what happens for an ARMv6K-only kernel, compared to a combined ARMv6K+ARMv7-A one. > KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) -Wa,$(arch-y) $(tune-y) > -include $(srctree)/arch/arm/include/asm/unified.h -msoft-float > +ifdef CONFIG_CPU_32v5 > +KBUILD_RUSTFLAGS += --target=armv5te-unknown-linux-gnueabi > +else > KBUILD_RUSTFLAGS += --target=arm-unknown-linux-gnueabi > +endif This looks wrong, the choice between armv5 and armv7 should work the same way as the choice between armv6 and armv7/v8, if I read the rustc docs correctly, this should be using the target-cpu= argument on the generic arm-unknown-linux-gnueabi target. Arnd