lkml.org 
[lkml]   [2017]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] livepatch: introduce shadow variable API

> > > > + *
> > > > + * Note: allocates @new_size space for shadow variable data and copies
> > > > + * @new_size bytes from @new_data into the shadow varaible's own @new_data
> > > > + * space. If @new_data is NULL, @new_size is still allocated, but no
> > > > + * copy is performed.
> > >
> > > I must say I'm not entirely happy with this. I don't know if this is what
> > > Petr had in mind (I'm sure he'll get to the patch set soon). Calling
> > > memcpy instead of a simple assignment in v1 seems worse.
> >
> > This change was a bit of a experiment on my part in reaction to
> > adding klp_shadow_get_or_attach().
> >
> > I like the simplicity of v1's pointer assignment -- in fact, moving all
> > allocation responsiblity (klp_shadow meta-data and data[] area) out to
> > the caller is doable, though implementing klp_shadow_get_or_attach() and
> > and klp_shadow_detach_all() complicates matters, for example, adding an
> > alloc/release callback. I originally attempted this for v2, but turned
> > back when the API and implementation grew complicated. If the memcpy
> > and gfp_flag restrictions are too ugly, I can try revisting that
> > approach. Ideas welcome :)
>
> Well, I didn't like callbacks either :). And no, I do not have a better
> idea. I still need to think about it.

Done and I agree that memcpy approach is not so bad after all :). So I'm
fine with it.

Miroslav

\
 
 \ /
  Last update: 2017-07-20 23:23    [W:0.089 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site