<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/rust/kernel, branch v6.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2024-01-11T21:05:41Z</updated>
<entry>
<title>Merge tag 'rust-6.8' of https://github.com/Rust-for-Linux/linux</title>
<updated>2024-01-11T21:05:41Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-01-11T21:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b6964fe2398cb8939c3d4fc6960a6be93687305d'/>
<id>urn:sha1:b6964fe2398cb8939c3d4fc6960a6be93687305d</id>
<content type='text'>
Pull Rust updates from Miguel Ojeda:
 "Another routine one in terms of features. In terms of lines, this time
  the 'alloc' version upgrade is less prominent, given that it was
  fairly small (and we did not have two upgrades)

  Toolchain and infrastructure:

   - Upgrade to Rust 1.74.1

     The patch release includes a fix for an ICE that the Apple AGX GPU
     driver was hitting

   - Support 'srctree'-relative links in Rust code documentation

   - Automate part of the manual constants handling (i.e. the ones not
     recognised by 'bindgen')

   - Suppress searching builtin sysroot to avoid confusion with
     installed sysroots, needed for the to-be-merged arm64 support which
     uses a builtin target

   - Ignore '__preserve_most' functions for 'bindgen'

   - Reduce header inclusion bloat in exports

  'kernel' crate:

   - Implement 'Debug' for 'CString'

   - Make 'CondVar::wait()' an uninterruptible wait

  'macros' crate:

   - Update 'paste!' to accept string literals

   - Improve '#[vtable]' documentation

  Documentation:

   - Add testing section (KUnit and 'rusttest' target)

   - Remove 'CC=clang' mentions

   - Clarify that 'rustup override' applies to build directory"

* tag 'rust-6.8' of https://github.com/Rust-for-Linux/linux:
  docs: rust: Clarify that 'rustup override' applies to build directory
  docs: rust: Add rusttest info
  docs: rust: remove `CC=clang` mentions
  rust: support `srctree`-relative links
  rust: sync: Makes `CondVar::wait()` an uninterruptible wait
  rust: upgrade to Rust 1.74.1
  rust: Suppress searching builtin sysroot
  rust: macros: improve `#[vtable]` documentation
  rust: macros: update 'paste!' macro to accept string literals
  rust: bindings: rename const binding using sed
  rust: Ignore preserve-most functions
  rust: replace &lt;linux/module.h&gt; with &lt;linux/export.h&gt; in rust/exports.c
  rust: kernel: str: Implement Debug for CString
</content>
</entry>
<entry>
<title>rust: support `srctree`-relative links</title>
<updated>2023-12-21T19:54:17Z</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2023-12-15T23:54:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bc2e7d5c298a86f2aa759cabe46f66f862fca3b3'/>
<id>urn:sha1:bc2e7d5c298a86f2aa759cabe46f66f862fca3b3</id>
<content type='text'>
Some of our links use relative paths in order to point to files in the
source tree, e.g.:

    //! C header: [`include/linux/printk.h`](../../../../include/linux/printk.h)
    /// [`struct mutex`]: ../../../../include/linux/mutex.h

These are problematic because they are hard to maintain and do not support
`O=` builds.

Instead, provide support for `srctree`-relative links, e.g.:

    //! C header: [`include/linux/printk.h`](srctree/include/linux/printk.h)
    /// [`struct mutex`]: srctree/include/linux/mutex.h

The links are fixed after `rustdoc` generation to be based on the absolute
path to the source tree.

Essentially, this is the automatic version of Tomonori's fix [1],
suggested by Gary [2].

Suggested-by: Gary Guo &lt;gary@garyguo.net&gt;
Reported-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Closes: https://lore.kernel.org/r/20231026.204058.2167744626131849993.fujita.tomonori@gmail.com [1]
Fixes: 48fadf440075 ("docs: Move rustdoc output, cross-reference it")
Link: https://lore.kernel.org/rust-for-linux/20231026154525.6d14b495@eugeo/ [2]
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Link: https://lore.kernel.org/r/20231215235428.243211-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: sync: Makes `CondVar::wait()` an uninterruptible wait</title>
<updated>2023-12-21T19:54:17Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2023-12-14T20:04:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0a7f5ba73e57eaf7f2e5589d26bbe9bf6754c542'/>
<id>urn:sha1:0a7f5ba73e57eaf7f2e5589d26bbe9bf6754c542</id>
<content type='text'>
Currently, `CondVar::wait()` is an interruptible wait, and this is
different than `wait_event()` in include/linux/wait.h (which is an
uninterruptible wait). To avoid confusion between different APIs on the
interruptible/uninterruptible, make `CondVar::wait()` an uninterruptible
wait same as `wait_event()`, also rename the old `wait()` to
`CondVar::wait_interruptible()`.

