diff options
author | Oleg Nesterov <[email protected]> | 2015-02-06 15:01:59 -0500 |
---|---|---|
committer | Borislav Petkov <[email protected]> | 2015-02-19 11:12:46 +0100 |
commit | 1a2a7f4ec8e3a7ac582dac4d01fcc7e8acd3bb30 (patch) | |
tree | e02cb93cfeca07de18639d4a1ee71cd7a207d294 /drivers/mtd/lpddr/lpddr_cmds.c | |
parent | a9241ea5fd709fc935dade130f4e3b2612bbe9e3 (diff) |
x86/fpu: Don't do __thread_fpu_end() if use_eager_fpu()
unlazy_fpu()->__thread_fpu_end() doesn't look right if use_eager_fpu().
Unconditional __thread_fpu_end() is only correct if we know that this
thread can't return to user-mode and use FPU.
Fortunately it has only 2 callers. fpu_copy() checks use_eager_fpu(),
and init_fpu(current) can be only called by the coredumping thread via
regset->get(). But it is exported to modules, and imo this should be
fixed anyway.
And if we check use_eager_fpu() we can use __save_fpu() like fpu_copy()
and save_init_fpu() do.
- It seems that even !use_eager_fpu() case doesn't need the unconditional
__thread_fpu_end(), we only need it if __save_init_fpu() returns 0.
- It is still not clear to me if __save_init_fpu() can safely nest with
another save + restore from __kernel_fpu_begin(). If not, we can use
kernel_fpu_disable() to fix the race.
Signed-off-by: Oleg Nesterov <[email protected]>
Signed-off-by: Rik van Riel <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Borislav Petkov <[email protected]>
Diffstat (limited to 'drivers/mtd/lpddr/lpddr_cmds.c')
0 files changed, 0 insertions, 0 deletions