Re: [PATCH v6] livepatch: introduce shadow variable API

2017-09-13 Thread Jiri Kosina
On Tue, 12 Sep 2017, Joe Lawrence wrote: > > On Thu, Aug 31, 2017 at 04:37:41PM -0400, Joe Lawrence wrote: > >> +void *__klp_shadow_get_or_alloc(void *obj, unsigned long id, void *data, > >> + size_t size, gfp_t gfp_flags, bool warn_on_exist) > >> +{ > >> + struct klp_shadow

Re: [PATCH v6] livepatch: introduce shadow variable API

2017-09-13 Thread Jiri Kosina
On Tue, 12 Sep 2017, Joe Lawrence wrote: > > On Thu, Aug 31, 2017 at 04:37:41PM -0400, Joe Lawrence wrote: > >> +void *__klp_shadow_get_or_alloc(void *obj, unsigned long id, void *data, > >> + size_t size, gfp_t gfp_flags, bool warn_on_exist) > >> +{ > >> + struct klp_shadow

Re: [PATCH v6] livepatch: introduce shadow variable API

2017-09-13 Thread Miroslav Benes
On Thu, 31 Aug 2017, Joe Lawrence wrote: > Add exported API for livepatch modules: > > klp_shadow_get() > klp_shadow_alloc() > klp_shadow_get_or_alloc() > klp_shadow_free() > klp_shadow_free_all() > > that implement "shadow" variables, which allow callers to associate new > shadow

Re: [PATCH v6] livepatch: introduce shadow variable API

2017-09-13 Thread Miroslav Benes
On Thu, 31 Aug 2017, Joe Lawrence wrote: > Add exported API for livepatch modules: > > klp_shadow_get() > klp_shadow_alloc() > klp_shadow_get_or_alloc() > klp_shadow_free() > klp_shadow_free_all() > > that implement "shadow" variables, which allow callers to associate new > shadow

Re: [PATCH v6] livepatch: introduce shadow variable API

2017-09-12 Thread Joe Lawrence
On 09/12/2017 12:20 PM, Josh Poimboeuf wrote: > On Thu, Aug 31, 2017 at 04:37:41PM -0400, Joe Lawrence wrote: >> +void *__klp_shadow_get_or_alloc(void *obj, unsigned long id, void *data, >> + size_t size, gfp_t gfp_flags, bool warn_on_exist) >> +{ >> +struct klp_shadow

Re: [PATCH v6] livepatch: introduce shadow variable API

2017-09-12 Thread Joe Lawrence
On 09/12/2017 12:20 PM, Josh Poimboeuf wrote: > On Thu, Aug 31, 2017 at 04:37:41PM -0400, Joe Lawrence wrote: >> +void *__klp_shadow_get_or_alloc(void *obj, unsigned long id, void *data, >> + size_t size, gfp_t gfp_flags, bool warn_on_exist) >> +{ >> +struct klp_shadow

Re: [PATCH v6] livepatch: introduce shadow variable API

2017-09-12 Thread Josh Poimboeuf
On Thu, Aug 31, 2017 at 04:37:41PM -0400, Joe Lawrence wrote: > +void *__klp_shadow_get_or_alloc(void *obj, unsigned long id, void *data, > +size_t size, gfp_t gfp_flags, bool warn_on_exist) > +{ > + struct klp_shadow *new_shadow; > + void *shadow_data; > + unsigned

Re: [PATCH v6] livepatch: introduce shadow variable API

2017-09-12 Thread Josh Poimboeuf
On Thu, Aug 31, 2017 at 04:37:41PM -0400, Joe Lawrence wrote: > +void *__klp_shadow_get_or_alloc(void *obj, unsigned long id, void *data, > +size_t size, gfp_t gfp_flags, bool warn_on_exist) > +{ > + struct klp_shadow *new_shadow; > + void *shadow_data; > + unsigned

[PATCH v6] livepatch: introduce shadow variable API

2017-08-31 Thread Joe Lawrence
Add exported API for livepatch modules: klp_shadow_get() klp_shadow_alloc() klp_shadow_get_or_alloc() klp_shadow_free() klp_shadow_free_all() that implement "shadow" variables, which allow callers to associate new shadow fields to existing data structures. This is intended to be used

[PATCH v6] livepatch: introduce shadow variable API

2017-08-31 Thread Joe Lawrence
Add exported API for livepatch modules: klp_shadow_get() klp_shadow_alloc() klp_shadow_get_or_alloc() klp_shadow_free() klp_shadow_free_all() that implement "shadow" variables, which allow callers to associate new shadow fields to existing data structures. This is intended to be used