Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-05 Thread Josh Poimboeuf
On Thu, Nov 05, 2015 at 09:17:59AM -0600, Josh Poimboeuf wrote: > On Thu, Nov 05, 2015 at 10:40:26AM +0100, Jiri Kosina wrote: > > On Thu, 5 Nov 2015, Jiri Kosina wrote: > > > > > > > > +#ifdef CONFIG_DEBUG_SET_MODULE_RONX > > > > > > +static void set_page_attributes(void *start, void *end, > > >

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-05 Thread Josh Poimboeuf
On Thu, Nov 05, 2015 at 10:40:26AM +0100, Jiri Kosina wrote: > On Thu, 5 Nov 2015, Jiri Kosina wrote: > > > > > > +#ifdef CONFIG_DEBUG_SET_MODULE_RONX > > > > > +static void set_page_attributes(void *start, void *end, > > > > > + int (*set)(unsigned long start, int > >

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-05 Thread Jiri Kosina
On Thu, 5 Nov 2015, Jiri Kosina wrote: > > > > +#ifdef CONFIG_DEBUG_SET_MODULE_RONX > > > > +static void set_page_attributes(void *start, void *end, > > > > + int (*set)(unsigned long start, int > > > > num_pages)) > > > > +{ > > > > + unsigned long begin_pfn =

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-05 Thread Jiri Kosina
On Wed, 4 Nov 2015, Josh Poimboeuf wrote: > > > int klp_write_module_reloc(struct module *mod, unsigned long type, > > > unsigned long loc, unsigned long value) > > > { > > > - int ret, numpages, size = 4; > > > - bool readonly; > > > + int size = 4; > > > > BTW I don't see

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-04 Thread Josh Poimboeuf
On Wed, Nov 04, 2015 at 11:56:13PM +0100, Jiri Kosina wrote: > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > Subject: [PATCH] livepatch: Cleanup page permission changes > > > > Calling set_memory_rw() and set_memory_ro() for every iteration of the > > loop in klp

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-04 Thread Jiri Kosina
On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > Subject: [PATCH] livepatch: Cleanup page permission changes > > Calling set_memory_rw() and set_memory_ro() for every iteration of the > loop in klp_write_object_relocations() is messy and inefficient. Change > all the RO pages to RW

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-04 Thread Josh Poimboeuf
On Wed, Nov 04, 2015 at 10:10:06AM -0600, Josh Poimboeuf wrote: > On Wed, Nov 04, 2015 at 10:18:29AM +0100, Jiri Kosina wrote: > > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > > > It's probably a good idea to keep the patches bisectable, so I made this > > > a separate patch which applies on to

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-04 Thread Josh Poimboeuf
On Wed, Nov 04, 2015 at 10:18:29AM +0100, Jiri Kosina wrote: > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > It's probably a good idea to keep the patches bisectable, so I made this > > a separate patch which applies on top of the first one. > > > > (Note that it completely removes all the code

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-04 Thread Miroslav Benes
r a v2 of the first patch which would have had > Miroslav's suggested style changes.) I'd go along with Jiri and fold this patch to the first one. > ---8<--- > > Subject: [PATCH] livepatch: Cleanup page permission changes > > Calling set_memory_rw()

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-04 Thread Jiri Kosina
On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > It's probably a good idea to keep the patches bisectable, so I made this > a separate patch which applies on top of the first one. > > (Note that it completely removes all the code from the first patch, so > there's no need for a v2 of the first patch w

[PATCH] livepatch: Cleanup page permission changes

2015-11-03 Thread Josh Poimboeuf
suggested style changes.) ---8<--- Subject: [PATCH] livepatch: Cleanup page permission changes Calling set_memory_rw() and set_memory_ro() for every iteration of the loop in klp_write_object_relocations() is messy and inefficient. Change all the RO pages to RW before the loop and convert them ba