[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150114184343.GA17640@redhat.com>
Date: Wed, 14 Jan 2015 19:43:43 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: riel@...hat.com
Cc: linux-kernel@...r.kernel.org, mingo@...hat.com, hpa@...or.com,
matt.fleming@...el.com, bp@...e.de, pbonzini@...hat.com,
tglx@...utronix.de, luto@...capital.net
Subject: Re: [RFC PATCH 08/11] x86,fpu: restore user FPU state lazily after
__kernel_fpu_end
On 01/11, riel@...hat.com wrote:
>
> --- a/arch/x86/kernel/i387.c
> +++ b/arch/x86/kernel/i387.c
> @@ -89,13 +89,11 @@ void __kernel_fpu_end(void)
> if (use_eager_fpu()) {
> /*
> * For eager fpu, most the time, tsk_used_math() is true.
> - * Restore the user math as we are done with the kernel usage.
> - * At few instances during thread exit, signal handling etc,
> - * tsk_used_math() is false. Those few places will take proper
> - * actions, so we don't need to restore the math here.
> + * Make sure the user math state is restored on return to
> + * userspace.
> */
> if (likely(tsk_used_math(current)))
> - math_state_restore();
> + set_thread_flag(TIF_LOAD_FPU);
Hmm. And this looks obviously wrong if interrupted_user_mode().
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists