Re: question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-29 Thread Oleg Nesterov
On 01/27, Rik van Riel wrote: > > On 01/27/2015 03:27 PM, Rik van Riel wrote: > > On 01/27/2015 02:40 PM, Oleg Nesterov wrote: > > - Why unlazy_fpu() always does __save_init_fpu() even if > use_eager_fpu? > > and note that in this case __thread_fpu_end() is wrong if > use_e

Re: question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-29 Thread Rik van Riel
On 01/29/2015 03:45 PM, Oleg Nesterov wrote: > On 01/27, Rik van Riel wrote: >> >> On 01/27/2015 02:40 PM, Oleg Nesterov wrote: > > - Is unlazy_fpu()->__save_init_fpu() safe wrt > __kernel_fpu_begin() from irq? >> >> It looks like it should be safe, as long as __save_init_fpu() >> knows

Re: question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-29 Thread Oleg Nesterov
On 01/27, Rik van Riel wrote: > > On 01/27/2015 02:40 PM, Oleg Nesterov wrote: > >>> > >>> - Is unlazy_fpu()->__save_init_fpu() safe wrt > >>> __kernel_fpu_begin() from irq? > > It looks like it should be safe, as long as __save_init_fpu() > knows that the task no longer has the FPU after __kernel_

Re: question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-27 Thread Rik van Riel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/27/2015 03:27 PM, Rik van Riel wrote: > On 01/27/2015 02:40 PM, Oleg Nesterov wrote: - Why unlazy_fpu() always does __save_init_fpu() even if use_eager_fpu? and note that in this case __thread_fpu_end() is wrong if us

Re: question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-27 Thread Rik van Riel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/27/2015 02:40 PM, Oleg Nesterov wrote: > On 01/26, Rik van Riel wrote: >> >> On 01/24/2015 03:20 PM, Oleg Nesterov wrote: >> >>> Now the questions: >>> >>> - This doesn't hurt, but does it really need __thread_fpu_end? >>> >>> Perhaps this is

Re: question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-27 Thread Oleg Nesterov
On 01/26, Rik van Riel wrote: > > On 01/24/2015 03:20 PM, Oleg Nesterov wrote: > > > Now the questions: > > > > - This doesn't hurt, but does it really need __thread_fpu_end? > > > > Perhaps this is because we do not check the error code returned by > > __save_init_fpu? although I am not sure I und

Re: question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-26 Thread Rik van Riel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/24/2015 03:20 PM, Oleg Nesterov wrote: > Let me abuse this thread to ask more questions. > > Peter, could you help? > > On 01/23, Rik van Riel wrote: >> >> Not only is this broken with my new code, but it looks like it >> may be broken with th

Re: question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-24 Thread Oleg Nesterov
Let me abuse this thread to ask more questions. Peter, could you help? On 01/23, Rik van Riel wrote: > > Not only is this broken with my new code, but it looks like it may > be broken with the current code, too... As I already mentioned, at least math_error()->save_init_fpu() looks buggy. And un

Re: question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-24 Thread Rik van Riel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/23/2015 04:07 PM, H. Peter Anvin wrote: > On 01/23/2015 11:34 AM, Rik van Riel wrote: >> While working on a patch series to defer FPU state loading until >> kernel -> user space transition, and be more lazy with FPU state >> while in the kernel

Re: question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-23 Thread H. Peter Anvin
On 01/23/2015 11:34 AM, Rik van Riel wrote: > While working on a patch series to defer FPU state loading until > kernel -> user space transition, and be more lazy with FPU state > while in the kernel, I came across this code in save_xstate_sig(). > > Not only is this broken with my new code, but i

question about save_xstate_sig() - WHY DOES THIS WORK?

2015-01-23 Thread Rik van Riel
While working on a patch series to defer FPU state loading until kernel -> user space transition, and be more lazy with FPU state while in the kernel, I came across this code in save_xstate_sig(). Not only is this broken with my new code, but it looks like it may be broken with the current code, t