Re: [PATCH v3 1/2] powerpc/ptrace: simplify gpr_get/tm_cgpr_get

2020-11-19 Thread Oleg Nesterov
On 11/19, Christophe Leroy wrote: > > > Le 19/11/2020 à 17:02, Oleg Nesterov a écrit : > >gpr_get() does membuf_write() twice to override pt_regs->msr in between. > > Is there anything wrong with that ? Nothing wrong, but imo the code and 2/2 looks simpler after this patch. I tried to explain this

Re: [PATCH v3 1/2] powerpc/ptrace: simplify gpr_get/tm_cgpr_get

2020-11-19 Thread Christophe Leroy
Le 19/11/2020 à 17:02, Oleg Nesterov a écrit : gpr_get() does membuf_write() twice to override pt_regs->msr in between. Is there anything wrong with that ? We can call membuf_write() once and change ->msr in the kernel buffer, this simplifies the code and the next fix. The patch adds a ne

[PATCH v3 1/2] powerpc/ptrace: simplify gpr_get/tm_cgpr_get

2020-11-19 Thread Oleg Nesterov
gpr_get() does membuf_write() twice to override pt_regs->msr in between. We can call membuf_write() once and change ->msr in the kernel buffer, this simplifies the code and the next fix. The patch adds a new simple helper, membuf_at(offs), it returns the new membuf which can be safely used after m