Re: [POC][RFC][PATCH 2/2] pstore/ramoops: Add ramoops.mem_name= command line option
From: Steven Rostedt
Date: Tue Apr 09 2024 - 19:11:49 EST
On Tue, 9 Apr 2024 15:18:45 -0700
Kees Cook <keescook@xxxxxxxxxxxx> wrote:
> > @@ -914,6 +919,19 @@ static void __init ramoops_register_dummy(void)
> > {
> > struct ramoops_platform_data pdata;
> >
> > +#ifndef MODULE
> > + /* Only allowed when builtin */
>
> Why only when builtin?
Well, because the memory table that maps the found physical memory to a
lable is marked as __initdata, and will not be available after boot. If you
wanted it for a module, you would need some builtin code to find it.
>
> > + if (mem_name) {
> > + u64 start;
> > + u64 size;
> > +
> > + if (memmap_named(mem_name, &start, &size)) {
> > + mem_address = start;
> > + mem_size = size;
> > + }
> > + }
> > +#endif
>
> Otherwise this looks good, though I'd prefer some comments about what's
> happening here.
>
> (And in retrospect, separately, I probably need to rename "dummy" to
> "commandline" or something, since it's gathering valid settings here...)
Yeah, that was a bit confusing. I kept thinking "is this function stable?".
-- Steve