Spotted-by: Tiago Lam &lt;tiagolam@gmail.com&gt;
Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Tiago Lam &lt;tiagolam@gmail.com&gt;
Link: https://lore.kernel.org/r/20231214200421.690629-1-boqun.feng@gmail.com
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: net::phy add module_phy_driver macro</title>
<updated>2023-12-15T09:35:50Z</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@gmail.com</email>
</author>
<published>2023-12-13T00:42:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2fe11d5ab35daee5e8f5ecf49767ddd3204fdfa9'/>
<id>urn:sha1:2fe11d5ab35daee5e8f5ecf49767ddd3204fdfa9</id>
<content type='text'>
This macro creates an array of kernel's `struct phy_driver` and
registers it. This also corresponds to the kernel's
`MODULE_DEVICE_TABLE` macro, which embeds the information for module
loading into the module binary file.

A PHY driver should use this macro.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Reviewed-by: Trevor Gross &lt;tmgross@umich.edu&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rust: core abstractions for network PHY drivers</title>
<updated>2023-12-15T09:35:50Z</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@gmail.com</email>
</author>
<published>2023-12-13T00:42:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f20fd5449ada3872dcd67aca397f0e27ca2e8ad6'/>
<id>urn:sha1:f20fd5449ada3872dcd67aca397f0e27ca2e8ad6</id>
<content type='text'>
This patch adds abstractions to implement network PHY drivers; the
driver registration and bindings for some of callback functions in
struct phy_driver and many genphy_ functions.

This feature is enabled with CONFIG_RUST_PHYLIB_ABSTRACTIONS=y.

This patch enables unstable const_maybe_uninit_zeroed feature for
kernel crate to enable unsafe code to handle a constant value with
uninitialized data. With the feature, the abstractions can initialize
a phy_driver structure with zero easily; instead of initializing all
the members by hand. It's supposed to be stable in the not so distant
future.

Link: https://github.com/rust-lang/rust/pull/116218

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rust: macros: improve `#[vtable]` documentation</title>
<updated>2023-12-14T19:14:01Z</updated>
<author>
<name>Benno Lossin</name>
<email>benno.lossin@proton.me</email>
</author>
<published>2023-10-26T20:19:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=88c2e1169f5f0c2ccdd0a001e4447a1b0da2b661'/>
<id>urn:sha1:88c2e1169f5f0c2ccdd0a001e4447a1b0da2b661</id>
<content type='text'>
Traits marked with `#[vtable]` need to provide default implementations
for optional functions. The C side represents these with `NULL` in the
vtable, so the default functions are never actually called. We do not
want to replicate the default behavior from C in Rust, because that is
not maintainable. Therefore we should use `build_error` in those default
implementations. The error message for that is provided at
`kernel::error::VTABLE_DEFAULT_ERROR`.

