Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-25 Thread Simon Guo
On Thu, Jul 21, 2016 at 08:57:29PM +1000, Michael Ellerman wrote: > Can one of you send a properly formatted and signed-off patch. I will work on that. Thanks, Simon ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/l

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-21 Thread Michael Ellerman
Simon Guo writes: > Michael, Ben, > On Fri, Jul 08, 2016 at 08:02:42PM +1000, Michael Ellerman wrote: >> Benjamin Herrenschmidt writes: >> >> > On Thu, 2016-07-07 at 23:21 +1000, Benjamin Herrenschmidt wrote: >> >>  >> >> I think the right fix is that if a restore_sigcontext() has the MSR >> >>

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-15 Thread Simon Guo
Michael, Ben, On Fri, Jul 08, 2016 at 08:02:42PM +1000, Michael Ellerman wrote: > Benjamin Herrenschmidt writes: > > > On Thu, 2016-07-07 at 23:21 +1000, Benjamin Herrenschmidt wrote: > >>  > >> I think the right fix is that if a restore_sigcontext() has the MSR > >> bits set, > >> it should set

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-11 Thread Simon Guo
On Fri, Jul 08, 2016 at 08:02:42PM +1000, Michael Ellerman wrote: > Benjamin Herrenschmidt writes: > > > On Thu, 2016-07-07 at 23:21 +1000, Benjamin Herrenschmidt wrote: > >>  > >> I think the right fix is that if a restore_sigcontext() has the MSR > >> bits set, > >> it should set the correspond

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-08 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > On Thu, 2016-07-07 at 23:21 +1000, Benjamin Herrenschmidt wrote: >>  >> I think the right fix is that if a restore_sigcontext() has the MSR >> bits set, >> it should set the corresponding used_* flag. > > Something like this: > > (totally untested) Simon/Laurent,

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-08 Thread Michael Ellerman
Laurent Dufour writes: > On 07/07/2016 15:21, Benjamin Herrenschmidt wrote: >> On Thu, 2016-07-07 at 15:12 +0200, Laurent Dufour wrote: >>> Most of the time this is fine, but in the case a thread which has really >>> used those registers is catching a signal just after the restore and >>> before i

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Simon Guo
On Thu, Jul 07, 2016 at 11:21:18PM +1000, Benjamin Herrenschmidt wrote: > I think the right fix is that if a restore_sigcontext() has the MSR bits set, > it should set the corresponding used_* flag. > > Or is there a reason why that won't work ? That sounds reaonable to me. I will prepare a patch

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Laurent Dufour
On 07/07/2016 15:21, Benjamin Herrenschmidt wrote: > On Thu, 2016-07-07 at 15:12 +0200, Laurent Dufour wrote: >> >> Basically, CRIU checkpoints the process register's state through the >> ptrace API, and it restores it through a signal frame at restart time. >> This is quite odd but that the way it

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Benjamin Herrenschmidt
On Thu, 2016-07-07 at 23:21 +1000, Benjamin Herrenschmidt wrote: >  > I think the right fix is that if a restore_sigcontext() has the MSR > bits set, > it should set the corresponding used_* flag. Something like this: (totally untested) diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Benjamin Herrenschmidt
On Thu, 2016-07-07 at 15:12 +0200, Laurent Dufour wrote: > > Basically, CRIU checkpoints the process register's state through the > ptrace API, and it restores it through a signal frame at restart time. > This is quite odd but that the way it works on all the CRIU's supported > architectures. > >

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Laurent Dufour
On 07/07/2016 13:15, Michael Ellerman wrote: > On Thu, 2016-07-07 at 07:49:36 UTC, Simon Guo wrote: >> From: Simon Guo >> >> These 2 fields track whether user process has used Altivec/VSX >> registers or not. They are used by kernel to setup signal frame >> on user stack correctly regarding vector

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Michael Ellerman
On Thu, 2016-07-07 at 07:49:36 UTC, Simon Guo wrote: > From: Simon Guo > > These 2 fields track whether user process has used Altivec/VSX > registers or not. They are used by kernel to setup signal frame > on user stack correctly regarding vector part. I still dislike this. It's just exporting i

[PATCH v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread wei . guo . simon
From: Simon Guo These 2 fields track whether user process has used Altivec/VSX registers or not. They are used by kernel to setup signal frame on user stack correctly regarding vector part. CRIU(Checkpoint and Restore In User space) builds signal frame for restored process. It will need this exp