Re: [PATCH] rust: put C helper exports in a dedicated namespace

From: peder . bergan

Date: Sat Nov 21 2026 - 12:50:35 EST


Hi Miguel,

Thanks for the review. The export formats are literals, so I'll use
:= for both. V2 already added the namespace import to KASAN's C
metadata.
https://patch.msgid.link/20261120-rust-helper-namespace-v2-1-14315658f59e@xxxxxxxxx

For v3, I'll build on Giuliano's assembly conversion and generate
EXPORT_SYMBOL_NS_GPL() directly for the helper list.

1. Would you prefer I wait for Giuliano's series to land or send v3
with it listed as a prerequisite?
2. Should I keep the KASAN import for v3 or move automatic imports
into modpost in this series?
3. If you prefer modpost, should it add the import only when a module
contains a Rust object and references a RUST_HELPERS export?

Cheers,
Peder


On Fri, 20 Nov 2026 22:34:24 +0100, Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
> On Fri, Nov 20, 2026 at 5:32 PM Peder Bergan via B4 Relay
> <devnull+peder.bergan.gmail.com@xxxxxxxxxx> wrote:
> >
> > Suggested-by: Wedson Almeida Filho <wedsonaf@xxxxxxxxx>
> > Link: https://github.com/Rust-for-Linux/linux/issues/216
>
> Nice, thanks for going through these old issues! :)
>
> > +rust_export_macro = EXPORT_SYMBOL_RUST_GPL
>
> Do we need a recursively expanded variable?
>
> > +++ b/rust/exports.c
>
> Conflicts ahead; this file happens to be going away with:
>
> https://lore.kernel.org/rust-for-linux/20261112121512.1670347-3-gprocida@xxxxxxxxxx/
>
> Cc'ing Giuliano.
>
> Also, what Sashiko says seems reasonable: if we do it this way, then
> we may need manual `MODULE_IMPORT_NS()`s in some places, which may
> become a bit annoying, even if there aren't that many mixed language
> modules so far.
>
> Actually, perhaps we could just import it in modpost if a Rust module
> has any Rust translation unit in it...
>
> Cheers,
> Miguel