Signed-off-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@samsung.com&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Finn Behrens &lt;me@kloenk.dev&gt;
Link: https://lore.kernel.org/r/20231026201855.1497680-1-benno.lossin@proton.me
[ Wrapped paragraph to 80 as requested and capitalized sentence. ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: bindings: rename const binding using sed</title>
<updated>2023-12-14T19:14:01Z</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2023-11-04T14:56:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=743766565dc0bdeedf7db419500031c7bdc84033'/>
<id>urn:sha1:743766565dc0bdeedf7db419500031c7bdc84033</id>
<content type='text'>
Currently, for `const`s that bindgen doesn't recognise, we define a
helper constant with

    const &lt;TYPE&gt; BINDINGS_&lt;NAME&gt; = &lt;NAME&gt;;

in `bindings_helper.h` and then we put

    pub const &lt;NAME&gt;: &lt;TYPE&gt; = BINDINGS_&lt;NAME&gt;;

in `bindings/lib.rs`. This is fine since we currently only have 3
constants that are defined this way, but is going to be more annoying
when more constants are added since every new constant needs to be
defined in two places.

This patch changes the way we define constant helpers to

    const &lt;TYPE&gt; RUST_CONST_HELPER_&lt;NAME&gt; = &lt;NAME&gt;;

and then use `sed` to postprocess Rust code generated by bindgen to
remove the distinct prefix, so users of the `bindings` crate can refer
to the name directly.

Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@samsung.com&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Link: https://lore.kernel.org/r/20231104145700.2495176-1-gary@garyguo.net
[ Reworded for typos. ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: kernel: str: Implement Debug for CString</title>
<updated>2023-12-12T23:13:49Z</updated>
<author>
<name>Asahi Lina</name>
<email>lina@asahilina.net</email>
</author>
<published>2023-07-14T09:19:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c3f41b00307f796756ec494b90c9e238800a0ff8'/>
<id>urn:sha1:c3f41b00307f796756ec494b90c9e238800a0ff8</id>
<content type='text'>
Make it possible to use a `CString` with the `pr_*` macros directly. That
is, instead of:

    pr_debug!("trying to open {:?}\n", &amp;*filename);

we can now write:

    pr_debug!("trying to open {:?}\n", filename);

Signed-off-by: Asahi Lina &lt;lina@asahilina.net&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Link: https://lore.kernel.org/r/20230714-cstring-debug-v1-1-4e7c3018dd4f@asahilina.net
[ Reworded to use Alice's commit message as discussed. ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'wq-for-6.7-rust-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq</title>
<updated>2023-10-31T06:35:48Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-10-31T06:35:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=639409a4ac8e1578ce34715338c6a4ddf9941294'/>
<id>urn:sha1:639409a4ac8e1578ce34715338c6a4ddf9941294</id>
<content type='text'>
Pull workqueue rust bindings from Tejun Heo:
 "Add rust bindings to allow rust code to schedule work items on
  workqueues.

  While the current bindings don't cover all of the workqueue API, it
  provides enough for basic usage and can be expanded as needed"

* tag 'wq-for-6.7-rust-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  rust: workqueue: add examples
  rust: workqueue: add `try_spawn` helper method
  rust: workqueue: implement `WorkItemPointer` for pointer types
  rust: workqueue: add helper for defining work_struct fields
  rust: workqueue: define built-in queues
  rust: workqueue: add low-level workqueue bindings
  rust: sync: add `Arc::{from_raw, into_raw}`
</content>
</entry>
<entry>
<title>Merge tag 'rust-6.7' of https://github.com/Rust-for-Linux/linux</title>
<updated>2023-10-31T06:30:49Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-10-31T06:30:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=455cdcb45f8fa9e7c70273e7bec0537ff02d5247'/>
<id>urn:sha1:455cdcb45f8fa9e7c70273e7bec0537ff02d5247</id>
<content type='text'>
Pull rust updates from Miguel Ojeda:
 "A small one compared to the previous one in terms of features. In
  terms of lines, as usual, the 'alloc' version upgrade accounts for
  most of them.

  Toolchain and infrastructure:

   - Upgrade to Rust 1.73.0

     This time around, due to how the kernel and Rust schedules have
     aligned, there are two upgrades in fact. They contain the fixes for
     a few issues we reported to the Rust project.

     In addition, a few cleanups indicated by the upgraded compiler or
     possible thanks to it. For instance, the compiler now detects
     redundant explicit links.

   - A couple changes to the Rust 'Makefile' so that it can be used with
     toybox tools, allowing Rust to be used in the Android kernel build.

  x86:

   - Enable IBT if enabled in C

  Documentation:

   - Add "The Rust experiment" section to the Rust index page

  MAINTAINERS:

   - Add Maintainer Entry Profile field ('P:').

   - Update our 'W:' field to point to the webpage we have been building
     this year"

* tag 'rust-6.7' of https://github.com/Rust-for-Linux/linux:
  docs: rust: add "The Rust experiment" section
  x86: Enable IBT in Rust if enabled in C
  rust: Use grep -Ev rather than relying on GNU grep
  rust: Use awk instead of recent xargs
  rust: upgrade to Rust 1.73.0
  rust: print: use explicit link in documentation
  rust: task: remove redundant explicit link
  rust: kernel: remove `#[allow(clippy::new_ret_no_self)]`
  MAINTAINERS: add Maintainer Entry Profile field for Rust
  MAINTAINERS: update Rust webpage
  rust: upgrade to Rust 1.72.1
  rust: arc: add explicit `drop()` around `Box::from_raw()`
</content>
</entry>
</feed>
