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 8CC65C7EE29 for ; Fri, 9 Jun 2023 18:36:11 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vkCo74YFbptSJhAU2avcidk/BJihDXMIzZMoy6Ce21U=; b=wa7/+l2rJXpJ4U QkM6qd7mDEGXqm/0jiAoxg+90J5tzRdP2COz9RHXPMlNgpeUxTan4uBln4FjSljcc7LCXbeyDcSk1 5J6Qk9Sse/CkPFVPz5ydTg+O79xT+ej+Nr+DJjGccyB0s3XJ736ZK7h2Q6HRddcn+85kOh82dadPC 6opppAURpGh4p1e0le3daRHrofwWYBJhGyJjqcATdB67BpmSGhW0X7reHwFcoux7vtbDTwrT5Nz0X +g9CcTWtVAAG3xUXktOxHnBJWtOUgi+WpKqFMdyOgN+n5qPbcbznjWb88/Y+5JvYi9uXfmOeiauw0 Ywymm9odQT82GoWPkI4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7gxg-00DsKi-3D; Fri, 09 Jun 2023 18:35:49 +0000 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7gxd-00DsJl-1p for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2023 18:35:46 +0000 Received: by mail-qv1-xf2b.google.com with SMTP id 6a1803df08f44-6263b2526a0so14414086d6.2 for ; Fri, 09 Jun 2023 11:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686335740; x=1688927740; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=aMqDuHi9kmJ3Qek78LMK5/MKxnLaKZ049yl4ayvgcPc=; b=YTk3Fflc2RXkfNKmwbTgbaL/CQdXkcCH6o4nSZGt6G9RYt4axYw1lKpU88svEwCcu8 8mEIrmT8WwxjS6bxoQwmLP0N7+R76cjUzCB7BKiYCzcfpYn2plO3YRZlMSLxte/x3ZH6 Xrh3ecsgtMDYn2Ssx7Ho59yXXd3mLs9hyVEAvsY9YNwEI6BMzKcV9Nt2GCE34ImKUv+v TfukKIOdNRdMNMdVEo9/2a8FPUmxf+0M1DmUjrGnpeNDydGlJj7M18UcXAmfEzKZez84 sLCddVsbqr0pvWo3HYA/E79/M9fDsZkuet23AGumeINe0Fd5HZurd1M9eM6OQWDJkEWH LtmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686335740; x=1688927740; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aMqDuHi9kmJ3Qek78LMK5/MKxnLaKZ049yl4ayvgcPc=; b=Rk0PX7ydrC3ttNOEHhIQBr1w3tmq8DREo50GgaRdYb9wD4Mi2iZQnvFEElRCrpwMhN tYKBY9QTuMdUZwM3iRLlkbRHHCu1Z62xf4qvmREyEWJSm8ywVBhxrE3yl9Rb7se5kiEV RnqzFXCRPWdepKZPqiGG92molrk5wlzWK0i8UhEA5Hb1HWA6jmMWp7XDbucTw5gu28mB he3rxAJ5qBAkCsz7OA3vqASsgRPdIDdbJdiLQ43zJcqGGSOMZ2XRzlsjh78WLUzlYZJ0 WN2qdMRE8rSN6yE6+kWt55QQtxE3he4eVCm9OaZj9wRPD+oUElhTHF1UboP9hceU5A++ vVXQ== X-Gm-Message-State: AC+VfDzF0AuRUTti0a4kwmdC7TMjcsxToqXULjsNLjQDIt5ALezqTVDV +mQ1cq9elen+fG5QjwdG/r4= X-Google-Smtp-Source: ACHHUZ6v99kOekoOm2uFiBT5KfZuHXhGL5KxxDc/hkzIPbuEvDQclTmhMOJq/BpbQIJSbKVfgUgx1A== X-Received: by 2002:a05:6214:268e:b0:621:78a:dd84 with SMTP id gm14-20020a056214268e00b00621078add84mr2859042qvb.47.1686335740190; Fri, 09 Jun 2023 11:35:40 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id e15-20020a0caa4f000000b0061b721f27b3sm1316712qvb.123.2023.06.09.11.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 11:35:39 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 3461227C0054; Fri, 9 Jun 2023 14:35:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 09 Jun 2023 14:35:39 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtkedguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeeuohhq uhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuggftrf grthhtvghrnhephedugfduffffteeutddvheeuveelvdfhleelieevtdeguefhgeeuveei udffiedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieelvdeghedt ieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghilhdrtghomhesfh higihmvgdrnhgrmhgv X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 9 Jun 2023 14:35:38 -0400 (EDT) Date: Fri, 9 Jun 2023 11:34:05 -0700 From: Boqun Feng To: Jamie Cunliffe Cc: linux-arm-kernel@lists.infradead.org, rust-for-linux@vger.kernel.org, Miguel Ojeda , Catalin Marinas , Will Deacon , steve.capper@arm.com, Asahi Lina Subject: Re: [PATCH v2 0/3] Rust enablement for AArch64 Message-ID: References: <20230606145606.1153715-1-Jamie.Cunliffe@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230606145606.1153715-1-Jamie.Cunliffe@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_113545_609017_C4FB92CA X-CRM114-Status: GOOD ( 26.02 ) 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 On Tue, Jun 06, 2023 at 03:56:03PM +0100, Jamie Cunliffe wrote: > Enable Rust support for the AArch64 architecture. > With the following diff on the whole series: diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 4a2c807d65db..4562a8173e90 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -41,7 +41,7 @@ KBUILD_CFLAGS += -mgeneral-regs-only \ KBUILD_CFLAGS += $(call cc-disable-warning, psabi) KBUILD_AFLAGS += $(compat_vdso) -KBUILD_RUSTFLAGS += --target aarch64-unknown-none -C target-feature="-neon,-fp-armv8" +KBUILD_RUSTFLAGS += --target aarch64-unknown-none -C target-feature="-neon" KBUILD_CFLAGS += $(call cc-option,-mabi=lp64) KBUILD_AFLAGS += $(call cc-option,-mabi=lp64) I've built with RUST=y and boot it in one ARM64 Hyper-V VM. Also I tried load/unload rust_minimal and rust_print modules, they all worked. Tested-by: Boqun Feng Regards, Boqun > The first patch enables the basic building of Rust for AArch64. Since > v1 this has been rewritten to avoid the use of a target.json file for > AArch64 and use the upstream rustc target definition. x86-64 still > uses the target.json approach though. > > The second patch enables the PAC ret and BTI options in the Rust build > flags to match the options that are used when building C. > > The third patch disables Rust support when building for big > endian. Currently there is no `aarch64_be-unknown-none` target which > would allow this. Support for this can come at a later time either by > using the target.json approach, or upstreaming a new target definition > to rustc (preferred). We also might be able to use the > `aarch64_be-unknown-linux-gnu` target, however, this can be done at a > later time. It's worth noting that in Makefile.clang, it's > recommended for arch/{arch}/Makefile to set the endianness based on > arguments rather than the target triple. It's currently not possible > to do this with rustc, a different target triple has to be used. > > > Jamie Cunliffe (3): > arm64: rust: Enable Rust support for AArch64 > arm64: rust: Enable PAC support for Rust. > arm64: Restrict Rust support to little endian only. > > Documentation/rust/arch-support.rst | 1 + > Makefile | 1 - > arch/arm64/Kconfig | 1 + > arch/arm64/Makefile | 4 ++++ > arch/x86/Makefile | 1 + > rust/Makefile | 6 +++++- > scripts/Makefile | 5 +++-- > scripts/generate_rust_target.rs | 4 +++- > 8 files changed, 18 insertions(+), 5 deletions(-) > > -- > 2.30.2 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel