Received: by 2002:ab2:5d18:0:b0:1ef:7a0f:c32d with SMTP id j24csp177593lqk; Sat, 9 Mar 2024 05:38:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWcgtF54+LWch4/robFCDkGeHRvW3NvuUjMoA2mx0aVmmWEGLazaSIGtvzU3hr61CuzZOy6u8HaHxCdiUjsBgz8FyoKkzgRoBWqABM/gw== X-Google-Smtp-Source: AGHT+IGDtBwXfjGxMmxYrVYZZ5ToKKy6rZe+fjsU05t9e6NmPpo3BqsWA+6+iAYCgZka9ZWuzZS5 X-Received: by 2002:a05:6808:274b:b0:3c1:f5cd:1bdd with SMTP id eh11-20020a056808274b00b003c1f5cd1bddmr2224207oib.51.1709991521963; Sat, 09 Mar 2024 05:38:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709991521; cv=pass; d=google.com; s=arc-20160816; b=sqai4OKBrQwKwp0jYvix/FchzdByxpSZdp+1xC84XAu3InnodL394gA3mNZshMz/mn dH1ukRrjbzvVR0zgI5gF46I9LMTfMjMxrzUiMCvi1RHUaiByh96gXNR+rL/3yqWpPnx/ zVWA7QdbQdq2wYezZccJOvKFz2L9q5sPm9MBEkJOVLwsGzYV5wJHUT+9s02VYGZofudN MQaodqrwNblVYNepDm4S/61wlHOkceQDgJNfd2LRcy79HY4IBKpxOquAzesGeLk2klXb iXWONEleHjEKawdC9pTXT/keUCzBIvT65dx0q3mW7DOB6Lo1Iz7YCFDgqg2nTCEKbyBR 9QxA== 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=oVlw3N9AhH/PLoArG1DKrZ7dauygJdFjbuS03V7TccM=; fh=hevvz3SjA01ZtPFHwdeL5M4ia8ooYKb7Iq6mLmatHzE=; b=sPorGvpQpUsL3CYXYXQaG8eGvi7Leczm9HlDHsyBMcGW5bNm63GyXVge8ALiBCwOC5 HiSb1u+SwVA5qlwkZdPA+hYgQRovb2aFXOi6CVNUN1t3Lsz/bIyVz+Lx1wdQH2pdJhic DyN8pjcG41gn1U7wk46GNom7VODocYvz5V8rtlNeqmU852XA+dI1EsUtm/GofZ163pVw cuz0MIF0cMl/myAn1Zpzkoa1G6iSGIYPkQCOw2BLy+rWAHVH+FNuZAuXOzIB4yuNCP/4 Mcg65laYziZcZ1iwtbZR+BS9bkDQwG0c5n2gYSmX3HSyXSHgvr6km1ZXTkQe3Us7lRRr 3hBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MreaFjVz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-97909-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97909-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h9-20020a63e149000000b005dc8f60ce09si1509965pgk.7.2024.03.09.05.38.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 05:38:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97909-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MreaFjVz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-97909-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97909-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3E532B20F0C for ; Sat, 9 Mar 2024 13:38:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5735E3CF5E; Sat, 9 Mar 2024 13:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MreaFjVz" 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 4DB8338F97; Sat, 9 Mar 2024 13:38:29 +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=1709991510; cv=none; b=ALewSJOfo/jPEMILLBM8DRFwMbDPXEl0Q/Hq5ZRReEyfp/2m4x2RyMZqE2LwDVyDIf254EMctWydYBPQbejJz17epQ2HrNEJXcJw0GQPIZKU41K0IzSQtVoVH8ikBCAs12B32X9PpDj7LMWIEXS2v3emlZqyE/YODub3C15EpB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709991510; c=relaxed/simple; bh=LJZLWpPMSIn8dh1JkUG1cS5BSZ5kFeQDO1hkDSXzojg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rUIEIm5XIxSC9RU2BCYRgdgBTZCZeQ9gfPDgl3EBJoJSO2t6oZ27ZCIJiG4OFqDlrIE73x7BjrJxQeIbb2ioySwnUEZLJMqE++qRYLklqkJKU3EDGk3Brh/IKD8qGpt/Y817oc7fAJ0LB90YKRDkm0J5WW/sCOYAgn+PiCysXI8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MreaFjVz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDB36C433F1; Sat, 9 Mar 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709991509; bh=LJZLWpPMSIn8dh1JkUG1cS5BSZ5kFeQDO1hkDSXzojg=; h=From:To:Cc:Subject:Date:From; b=MreaFjVzERgzC1DJyk9D02nAQuCvD0WxKjTNyED8mTOcCiuQCcy+6MvGMlgRDGLax 6Mp3YZBW82RNm0qirCokhpPjL6inkshCMQ+yA+cDdQt8azb3mAwJ8yrWF9aT60WIzb Nrara0XF/h/MD86pilXcELMp0zoeWN2LkenjJwv/96m8VDs4MAqvSDFQimEsL+M/vv VWQ+OKkTTV4yzSBB4ZVa9KoBWEW4Yf13iYo6ZvD3PKyHBCwtR/KIutN3o9I/Z+BEh3 rbayphEYuJ5REzWjyg6E6LxbyoTAJAei4SWeXku6YjRZ8Det8e3gKR67KFdxenW4+T SRd8pHoVpNWmQ== From: Miguel Ojeda To: Linus Torvalds Cc: Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] Rust for v6.9 Date: Sat, 9 Mar 2024 14:38:17 +0100 Message-ID: <20240309133817.335439-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Linus, This is the next round of the Rust support. All the commits have been in linux-next for more than a week. A small conflict with the arm64 pull expected, as well as a trivial one with the mm-nonmm. Both are resolved in linux-next in the rust-next merge. No changes to the C side. You will likely get Rust support for arm64, the first kselftest for Rust and a couple improvements for Rust net PHY through their respective trees as well. LoongArch, RISC-V and VFS pull requests could carry something too, but probably on the next one. Please pull for v6.9 -- thanks! Cheers, Miguel The following changes since commit 6613476e225e090cc9aad49be7fa504e290dd33d: Linux 6.8-rc1 (2024-01-21 14:11:32 -0800) are available in the Git repository at: https://github.com/Rust-for-Linux/linux.git tags/rust-6.9 for you to fetch changes up to 768409cff6cc89fe1194da880537a09857b6e4db: rust: upgrade to Rust 1.76.0 (2024-02-29 22:18:05 +0100) ---------------------------------------------------------------- Rust changes for v6.9 Another routine one in terms of features. We got two version upgrades this time, but in terms of lines, 'alloc' changes are not very large. Toolchain and infrastructure: - Upgrade to Rust 1.76.0. This time around, due to how the kernel and Rust schedules have aligned, there are two upgrades in fact. These allow us to remove two more unstable features ('const_maybe_uninit_zeroed' and 'ptr_metadata') from the list, among other improvements. - Mark 'rustc' (and others) invocations as recursive, which fixes a new warning and prepares us for the future in case we eventually take advantage of the Make jobserver. 'kernel' crate: - Add the 'container_of!' macro. - Stop using the unstable 'ptr_metadata' feature by employing the now stable 'byte_sub' method to implement 'Arc::from_raw()'. - Add the 'time' module with a 'msecs_to_jiffies()' conversion function to begin with, to be used by Rust Binder. - Add 'notify_sync()' and 'wait_interruptible_timeout()' methods to 'CondVar', to be used by Rust Binder. - Update integer types for 'CondVar'. - Rename 'wait_list' field to 'wait_queue_head' in 'CondVar'. - Implement 'Display' and 'Debug' for 'BStr'. - Add the 'try_from_foreign()' method to the 'ForeignOwnable' trait. - Add reexports for macros so that they can be used from the right module (in addition to the root). - A series of code documentation improvements, including adding intra-doc links, consistency improvements, typo fixes... 'macros' crate: - Place generated 'init_module()' function in '.init.text'. Documentation: - Add documentation on Rust doctests and how they work. ---------------------------------------------------------------- Alice Ryhl (6): rust: sync: add `CondVar::notify_sync` rust: time: add msecs to jiffies conversion rust: sync: add `CondVar::wait_timeout` rust: sync: update integer types in CondVar rust: kernel: add reexports for macros rust: kernel: stop using ptr_metadata feature Charalampos Mitrodimas (1): rust: sync: `CondVar` rename "wait_list" to "wait_queue_head" Dirk Behme (2): docs: rust: Move testing to a separate page docs: rust: Add description of Rust documentation test as KUnit ones Miguel Ojeda (3): rust: upgrade to Rust 1.75.0 kbuild: mark `rustc` (and others) invocations as recursive rust: upgrade to Rust 1.76.0 Mika Westerberg (1): rust: bindings: Order headers alphabetically Obei Sideg (1): rust: types: add `try_from_foreign()` method Thomas Bertschinger (1): rust: module: place generated init_module() function in .init.text Valentin Obst (12): rust: kernel: fix multiple typos in documentation rust: error: improve unsafe code in example rust: ioctl: end top-level module docs with full stop rust: kernel: add srctree-relative doclinks rust: str: use `NUL` instead of 0 in doc comments rust: str: move SAFETY comment in front of unsafe block rust: kernel: unify spelling of refcount in docs rust: kernel: mark code fragments in docs with backticks rust: kernel: add blank lines in front of code blocks rust: kernel: add doclinks rust: kernel: remove unneeded doclink targets rust: locked_by: shorten doclink preview Wedson Almeida Filho (1): rust: add `container_of!` macro Yutaro Ohno (1): rust: str: implement `Display` and `Debug` for `BStr` Documentation/process/changes.rst | 2 +- Documentation/rust/general-information.rst | 24 ---- Documentation/rust/index.rst | 1 + Documentation/rust/testing.rst | 135 ++++++++++++++++++++ Makefile | 4 +- rust/Makefile | 48 +++---- rust/alloc/alloc.rs | 12 +- rust/alloc/boxed.rs | 34 +++-- rust/alloc/collections/mod.rs | 1 + rust/alloc/lib.rs | 9 +- rust/alloc/raw_vec.rs | 77 +++++++++--- rust/alloc/vec/into_iter.rs | 16 ++- rust/alloc/vec/mod.rs | 81 +++++++++--- rust/bindings/bindings_helper.h | 5 +- rust/kernel/allocator.rs | 2 +- rust/kernel/error.rs | 10 +- rust/kernel/init.rs | 22 ++-- rust/kernel/ioctl.rs | 6 +- rust/kernel/lib.rs | 37 +++++- rust/kernel/str.rs | 193 +++++++++++++++++++++++++++-- rust/kernel/sync.rs | 5 +- rust/kernel/sync/arc.rs | 30 +++-- rust/kernel/sync/condvar.rs | 110 ++++++++++++---- rust/kernel/sync/lock.rs | 19 ++- rust/kernel/sync/lock/mutex.rs | 3 +- rust/kernel/sync/lock/spinlock.rs | 5 +- rust/kernel/sync/locked_by.rs | 7 +- rust/kernel/task.rs | 24 +++- rust/kernel/time.rs | 20 +++ rust/kernel/types.rs | 22 ++++ rust/kernel/workqueue.rs | 78 ++++++------ rust/macros/module.rs | 7 +- scripts/Makefile.build | 8 +- scripts/Makefile.host | 2 +- scripts/min-tool-version.sh | 2 +- 35 files changed, 809 insertions(+), 252 deletions(-) create mode 100644 Documentation/rust/testing.rst create mode 100644 rust/kernel/time.rs