Re: [PATCH] arm64: fix bug for reloading FPSIMD state after execve on cpu 0.

2015-08-26 Thread Jianhua Liu
On Wed, Aug 26, 2015 at 7:32 PM, Ard Biesheuvel wrote: > On 26 August 2015 at 13:12, Will Deacon wrote: >> Hello, >> >> [adding Ard] >> >> On Wed, Aug 26, 2015 at 03:40:41AM +0100, Chunyan Zhang wrote: >>> From: Janet Liu >>> >>> If process A is running on CPU 0 and do execve syscall and after s

Re: [PATCH] arm64: fix bug for reloading FPSIMD state after execve on cpu 0.

2015-08-26 Thread Jianhua Liu
NO, kernel thread will not use fpsimd. kernel threads get scheduled in, per_cpu(fpsimd_last_state) will not be updated. The following is the condion that bug comes. 1. Process A runa on CPU 0, and does execve syscall. 2. Before execve syscall return to userspace, A gets scheduled out. 3. some kern

Re: [PATCH] arm64: fix bug for reloading FPSIMD state after execve on cpu 0.

2015-08-26 Thread Will Deacon
On Wed, Aug 26, 2015 at 12:32:03PM +0100, Ard Biesheuvel wrote: > On 26 August 2015 at 13:12, Will Deacon wrote: > > On Wed, Aug 26, 2015 at 03:40:41AM +0100, Chunyan Zhang wrote: > >> From: Janet Liu > >> > >> If process A is running on CPU 0 and do execve syscall and after > >> sched_exec, > >

Re: [PATCH] arm64: fix bug for reloading FPSIMD state after execve on cpu 0.

2015-08-26 Thread Ard Biesheuvel
On 26 August 2015 at 13:12, Will Deacon wrote: > Hello, > > [adding Ard] > > On Wed, Aug 26, 2015 at 03:40:41AM +0100, Chunyan Zhang wrote: >> From: Janet Liu >> >> If process A is running on CPU 0 and do execve syscall and after sched_exec, >> dest_cpu is 0, fpsimd_state.cpu is 0. If at the time

Re: [PATCH] arm64: fix bug for reloading FPSIMD state after execve on cpu 0.

2015-08-26 Thread Will Deacon
Hello, [adding Ard] On Wed, Aug 26, 2015 at 03:40:41AM +0100, Chunyan Zhang wrote: > From: Janet Liu > > If process A is running on CPU 0 and do execve syscall and after sched_exec, > dest_cpu is 0, fpsimd_state.cpu is 0. If at the time Process A get scheduled > out and after some kernel thread

[PATCH] arm64: fix bug for reloading FPSIMD state after execve on cpu 0.

2015-08-25 Thread Chunyan Zhang
From: Janet Liu If process A is running on CPU 0 and do execve syscall and after sched_exec, dest_cpu is 0, fpsimd_state.cpu is 0. If at the time Process A get scheduled out and after some kernel threads running on CPU 0, process A is back in CPU 0, A's fpsimd_state.cpu is current cpu id "0", and