lkml.org 
[lkml]   [2024]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [POC][RFC][PATCH 2/2] pstore/ramoops: Add ramoops.mem_name= command line option
On Tue, 9 Apr 2024 15:18:45 -0700
Kees Cook <keescook@chromium.org> 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

\
 
 \ /
  Last update: 2024-05-27 16:31    [W:0.036 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site