]> git.dujemihanovic.xyz Git - linux.git/commitdiff
Merge tag 'rust-6.12' of https://github.com/Rust-for-Linux/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 25 Sep 2024 17:25:40 +0000 (10:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 25 Sep 2024 17:25:40 +0000 (10:25 -0700)
Pull Rust updates from Miguel Ojeda:
 "Toolchain and infrastructure:

   - Support 'MITIGATION_{RETHUNK,RETPOLINE,SLS}' (which cleans up
     objtool warnings), teach objtool about 'noreturn' Rust symbols and
     mimic '___ADDRESSABLE()' for 'module_{init,exit}'. With that, we
     should be objtool-warning-free, so enable it to run for all Rust
     object files.

   - KASAN (no 'SW_TAGS'), KCFI and shadow call sanitizer support.

   - Support 'RUSTC_VERSION', including re-config and re-build on
     change.

   - Split helpers file into several files in a folder, to avoid
     conflicts in it. Eventually those files will be moved to the right
     places with the new build system. In addition, remove the need to
     manually export the symbols defined there, reusing existing
     machinery for that.

   - Relax restriction on configurations with Rust + GCC plugins to just
     the RANDSTRUCT plugin.

  'kernel' crate:

   - New 'list' module: doubly-linked linked list for use with reference
     counted values, which is heavily used by the upcoming Rust Binder.

     This includes 'ListArc' (a wrapper around 'Arc' that is guaranteed
     unique for the given ID), 'AtomicTracker' (tracks whether a
     'ListArc' exists using an atomic), 'ListLinks' (the prev/next
     pointers for an item in a linked list), 'List' (the linked list
     itself), 'Iter' (an iterator over a 'List'), 'Cursor' (a cursor
     into a 'List' that allows to remove elements), 'ListArcField' (a
     field exclusively owned by a 'ListArc'), as well as support for
     heterogeneous lists.

   - New 'rbtree' module: red-black tree abstractions used by the
     upcoming Rust Binder.

     This includes 'RBTree' (the red-black tree itself), 'RBTreeNode' (a
     node), 'RBTreeNodeReservation' (a memory reservation for a node),
     'Iter' and 'IterMut' (immutable and mutable iterators), 'Cursor'
     (bidirectional cursor that allows to remove elements), as well as
     an entry API similar to the Rust standard library one.

   - 'init' module: add 'write_[pin_]init' methods and the
     'InPlaceWrite' trait. Add the 'assert_pinned!' macro.

   - 'sync' module: implement the 'InPlaceInit' trait for 'Arc' by
     introducing an associated type in the trait.

   - 'alloc' module: add 'drop_contents' method to 'BoxExt'.

   - 'types' module: implement the 'ForeignOwnable' trait for
     'Pin<Box<T>>' and improve the trait's documentation. In addition,
     add the 'into_raw' method to the 'ARef' type.

   - 'error' module: in preparation for the upcoming Rust support for
     32-bit architectures, like arm, locally allow Clippy lint for
     those.

  Documentation:

   - https://rust.docs.kernel.org has been announced, so link to it.

   - Enable rustdoc's "jump to definition" feature, making its output a
     bit closer to the experience in a cross-referencer.

   - Debian Testing now also provides recent Rust releases (outside of
     the freeze period), so add it to the list.

  MAINTAINERS:

   - Trevor is joining as reviewer of the "RUST" entry.

  And a few other small bits"

* tag 'rust-6.12' of https://github.com/Rust-for-Linux/linux: (54 commits)
  kasan: rust: Add KASAN smoke test via UAF
  kbuild: rust: Enable KASAN support
  rust: kasan: Rust does not support KHWASAN
  kbuild: rust: Define probing macros for rustc
  kasan: simplify and clarify Makefile
  rust: cfi: add support for CFI_CLANG with Rust
  cfi: add CONFIG_CFI_ICALL_NORMALIZE_INTEGERS
  rust: support for shadow call stack sanitizer
  docs: rust: include other expressions in conditional compilation section
  kbuild: rust: replace proc macros dependency on `core.o` with the version text
  kbuild: rust: rebuild if the version text changes
  kbuild: rust: re-run Kconfig if the version text changes
  kbuild: rust: add `CONFIG_RUSTC_VERSION`
  rust: avoid `box_uninit_write` feature
  MAINTAINERS: add Trevor Gross as Rust reviewer
  rust: rbtree: add `RBTree::entry`
  rust: rbtree: add cursor
  rust: rbtree: add mutable iterator
  rust: rbtree: add iterator
  rust: rbtree: add red-black tree implementation backed by the C version
  ...

