Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-02 Thread Benno Lossin
On Wed Jul 2, 2025 at 10:26 AM CEST, Andreas Hindborg wrote: > "Miguel Ojeda" writes: > >> On Tue, Jul 1, 2025 at 5:43 PM Benno Lossin wrote: >>> >>> Ultimately this is something for Miguel to decide. >> >> Only if you all cannot get to an agreement ;) > >> >> If Andreas wants to have it already

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-02 Thread Andreas Hindborg
"Benno Lossin" writes: > On Tue Jul 1, 2025 at 4:14 PM CEST, Andreas Hindborg wrote: >> "Benno Lossin" writes: >>> On Tue Jul 1, 2025 at 10:43 AM CEST, Andreas Hindborg wrote: No, I am OK for now with configfs. But, progress is still great. How about if we add a copy accessor

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-02 Thread Andreas Hindborg
"Benno Lossin" writes: > On Tue Jul 1, 2025 at 6:27 PM CEST, Miguel Ojeda wrote: >> On Tue, Jul 1, 2025 at 5:43 PM Benno Lossin wrote: >>> >>> Ultimately this is something for Miguel to decide. >> >> Only if you all cannot get to an agreement ;) > > :) > >> If Andreas wants to have it already ad

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-02 Thread Andreas Hindborg
"Miguel Ojeda" writes: > On Tue, Jul 1, 2025 at 5:43 PM Benno Lossin wrote: >> >> Ultimately this is something for Miguel to decide. > > Only if you all cannot get to an agreement ;) > > If Andreas wants to have it already added, then I would say just mark > it `unsafe` as Benno recommends (pos

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-01 Thread Benno Lossin
On Tue Jul 1, 2025 at 6:27 PM CEST, Miguel Ojeda wrote: > On Tue, Jul 1, 2025 at 5:43 PM Benno Lossin wrote: >> >> Ultimately this is something for Miguel to decide. > > Only if you all cannot get to an agreement ;) :) > If Andreas wants to have it already added, then I would say just mark > it

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-01 Thread Miguel Ojeda
On Tue, Jul 1, 2025 at 5:43 PM Benno Lossin wrote: > > Ultimately this is something for Miguel to decide. Only if you all cannot get to an agreement ;) If Andreas wants to have it already added, then I would say just mark it `unsafe` as Benno recommends (possibly with an overbearing precondition

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-01 Thread Benno Lossin
On Tue Jul 1, 2025 at 4:14 PM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: >> On Tue Jul 1, 2025 at 10:43 AM CEST, Andreas Hindborg wrote: >>> No, I am OK for now with configfs. >>> >>> But, progress is still great. How about if we add a copy accessor >>> instead for now, I think you pro

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-01 Thread Andreas Hindborg
"Benno Lossin" writes: > On Tue Jul 1, 2025 at 10:43 AM CEST, Andreas Hindborg wrote: >> "Benno Lossin" writes: >>> On Mon Jun 30, 2025 at 3:15 PM CEST, Andreas Hindborg wrote: "Benno Lossin" writes: > On Mon Jun 30, 2025 at 1:18 PM CEST, Andreas Hindborg wrote: >> "Benno Lossin"

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-01 Thread Benno Lossin
On Tue Jul 1, 2025 at 10:43 AM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: >> On Mon Jun 30, 2025 at 3:15 PM CEST, Andreas Hindborg wrote: >>> "Benno Lossin" writes: On Mon Jun 30, 2025 at 1:18 PM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: >> (no idea if the o

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-01 Thread Andreas Hindborg
"Benno Lossin" writes: > On Mon Jun 30, 2025 at 3:15 PM CEST, Andreas Hindborg wrote: >> "Benno Lossin" writes: >>> On Mon Jun 30, 2025 at 1:18 PM CEST, Andreas Hindborg wrote: "Benno Lossin" writes: > (no idea if the orderings are correct, I always have to think way to > much abou

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-30 Thread Benno Lossin
On Mon Jun 30, 2025 at 3:15 PM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: >> On Mon Jun 30, 2025 at 1:18 PM CEST, Andreas Hindborg wrote: >>> "Benno Lossin" writes: (no idea if the orderings are correct, I always have to think way to much about that... especially since our a

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-30 Thread Andreas Hindborg
"Benno Lossin" writes: > On Mon Jun 30, 2025 at 1:18 PM CEST, Andreas Hindborg wrote: >> "Benno Lossin" writes: >>> On Fri Jun 27, 2025 at 9:57 AM CEST, Andreas Hindborg wrote: Andreas Hindborg writes: > "Benno Lossin" writes: >> That's good to know, then let's try to go for somet

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-30 Thread Benno Lossin
On Mon Jun 30, 2025 at 1:18 PM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: >> On Fri Jun 27, 2025 at 9:57 AM CEST, Andreas Hindborg wrote: >>> Andreas Hindborg writes: "Benno Lossin" writes: > That's good to know, then let's try to go for something simple. > > I don't

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-30 Thread Andreas Hindborg
"Benno Lossin" writes: > On Fri Jun 27, 2025 at 9:57 AM CEST, Andreas Hindborg wrote: >> Andreas Hindborg writes: >>> "Benno Lossin" writes: That's good to know, then let's try to go for something simple. I don't think that we can just use a `Mutex`, because we don't have a

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-27 Thread Benno Lossin
On Fri Jun 27, 2025 at 9:57 AM CEST, Andreas Hindborg wrote: > Andreas Hindborg writes: >> "Benno Lossin" writes: >>> That's good to know, then let's try to go for something simple. >>> >>> I don't think that we can just use a `Mutex`, because we don't have a >>> way to create it at const time...

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-27 Thread Andreas Hindborg
Andreas Hindborg writes: > "Benno Lossin" writes: > >> On Mon Jun 23, 2025 at 4:31 PM CEST, Andreas Hindborg wrote: >>> "Benno Lossin" writes: >>> On Mon Jun 23, 2025 at 11:44 AM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: > >> On Fri Jun 20, 2025 at 1:29 PM CEST, A

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-24 Thread Andreas Hindborg
"Benno Lossin" writes: > On Mon Jun 23, 2025 at 4:31 PM CEST, Andreas Hindborg wrote: >> "Benno Lossin" writes: >> >>> On Mon Jun 23, 2025 at 11:44 AM CEST, Andreas Hindborg wrote: "Benno Lossin" writes: > On Fri Jun 20, 2025 at 1:29 PM CEST, Andreas Hindborg wrote: >> "Benno

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-23 Thread Benno Lossin
On Mon Jun 23, 2025 at 4:31 PM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: > >> On Mon Jun 23, 2025 at 11:44 AM CEST, Andreas Hindborg wrote: >>> "Benno Lossin" writes: >>> On Fri Jun 20, 2025 at 1:29 PM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: >> On Thu Jun

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-23 Thread Andreas Hindborg
"Benno Lossin" writes: > On Mon Jun 23, 2025 at 11:44 AM CEST, Andreas Hindborg wrote: >> "Benno Lossin" writes: >> >>> On Fri Jun 20, 2025 at 1:29 PM CEST, Andreas Hindborg wrote: "Benno Lossin" writes: > On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: >> +/// A wrapp

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-23 Thread Benno Lossin
On Mon Jun 23, 2025 at 2:37 PM CEST, Miguel Ojeda wrote: > On Mon, Jun 23, 2025 at 1:48 PM Benno Lossin wrote: >> >> Another way would be to use a `Once`-like type (does that exist on the C >> side?) so a type that can be initialized once and then never changes. > > There are `DO_ONCE{,_SLEEPABLE,

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-23 Thread Miguel Ojeda
On Mon, Jun 23, 2025 at 1:48 PM Benno Lossin wrote: > > Another way would be to use a `Once`-like type (does that exist on the C > side?) so a type that can be initialized once and then never changes. There are `DO_ONCE{,_SLEEPABLE,_LITE}`. Cheers, Miguel

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-23 Thread Benno Lossin
On Mon Jun 23, 2025 at 11:44 AM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: > >> On Fri Jun 20, 2025 at 1:29 PM CEST, Andreas Hindborg wrote: >>> "Benno Lossin" writes: On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: > +/// A wrapper for kernel parameters. > +

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-23 Thread Andreas Hindborg
"Benno Lossin" writes: > On Fri Jun 20, 2025 at 1:29 PM CEST, Andreas Hindborg wrote: >> "Benno Lossin" writes: >>> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: +/// A wrapper for kernel parameters. +/// +/// This type is instantiated by the [`module!`] macro when

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-23 Thread Andreas Hindborg
"Benno Lossin" writes: > On Fri Jun 20, 2025 at 1:29 PM CEST, Andreas Hindborg wrote: >> "Benno Lossin" writes: >>> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: +/// A wrapper for kernel parameters. +/// +/// This type is instantiated by the [`module!`] macro when

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-20 Thread Benno Lossin
On Fri Jun 20, 2025 at 1:29 PM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: >> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: >>> +/// A wrapper for kernel parameters. >>> +/// >>> +/// This type is instantiated by the [`module!`] macro when module >>> parameters are >>> +

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-20 Thread Andreas Hindborg
Andreas Hindborg writes: > "Benno Lossin" writes: > >> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: >>> +/// A wrapper for kernel parameters. >>> +/// >>> +/// This type is instantiated by the [`module!`] macro when module >>> parameters are >>> +/// defined. You should never ne

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-20 Thread Andreas Hindborg
"Benno Lossin" writes: > On Thu Jun 19, 2025 at 2:20 PM CEST, Andreas Hindborg wrote: >> "Benno Lossin" writes: >>> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: [...] +crate::error::from_result(|| { +let new_value = T::try_from_param_arg(arg)?; +

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-20 Thread Andreas Hindborg
"Benno Lossin" writes: > On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: >> +/// A wrapper for kernel parameters. >> +/// >> +/// This type is instantiated by the [`module!`] macro when module >> parameters are >> +/// defined. You should never need to instantiate this type directly

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-19 Thread Benno Lossin
On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: > +/// A wrapper for kernel parameters. > +/// > +/// This type is instantiated by the [`module!`] macro when module > parameters are > +/// defined. You should never need to instantiate this type directly. > +/// > +/// Note: This type

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-19 Thread Benno Lossin
On Thu Jun 19, 2025 at 2:20 PM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: >> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: >>> + >>> +// SAFETY: C kernel handles serializing access to this type. We never >>> access it >>> +// from Rust module. >>> +unsafe impl Sync for

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-19 Thread Andreas Hindborg
"Benno Lossin" writes: > On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: >> Add types and traits for interfacing the C moduleparam API. >> >> Signed-off-by: Andreas Hindborg >> --- >> rust/kernel/lib.rs | 1 + >> rust/kernel/module_param.rs | 201 >>

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-18 Thread Benno Lossin
On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: > Add types and traits for interfacing the C moduleparam API. > > Signed-off-by: Andreas Hindborg > --- > rust/kernel/lib.rs | 1 + > rust/kernel/module_param.rs | 201 > > 2 file

[PATCH v13 2/6] rust: introduce module_param module

2025-06-12 Thread Andreas Hindborg
Add types and traits for interfacing the C moduleparam API. Signed-off-by: Andreas Hindborg --- rust/kernel/lib.rs | 1 + rust/kernel/module_param.rs | 201 2 files changed, 202 insertions(+) diff --git a/rust/kernel/lib.rs b/rust/kernel/l