Merge tag 'rust-6.2' of https://github.com/Rust-for-Linux/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 13 Dec 2022 00:59:00 +0000 (16:59 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 13 Dec 2022 00:59:00 +0000 (16:59 -0800)
Pull rust updates from Miguel Ojeda:
 "The first set of changes after the merge, the major ones being:

   - String and formatting: new types 'CString', 'CStr', 'BStr' and
     'Formatter'; new macros 'c_str!', 'b_str!' and 'fmt!'.

   - Errors: the rest of the error codes from 'errno-base.h', as well as
     some 'From' trait implementations for the 'Error' type.

   - Printing: the rest of the 'pr_*!' levels and the continuation one
     'pr_cont!', as well as a new sample.

   - 'alloc' crate: new constructors 'try_with_capacity()' and
     'try_with_capacity_in()' for 'RawVec' and 'Vec'.

   - Procedural macros: new macros '#[vtable]' and 'concat_idents!', as
     well as better ergonomics for 'module!' users.

   - Asserting: new macros 'static_assert!', 'build_error!' and
     'build_assert!', as well as a new crate 'build_error' to support
     them.

   - Vocabulary types: new types 'Opaque' and 'Either'.

   - Debugging: new macro 'dbg!'"

* tag 'rust-6.2' of https://github.com/Rust-for-Linux/linux: (28 commits)
  rust: types: add `Opaque` type
  rust: types: add `Either` type
  rust: build_assert: add `build_{error,assert}!` macros
  rust: add `build_error` crate
  rust: static_assert: add `static_assert!` macro
  rust: std_vendor: add `dbg!` macro based on `std`'s one
  rust: str: add `fmt!` macro
  rust: str: add `CString` type
  rust: str: add `Formatter` type
  rust: str: add `c_str!` macro
  rust: str: add `CStr` unit tests
  rust: str: implement several traits for `CStr`
  rust: str: add `CStr` type
  rust: str: add `b_str!` macro
  rust: str: add `BStr` type
  rust: alloc: add `Vec::try_with_capacity{,_in}()` constructors
  rust: alloc: add `RawVec::try_with_capacity_in()` constructor
  rust: prelude: add `error::code::*` constant items
  rust: error: add `From` implementations for `Error`
  rust: error: add codes from `errno-base.h`
  ...

1  2 
lib/Kconfig.debug

diff --combined lib/Kconfig.debug
@@@ -395,13 -395,12 +395,13 @@@ endif # DEBUG_INF
  config FRAME_WARN
        int "Warn for stack frames larger than"
        range 0 8192
 +      default 0 if KMSAN
        default 2048 if GCC_PLUGIN_LATENT_ENTROPY
        default 2048 if PARISC
        default 1536 if (!64BIT && XTENSA)
 +      default 1280 if KASAN && !64BIT
        default 1024 if !64BIT
        default 2048 if 64BIT
 -      default 0 if KMSAN
        help
          Tell the compiler to warn at build time for stack frames larger than this.
          Setting this too low will cause a lot of warnings.
@@@ -1717,16 -1716,6 +1717,16 @@@ config LATENCYTO
          Enable this option if you want to use the LatencyTOP tool
          to find out which userspace is blocking on what kernel operations.
  
 +config DEBUG_CGROUP_REF
 +      bool "Disable inlining of cgroup css reference count functions"
 +      depends on DEBUG_KERNEL
 +      depends on CGROUPS
 +      depends on KPROBES
 +      default n
 +      help
 +        Force cgroup css reference count functions to not be inlined so
 +        that they can be kprobed for debugging.
 +
  source "kernel/trace/Kconfig"
  
  config PROVIDE_OHCI1394_DMA_INIT
@@@ -1885,14 -1874,8 +1885,14 @@@ config NETDEV_NOTIFIER_ERROR_INJEC
          If unsure, say N.
  
  config FUNCTION_ERROR_INJECTION
 -      def_bool y
 +      bool "Fault-injections of functions"
        depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES
 +      help
 +        Add fault injections into various functions that are annotated with
 +        ALLOW_ERROR_INJECTION() in the kernel. BPF may also modify the return
 +        value of theses functions. This is useful to test error paths of code.
 +
 +        If unsure, say N
  
  config FAULT_INJECTION
        bool "Fault-injection framework"
@@@ -2124,7 -2107,6 +2124,7 @@@ config KPROBES_SANITY_TES
        depends on DEBUG_KERNEL
        depends on KPROBES
        depends on KUNIT
 +      select STACKTRACE if ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
        default KUNIT_ALL_TESTS
        help
          This option provides for testing basic kprobes functionality on
@@@ -2259,10 -2241,6 +2259,10 @@@ config TEST_UUI
  config TEST_XARRAY
        tristate "Test the XArray code at runtime"
  
 +config TEST_MAPLE_TREE
 +      select DEBUG_MAPLE_TREE
 +      tristate "Test the Maple Tree code at runtime"
 +
  config TEST_RHASHTABLE
        tristate "Perform selftest on resizable hash table"
        help
@@@ -2823,6 -2801,22 +2823,22 @@@ config RUST_OVERFLOW_CHECK
  
          If unsure, say Y.
  
+ config RUST_BUILD_ASSERT_ALLOW
+       bool "Allow unoptimized build-time assertions"
+       depends on RUST
+       help
+         Controls how are `build_error!` and `build_assert!` handled during build.
+         If calls to them exist in the binary, it may indicate a violated invariant
+         or that the optimizer failed to verify the invariant during compilation.
+         This should not happen, thus by default the build is aborted. However,
+         as an escape hatch, you can choose Y here to ignore them during build
+         and let the check be carried at runtime (with `panic!` being called if
+         the check fails).
+         If unsure, say N.
  endmenu # "Rust"
  
  source "Documentation/Kconfig"