14 files changed:
1  2 
Documentation/rust/quick-start.rst
MAINTAINERS
Makefile
arch/Kconfig
arch/arm64/Kconfig
arch/riscv/Kconfig
init/Kconfig
mm/kasan/kasan_test_c.c
rust/Makefile
rust/kernel/alloc/box_ext.rs
rust/kernel/lib.rs
rust/macros/module.rs
scripts/Makefile.build
scripts/Makefile.lib

Simple merge
diff --cc MAINTAINERS
index 7bfef98226d9250955216243c34252f42e97f87b,77b395476a80a7c8e47a9268b19dabd324cc4ebb..098d13ab6b3428f4e65f59b3f007883d323db674
@@@ -20142,8 -19912,9 +20142,9 @@@ R:   Boqun Feng <boqun.feng@gmail.com
  R:    Gary Guo <gary@garyguo.net>
  R:    Björn Roy Baron <bjorn3_gh@protonmail.com>
  R:    Benno Lossin <benno.lossin@proton.me>
 -R:    Andreas Hindborg <a.hindborg@samsung.com>
 +R:    Andreas Hindborg <a.hindborg@kernel.org>
  R:    Alice Ryhl <aliceryhl@google.com>
+ R:    Trevor Gross <tmgross@umich.edu>
  L:    rust-for-linux@vger.kernel.org
  S:    Supported
  W:    https://rust-for-linux.com
diff --cc Makefile
Simple merge
diff --cc arch/Kconfig
Simple merge
Simple merge
index b6d515db869bfcf0f4af05f7286a017b5ffd9a8b,6d9234216c69225f54f3a5e9d1918b74340470d5..22dc5ea4196ce19c7f2282c4160f92a02b69a2c7
@@@ -206,9 -200,15 +206,16 @@@ config RISC
        select THREAD_INFO_IN_TASK
        select TRACE_IRQFLAGS_SUPPORT
        select UACCESS_MEMCPY if !MMU
 +      select USER_STACKTRACE_SUPPORT
        select ZONE_DMA32 if 64BIT
  
+ config RUSTC_SUPPORTS_RISCV
+       def_bool y
+       depends on 64BIT
+       # Shadow call stack requires rustc version 1.82+ due to use of the
+       # -Zsanitizer=shadow-call-stack flag.
+       depends on !SHADOW_CALL_STACK || RUSTC_VERSION >= 108200
  config CLANG_SUPPORTS_DYNAMIC_FTRACE
        def_bool CC_IS_CLANG
        # https://github.com/ClangBuiltLinux/linux/issues/1817
diff --cc init/Kconfig
Simple merge
Simple merge
diff --cc rust/Makefile
index f168d2c98a15f1748de6830ccf92a738ab73d57b,dd76dc27d666716bcee61012c1a20fbe56d7c8f0..b5e0a73b78f3e58fc8fb8c9fab8fb5792406c6d8
@@@ -305,7 -306,7 +306,7 @@@ $(obj)/bindings/bindings_helpers_genera
  quiet_cmd_exports = EXPORTS $@
        cmd_exports = \
        $(NM) -p --defined-only $< \
-               | awk '/ (T|R|D|B) / {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$3}' > $@
 -              | awk '$$2~/(T|R|D)/ && $$3!~/__cfi/ {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$3}' > $@
++              | awk '$$2~/(T|R|D|B)/ && $$3!~/__cfi/ {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$3}' > $@
  
  $(obj)/exports_core_generated.h: $(obj)/core.o FORCE
        $(call if_changed,exports)
Simple merge
index 58ed400198bf2ee5c301713fb024ade5935cd19e,f10b06a78b9d5c6261503e044d0b3465f99bd7e3..22a3bfa5a9e96a1dd9cf76bd34a8d992458870b4
@@@ -43,7 -44,7 +44,8 @@@ pub mod net
  pub mod page;
  pub mod prelude;
  pub mod print;
 +pub mod sizes;
+ pub mod rbtree;
  mod static_assert;
  #[doc(hidden)]
  pub mod std_vendor;
Simple merge
Simple merge
Simple merge