X-Git-Url: http://git.onelab.eu/?p=linux-2.6.git;a=blobdiff_plain;f=arch%2Fi386%2Fmath-emu%2Ffpu_entry.c;fp=arch%2Fi386%2Fmath-emu%2Ffpu_entry.c;h=a0f1cab20cecd82af9243ec0e33b5f7d27add1fb;hp=d93f16ef828f5986f7930b4aabbdd55ca92fd9cb;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hpb=76828883507a47dae78837ab5dec5a5b4513c667 diff --git a/arch/i386/math-emu/fpu_entry.c b/arch/i386/math-emu/fpu_entry.c index d93f16ef8..a0f1cab20 100644 --- a/arch/i386/math-emu/fpu_entry.c +++ b/arch/i386/math-emu/fpu_entry.c @@ -25,7 +25,6 @@ +---------------------------------------------------------------------------*/ #include -#include #include #include @@ -211,9 +210,8 @@ asmlinkage void math_emulate(long arg) if ( code_limit < code_base ) code_limit = 0xffffffff; } - FPU_lookahead = 1; - if (current->ptrace & PT_PTRACED) - FPU_lookahead = 0; + /* Don't run ahead if single-stepping. */ + FPU_lookahead = (FPU_EFLAGS & X86_EFLAGS_TF) == 0; if ( !valid_prefix(&byte1, (u_char __user **)&FPU_EIP, &addr_modes.override) ) @@ -742,7 +740,8 @@ int save_i387_soft(void *s387, struct _fpstate __user * buf) S387->fcs &= ~0xf8000000; S387->fos |= 0xffff0000; #endif /* PECULIAR_486 */ - __copy_to_user(d, &S387->cwd, 7*4); + if (__copy_to_user(d, &S387->cwd, 7*4)) + return -1; RE_ENTRANT_CHECK_ON; d += 7*4;