lkml.org 
[lkml]   [2012]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subjectptrace && fpu_lazy_restore
    Credits to Jan and Chuck, see

    https://bugzilla.redhat.com/show_bug.cgi?id=810668

    with reproducer:

    https://bugzilla.redhat.com/attachment.cgi?id=577270

    But afaics the root of the problem is clear. Once PTRACE_SETFPREGS
    changes fpu.state->fxsave the task obviously needs restore_fpu_checking()
    on context switch.

    But I am not sure about the fix, and in any case I need more time
    to read this new code.

    Oleg.

    --- x/arch/x86/kernel/i387.c~ 2012-04-09 20:12:12.000000000 +0200
    +++ x/arch/x86/kernel/i387.c 2012-04-15 01:34:09.000000000 +0200
    @@ -301,6 +301,8 @@ int xfpregs_set(struct task_struct *targ

    sanitize_i387_state(target);

    + target->thread.fpu.last_cpu = ~0;
    +
    ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
    &target->thread.fpu.state->fxsave, 0, -1);

    @@ -563,6 +565,8 @@ int fpregs_set(struct task_struct *targe

    sanitize_i387_state(target);

    + target->thread.fpu.last_cpu = ~0;
    +
    if (!HAVE_HWFP)
    return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf);



    \
     
     \ /
      Last update: 2012-04-15 01:55    [W:0.021 / U:0.368 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site