On Mon, 12 Oct 2026 at 16:18, Miguel Ojeda <[email protected]> wrote: > > On Mon, Oct 12, 2026 at 3:42 PM Marco Elver <[email protected]> wrote: > > > > +Rust code is instrumented as well on architectures whose Rust target > > supports > > +it (currently only x86_64; see ``CONFIG_HAVE_KCSAN_RUSTC``). > > Maybe we can omit the x86_64 bit, to avoid maintaining the list in two > places, although it is convenient to know in the docs (but risks > getting out of date, of course).
I think any future patch that enables more architectures, can also update the docs. We have historically maintained the set of supported compilers + architectures (if that set was still small) in the sanitizer docs. Once that set grows large enough, we can omit. > > + Note that ``rustc`` rejects linking crates built with and without KCSAN > > + instrumentation, so ``KCSAN_SANITIZE`` and ``KCSAN_SANITIZE_<target>.o`` > > + cannot currently be used for Rust code. > > Would `-Cunsafe-allow-abi-mismatch=sanitizer` work? Not a blocker for > the patch (and in fact I don't know if we would like to actually > support it even if it works), but perhaps in the future we can relax > it using that. If rustc's sanitizer instrumentation is similar to clang's, and rustc doesn't introduce other ABI divergence due to sanitizers, then it should work. Same with KASAN + Rust, so this would need to be a general Rust + sanitizers decision. The only exception is KMSAN (which I think is not yet enabled for Rust), which does affect ABI. > (If it doesn't work for some reason, and we want it, then we can ask > upstream for an "escape hatch" as we usually do, since things like > this should normally have one...) > > > +# The minimum supported rustc's LLVM supports all of these options. > > Just to double-check: does this refer to the LLVM version of the > upstream `rustc` binary (LLVM 19.1.7) or the actual minimum they > support in that minimum `rustc` version (LLVM 18 major)? > > I think all the options exist for a long time, so it doesn't matter, > but just to confirm... Whichever minimum we could ever see the kernel compiled with, which looks like LLVM 18 in some custom setups? But yeah, all we need is at least LLVM 12... > In any case, this sounds all reasonable: > > Acked-by: Miguel Ojeda <[email protected]> Thanks!

