Re: [PATCH v16 8/9] task: rust: rework how current is accessed

Alice Ryhl
2025-05-08T09:51:05Z

On Wed, May 07, 2025 at 09:55:29AM -0700, Boqun Feng wrote:
> On Wed, May 07, 2025 at 09:46:23AM -0700, Boqun Feng wrote:
> > On Wed, May 07, 2025 at 09:06:01AM -0700, Boqun Feng wrote:
> > > Due to this:
> > >
> > > https://lore.kernel.org/oe-kbuild-all/202505072116.eSYC8igT-lkp@intel.com/
> > >
> > > , I think we should move this impl block into rust/kernel/mm.rs for now,
> > > i.e. (in rust/kernel/mm.rs)
> > >
> > > impl crate::task::CurrentTask {
> > > pub fn mm(&self) -> Option<&MmWithUser> { ... }
> > > }
> > >
> > > Thoughts?
> > >
> >
> > Hmm.. this alone won't be enough, because miscdevice also uses mm. Maybe
> > you could most of mm defined even when CONFIG_MMU=n but keep
> > MmWithUserAsync only available when CONFIG_MMU=y?
> >
>
> Something like this, probably? But your choice ;-) Make CONFIG_RUST
> select CONFIG_MMU is fine but the question is who is going to unselect
> that at when?

Please see:
https://lore.kernel.org/r/20250508083540.3832900-1-aliceryhl@google.com

Alice