Re: [PATCH 04/12] __wr_after_init: x86_64: __wr_op

2018-12-21 Thread Igor Stoppa
On 21/12/2018 19:23, Andy Lutomirski wrote: On Thu, Dec 20, 2018 at 11:19 AM Igor Stoppa wrote: On 20/12/2018 20:49, Matthew Wilcox wrote: I think you're causing yourself more headaches by implementing this "op" function. I probably misinterpreted the initial criticism on my first pat

Re: [PATCH 04/12] __wr_after_init: x86_64: __wr_op

2018-12-21 Thread Andy Lutomirski
On Thu, Dec 20, 2018 at 11:19 AM Igor Stoppa wrote: > > > > On 20/12/2018 20:49, Matthew Wilcox wrote: > > > I think you're causing yourself more headaches by implementing this "op" > > function. > > I probably misinterpreted the initial criticism on my first patchset, > about duplication. Somehow

Re: [PATCH 04/12] __wr_after_init: x86_64: __wr_op

2018-12-20 Thread Matthew Wilcox
On Thu, Dec 20, 2018 at 09:19:15PM +0200, Igor Stoppa wrote: > On 20/12/2018 20:49, Matthew Wilcox wrote: > > I think you're causing yourself more headaches by implementing this "op" > > function. > > I probably misinterpreted the initial criticism on my first patchset, about > duplication. Someho

Re: [PATCH 04/12] __wr_after_init: x86_64: __wr_op

2018-12-20 Thread Igor Stoppa
On 20/12/2018 20:49, Matthew Wilcox wrote: I think you're causing yourself more headaches by implementing this "op" function. I probably misinterpreted the initial criticism on my first patchset, about duplication. Somehow, I'm still thinking to the endgame of having higher-level functi

Re: [PATCH 04/12] __wr_after_init: x86_64: __wr_op

2018-12-20 Thread Matthew Wilcox
On Wed, Dec 19, 2018 at 11:33:30PM +0200, Igor Stoppa wrote: > +void *__wr_op(unsigned long dst, unsigned long src, __kernel_size_t len, > + enum wr_op_type op) > +{ > + temporary_mm_state_t prev; > + unsigned long offset; > + unsigned long wr_poking_addr; > + > + /* Confi

Re: [PATCH 04/12] __wr_after_init: x86_64: __wr_op

2018-12-20 Thread Igor Stoppa
Hi, On 20/12/2018 19:20, Thiago Jung Bauermann wrote: Hello Igor, +/* + * The following two variables are statically allocated by the linker + * script at the the boundaries of the memory region (rounded up to + * multiples of PAGE_SIZE) reserved for __wr_after_init. + */ +extern long __start

Re: [PATCH 04/12] __wr_after_init: x86_64: __wr_op

2018-12-20 Thread Thiago Jung Bauermann
Hello Igor, > +/* > + * The following two variables are statically allocated by the linker > + * script at the the boundaries of the memory region (rounded up to > + * multiples of PAGE_SIZE) reserved for __wr_after_init. > + */ > +extern long __start_wr_after_init; > +extern long __end_wr_after

Re: [PATCH 04/12] __wr_after_init: x86_64: __wr_op

2018-12-20 Thread Igor Stoppa
On 19/12/2018 23:33, Igor Stoppa wrote: + if (WARN_ONCE(op >= WR_OPS_NUMBER, "Invalid WR operation.") || + WARN_ONCE(!is_wr_after_init(dst, len), "Invalid WR range.")) + return (void *)dst; + + offset = dst - (unsigned long)&__start_wr_after_init; I forgot t

[PATCH 04/12] __wr_after_init: x86_64: __wr_op

2018-12-19 Thread Igor Stoppa
Architecture-specific implementation of the core write rare operation. The implementation is based on code from Andy Lutomirski and Nadav Amit for patching the text on x86 [here goes reference to commits, once merged] The modification of write protected data is done through an alternate mapping o