mbox series

[0/3] Support MODVERSIONS by disabling Rust modules

Message ID 20231108022651.645950-2-mmaurer@google.com (mailing list archive)
Headers show
Series Support MODVERSIONS by disabling Rust modules | expand

Message

Matthew Maurer Nov. 8, 2023, 2:26 a.m. UTC
The goal of this patch series is to allow MODVERSIONS to be turned on
alongside RUST. Gary Guo previously proposed to adjust the API to
support Rust symbols' greater length:
https://lore.kernel.org/lkml/CANiq72n4MbR+AE7eHfVQZOu26FeSttQnEEMT3Jpft+CcGwk9jw@mail.gmail.com/T/

This did not land, so I'm proposing an alternate solution - users who
want to use Rust, but who do not need Rust modules, can disable Rust
module support in order to retain modversions support. This has the
added bonus of removing exported symbols from the kernel surface if we
know they won't be used due to lack of Rust module support in the
environment.

Matthew Maurer (3):
  kconfig: Extend expr_depends_symbol to recurse
  kconfig: Add special rust_modules config option
  rust: Require RUST_MODULES for module support

 init/Kconfig               | 21 +++++++++++++++++----
 kernel/module/Kconfig      |  1 +
 rust/exports.c             |  4 ++++
 scripts/kconfig/confdata.c |  3 +++
 scripts/kconfig/expr.c     | 22 ++++++++++++++++------
 scripts/kconfig/expr.h     |  3 ++-
 scripts/kconfig/lexer.l    |  1 +
 scripts/kconfig/lkc.h      |  1 +
 scripts/kconfig/menu.c     |  9 ++++++---
 scripts/kconfig/parser.y   | 12 ++++++++++++
 scripts/kconfig/symbol.c   | 31 +++++++++++++++++++++++++++++--
 11 files changed, 92 insertions(+), 16 deletions(-)

Comments

Masahiro Yamada Nov. 9, 2023, 12:44 p.m. UTC | #1
On Wed, Nov 8, 2023 at 4:27 AM Matthew Maurer <mmaurer@google.com> wrote:
>
> The goal of this patch series is to allow MODVERSIONS to be turned on
> alongside RUST. Gary Guo previously proposed to adjust the API to
> support Rust symbols' greater length:
> https://lore.kernel.org/lkml/CANiq72n4MbR+AE7eHfVQZOu26FeSttQnEEMT3Jpft+CcGwk9jw@mail.gmail.com/T/
>
> This did not land, so I'm proposing an alternate solution - users who
> want to use Rust, but who do not need Rust modules, can disable Rust
> module support in order to retain modversions support. This has the
> added bonus of removing exported symbols from the kernel surface if we
> know they won't be used due to lack of Rust module support in the
> environment.


No. This is not a solution.

It does not change the fact that Rust modules and modversions
cannot coexist, and it is even worse than the previous one.