public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: Brian Gerst <brgerst@gmail.com>
Cc: hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 05/12] x86-64: Disable preemption when using TS_USEDFPU
Date: Sat, 04 Sep 2010 09:47:47 +0300	[thread overview]
Message-ID: <4C81EB93.4090304@kernel.org> (raw)
In-Reply-To: <1283563039-3466-6-git-send-email-brgerst@gmail.com>

  On 4.9.2010 4.17, Brian Gerst wrote:
> Consolidates code and fixes the below race for 64-bit.
>
> commit 9fa2f37bfeb798728241cc4a19578ce6e4258f25
> Author: torvalds<torvalds>
> Date:   Tue Sep 2 07:37:25 2003 +0000
>
>      Be a lot more careful about TS_USEDFPU and preemption
>
>      We had some races where we testecd (or set) TS_USEDFPU together
>      with sequences that depended on the setting (like clearing or
>      setting the TS flag in %cr0) and we could be preempted in between,
>      which screws up the FPU state, since preemption will itself change
>      USEDFPU and the TS flag.
>
>      This makes it a lot more explicit: the "internal" low-level FPU
>      functions ("__xxxx_fpu()") all require preemption to be disabled,
>      and the exported "real" functions will make sure that is the case.
>
>      One case - in __switch_to() - was switched to the non-preempt-safe
>      internal version, since the scheduler itself has already disabled
>      preemption.
>
>      BKrev: 3f5448b5WRiQuyzAlbajs3qoQjSobw
>
> Signed-off-by: Brian Gerst<brgerst@gmail.com>
Acked-by: Pekka Enberg <penberg@kernel.org>


  reply	other threads:[~2010-09-04  6:48 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-04  1:17 [PATCH 0/12] x86 FPU cleanups (v2) Brian Gerst
2010-09-04  1:17 ` [PATCH 01/12] x86: Use correct type for %cr4 Brian Gerst
2010-09-04  6:45   ` Pekka Enberg
2010-09-10  1:46   ` [tip:x86/fpu] " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 02/12] x86: Merge fpu_init() Brian Gerst
2010-09-04  6:45   ` Pekka Enberg
2010-09-10  1:46   ` [tip:x86/fpu] x86, fpu: " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 03/12] x86: Merge tolerant_fwait() Brian Gerst
2010-09-04  6:46   ` Pekka Enberg
2010-09-10  1:46   ` [tip:x86/fpu] x86, fpu: " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 04/12] x86: Merge __save_init_fpu() Brian Gerst
2010-09-04  6:47   ` Pekka Enberg
2010-09-10  1:47   ` [tip:x86/fpu] x86, fpu: " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 05/12] x86-64: Disable preemption when using TS_USEDFPU Brian Gerst
2010-09-04  6:47   ` Pekka Enberg [this message]
2010-09-10  1:47   ` [tip:x86/fpu] x86-64, fpu: " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 06/12] x86-64: Fix %cs value in convert_from_fxsr() Brian Gerst
2010-09-04  6:51   ` Pekka Enberg
2010-09-10  1:47   ` [tip:x86/fpu] x86-64, fpu: " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 07/12] x86-64: Simplify constraints for fxsave/fxtstor Brian Gerst
2010-09-04  6:48   ` Pekka Enberg
2010-09-09 21:22   ` H. Peter Anvin
2010-09-09 23:43     ` Brian Gerst
2010-09-10  1:48   ` [tip:x86/fpu] x86-64, fpu: " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 08/12] x86-32: Remove math_emulate stub Brian Gerst
2010-09-04  6:48   ` Pekka Enberg
2010-09-10  1:48   ` [tip:x86/fpu] x86-32, fpu: " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 09/12] x86: Remove unnecessary ifdefs from i387 code Brian Gerst
2010-09-04  6:49   ` Pekka Enberg
2010-09-10  1:48   ` [tip:x86/fpu] x86, fpu: " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 10/12] x86: Remove PSHUFB_XMM5_* macros Brian Gerst
2010-09-04  6:49   ` Pekka Enberg
2010-09-10  1:49   ` [tip:x86/fpu] x86, fpu: " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 11/12] x86-32: Rewrite fpu_save_init() Brian Gerst
2010-09-04  6:51   ` Pekka Enberg
2010-09-10  1:49   ` [tip:x86/fpu] x86-32, fpu: " tip-bot for Brian Gerst
2010-09-04  1:17 ` [PATCH 12/12] x86: Merge fpu_save_init() Brian Gerst
2010-09-04  6:51   ` Pekka Enberg
2010-09-10  1:50   ` [tip:x86/fpu] x86, fpu: " tip-bot for Brian Gerst
2010-09-04  6:45 ` [PATCH 0/12] x86 FPU cleanups (v2) Pekka Enberg

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=4C81EB93.4090304@kernel.org \
    --to=penberg@kernel.org \
    --cc=brgerst@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox