Jeff, Eli,

Am 18.03.2016 um 17:42 schrieb Jeff Dike:
> On Sat, Mar 19, 2016 at 12:13:47AM +0800, Eli Cooper wrote:
>> I agree that we should keep userspace() minimal. So what in the first
>> place is the FPU state save/restore code for? Or, what (except for
>> sigreturn) could possibly mess the FPU state of the ptrace'd process
>> without it?
> 
> My (vague) recollection was that with libc in there, I couldn't be
> confident that it wouldn't unexpectedly use FP for something.  So,
> saving and restoring FP state was a hedge against that happening.
> 
>                               Jeff
> 

git blame points to:
commit fbfe9c847edf57ac8232aeafb290f272289893a3
Author: Ingo van Lil <ing...@gmx.de>
Date:   Wed Sep 14 16:21:23 2011 -0700

    um: Save FPU registers between task switches

    Some time ago Jeff prepared 42daba316557 ("uml: stop saving process FP
    state") for UML to stop saving the process FP state between task
    switches.  The assumption was that since with SKAS0 every guest process
    runs inside a host process context the host OS will take care of keeping
    the proper FP state.

    Unfortunately this is not true for multi-threaded applications, where
    all guest threads share a single host process context yet all may use
    the FPU on their own.  Although I haven't verified it I suspect things
    to be even worse in SKAS3 mode where all guest processes run inside a
    single host process.

    The patch reintroduces the saving and restoring of the FP context
    between task switches.

    [rich...@nod.at: Ingo posted this patch in 2009, sadly it was never applied
    and got lost. Now in 2011 the problem was reported by Gunnar.]

    Signed-off-by: Ingo van Lil <ing...@gmx.de>
    Signed-off-by: Richard Weinberger <rich...@nod.at>
    Reported-by: <gunnarlindr...@hotmail.com>
    Tested-by: <gunnarlindr...@hotmail.com>
    Cc: Stanislav Meduna <st...@meduna.org>
    Signed-off-by: Andrew Morton <a...@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>

So, it is not that easy. :=)

Thanks,
//richard

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to