All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Jeff Dike <jdike@addtoit.com>, Eli Cooper <elicooper@gmx.com>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] [PATCH] um: fix FPU register double-restore after sigreturn
Date: Fri, 18 Mar 2016 21:12:07 +0100	[thread overview]
Message-ID: <56EC6117.90806@nod.at> (raw)
In-Reply-To: <20160318164243.GA979@parts.user-mode-linux.org>

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 <inguin@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.

    [richard@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 <inguin@gmx.de>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Reported-by: <gunnarlindroth@hotmail.com>
    Tested-by: <gunnarlindroth@hotmail.com>
    Cc: Stanislav Meduna <stano@meduna.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@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	other threads:[~2016-03-18 20:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16  1:25 [uml-devel] [PATCH] um: fix FPU register double-restore after sigreturn Eli Cooper
2016-03-17 22:21 ` Richard Weinberger
2016-03-18  1:41   ` Eli Cooper
2016-03-18  8:20     ` Richard Weinberger
2016-03-18 16:13       ` Eli Cooper
2016-03-18 16:42         ` Jeff Dike
2016-03-18 20:12           ` Richard Weinberger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56EC6117.90806@nod.at \
    --to=richard@nod.at \
    --cc=elicooper@gmx.com \
    --cc=jdike@addtoit.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.