Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2136013lqe; Tue, 9 Apr 2024 10:25:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVhkOsK3YSkjnO23hwL0IRD+qb1voZWt93X5Kikt5w5o2Cf8amxzg6zu+dll2Mqca3oKqfCO+eaaCoe9KLMSjjTIEHOKNpyxoPfSMf6Rw== X-Google-Smtp-Source: AGHT+IFMQOHHZko+gBhAY2Tf0XKfgf05QhdI1vJc+Ty9jZKyyllgJpWTAt2H1DHCySEaSZm8LVgU X-Received: by 2002:a05:6a00:848:b0:6ed:1c7:8c5e with SMTP id q8-20020a056a00084800b006ed01c78c5emr248191pfk.12.1712683531282; Tue, 09 Apr 2024 10:25:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712683531; cv=pass; d=google.com; s=arc-20160816; b=D6iNC2G7w/mpegDzOtQb0m5RtQePr6pySMllhZKA5BkozeZguluGBh54xOQh9dZ7dY UPUMTnxRZ1AXRzVLWZ6jDAgEZH6FftGHfus49jpFJcdn5afv7YaXiHWOe2iD05RHZlxS 8Ydgj2zR83t8DVKU3kjOWNSAu1AJacw6+UOx9Jb3EkoTBpCIDziAs34hnW9/D3nBMN4q TuaUn7jw1vStIlvIHkmnTk+KtMRLfYe7pOGgzVddeUY2LgatS1+eQ4d+3qc8tG9pxCto Eit0f1wVepDlC+NBiQtl74+++gbreHCIfHbyWiMy+8lwpm9KZ7O/YfsXByV34vxSZFCP TutQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=VnR5dt+CaXehwcJR0IwJU/gaigGuMb61/iBS6i+39hE=; fh=CANnI0NLD2Dc1T1tm0n+DYH7a85D0SPpN/ENOAOdVMM=; b=nqGmkBcGh2nEcI2Gk+iPeU31EypXPtDHQYeFOn9uGX7s0p/dH7degvW0KW+BmxtdfS PDSm1dJUzcOgnGwUzPauQqu9ElniBngMqzXn6Pr2P7DhRC5E7hJg/FUkmaq6h4/QzCIT IoSnTWbpFtPHV3In4Vv337E0O8A29I/AzJ/1VN3+C6axGBx5x09IOLTrUMQ3iFd+5EEQ djQGsrw/Mjtsb4HLz8g9eWDF9l0/6NPkpU7d8lHVXUh1basknlHSFlWtCAeQk0Z61ogm KE70loGUth0d5eGiDdX207nZerQZZKJDJkjBPoZxoXQ7Tn36pyvU391Af5JhWrqPSVny o6fw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtJpo53N; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137397-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ld6-20020a056a004f8600b006ead1509816si204999pfb.341.2024.04.09.10.25.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 10:25:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137397-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtJpo53N; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137397-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CEE832843E1 for ; Tue, 9 Apr 2024 17:25:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB9F315622A; Tue, 9 Apr 2024 17:25:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FtJpo53N" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0039015539C; Tue, 9 Apr 2024 17:25:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712683523; cv=none; b=Grjw7cVjP9G5cigW+z0b6FhOA4k2wIiElafH3vRM9QKReS/N+YuLo0Gr1tPDgALt3+5MZkcBXb3UUH7JKGLV/WgdMD7nS2kmOkvL8/Njh+vMfvvITw+xR/usuv90S7q1WSA8OgylhFhXqJ+i4fC6jUvrqkqJGf7lbD7RvhgAh3M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712683523; c=relaxed/simple; bh=Z7G26vJ7drjhQBqY768GVlza2RGDKJV6xJzSOxOV+Ac=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=kX2gZ4xSL2bW/H4rLFPZw/DVt5NeII/X3Rm2t+Ox4aUZX1h+M6rJGXOMNeMX5Qy5Rybc8UF8lPwx95gt70XgZC+EvR65MvT3nvy7e7tCCPlN8Bc/AJT7jPYMGxFhAdiK5nQVD01t12thuKrIiLLLCZHHD8RcpvYYhRQjL5g1eeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FtJpo53N; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1450CC433F1; Tue, 9 Apr 2024 17:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712683522; bh=Z7G26vJ7drjhQBqY768GVlza2RGDKJV6xJzSOxOV+Ac=; h=From:To:Cc:Subject:Date:From; b=FtJpo53NtrsGi0x7/1DjifT6PbQ15bJ7LWhF0g/Hx+vT8eKEcS/ZCx2Cmb6mVgzja lg3s6b0HjfMK0I0K4/ZtBW1quMJTMna+WqxR1MYR2SHNTn22vT8g3flWIUHSZANvoo oxhp32sdJ1ETlfK+9F3s2LgUX3Ma5N0sF4yvXLyiteN/CJ08MyYSHQXX+3AioLSs9l YAnf84ILVJr6jsi0v9CUycXXvcJRIUdY670pH4cZPAJe4cA9tQ1HRgVLR9bksHmQJE ONVIS5XbnArcoDXpnGjALyOIgJapzffN9acXMW4Jj9CccObKivFpP18BqHp7L2yvz1 hK9TMdkBLarDw== From: Conor Dooley To: linux-riscv@lists.infradead.org Cc: conor@kernel.org, Conor Dooley , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Nathan Chancellor , Nick Desaulniers , rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v3 0/1] RISC-V: enable rust Date: Tue, 9 Apr 2024 18:25:15 +0100 Message-ID: <20240409-unsaddle-skittle-c93eb77732bb@spud> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2917; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=jBURk0m47eQdKCm4nsBSeG1Pgaujx2S3yr8amWAalEA=; b=owGbwMvMwCFWscWwfUFT0iXG02pJDGmilb/fpZtkTudRfTNRPWJyUuKBlfHWbe1qz/7HOzzr+ vWEQXprRykLgxgHg6yYIkvi7b4WqfV/XHY497yFmcPKBDKEgYtTACbSz8Dw38UquCjqvY73ndsO zGF/f/u//lDq2+rdPOmcC8OpKLXYCob/aa1ad8KXBRkkiD6OjTqRZCgS/Wy3hI6AxpPb937Uusz gBgA= X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Conor Dooley I've intentionally not turned on the gcc support, as discussed on v1. I've also switched over to using the target, but it is a bit heavier than the one arm64 seems to be using. RISC-V has fewer targets available and this was the closest. I preserved the redzone disabling, just moved into the Makefile. Any comment from Gary or the LLVM lads on the target would be great I think: https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/spec/targets/riscv64imac_unknown_none_elf.rs arm64 is using: https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs I was gonna send this yesterday, but found out last minute I had invalid code in the target generation script. The kernel test robot had given my branch the global all-clear - the rust coverage with all the "depends on !FOO" must really limit the build coverage. I built for x86 with rust enabled locally this time to make sure.. As this as lifted from the state of the Rust-for-Linux tree, the commit messages from there cannot be preserved, so these patches have commit messages that I wrote. I've tested this on Icicle, and the modules seem to work as expected. Unfortunately there appear to be implicit 32-bit divisions (or similar) in core Rust code, so, as in the downstream Rust-for-Linux tree, Rust is only enabled for 64-bit. Thanks, Conor. Changes in v3: - Use a builtin target and modify it in kbuild - Drop the kCFI patch, that's been merged independently Changes in v2: - Rebase, since a good bit of time has passed! - Add the extra patch, disabling when CFI_CLANG is enabled. Changes in v1: - rebase on v6.3-rc1 - resort the `um` entry in the arch-support table while adding RISC-V to it - drop 32-bit bits - have another crack at assigning authorship Changes in RFC-RESEND: - fix the asymmetrical additions in the Makefile bits - add cc-cover to my git send-email command... CC: Miguel Ojeda CC: Alex Gaynor CC: Wedson Almeida Filho CC: Boqun Feng CC: Gary Guo CC: Björn Roy Baron CC: Jonathan Corbet CC: Paul Walmsley CC: Palmer Dabbelt CC: Nathan Chancellor CC: Nick Desaulniers CC: rust-for-linux@vger.kernel.org CC: linux-doc@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: linux-riscv@lists.infradead.org CC: llvm@lists.linux.dev Miguel Ojeda (1): RISC-V: enable building 64-bit kernels with rust support Documentation/rust/arch-support.rst | 1 + arch/riscv/Kconfig | 1 + arch/riscv/Makefile | 7 +++++++ scripts/generate_rust_target.rs | 6 ++++++ 4 files changed, 15 insertions(+) -- 2.43.0