]> git.baikalelectronics.ru Git - kernel.git/commit
i387: ptrace breaks the lazy-fpu-restore logic
authorOleg Nesterov <oleg@redhat.com>
Mon, 16 Apr 2012 20:48:15 +0000 (22:48 +0200)
committerH. Peter Anvin <hpa@linux.intel.com>
Mon, 16 Apr 2012 23:23:59 +0000 (16:23 -0700)
commit21964a17a4736855468d9038a8f687bcaf61e2d6
treefa86fb7efe7253f344fca3f0395aee2d92d13fa1
parent188a9127e7752346598183dbe657f6d3560e52d6
i387: ptrace breaks the lazy-fpu-restore logic

Starting from a3405d4c "i387: support lazy restore of FPU state"
we assume that fpu_owner_task doesn't need restore_fpu_checking()
on the context switch, its FPU state should match what we already
have in the FPU on this CPU.

However, debugger can change the tracee's FPU state, in this case
we should reset fpu.last_cpu to ensure fpu_lazy_restore() can't
return true.

Change init_fpu() to do this, it is called by user_regset->set()
methods.

Reported-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/20120416204815.GB24884@redhat.com
Cc: <stable@vger.kernel.org> v3.3
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/kernel/i387.c