linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.5 Question] Is TIF_USEDFPU cleared for a new process?
@ 2003-02-08  1:13 Jun Sun
  0 siblings, 0 replies; only message in thread
From: Jun Sun @ 2003-02-08  1:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: jsun

In 2.4, this flag is cleared in the common code, copy_flags(), 
when a new process is created.  Not so anymore in 2.5.  I wonder 
if it ever cleared.

I looked at the code (2.5.59) a couple of times and can't seem
to find any place it is cleared for a new process.

Assuming it is not cleared, I am interested in knowing what
would happen, especially in the following scenario:

1) the new process is switched on, runs without using any FPU

2) the new process is switched off.  Because the TIF_USEDFPU
   is set, it will execute 'fnsave' or 'fxsave'.

   a) if FPU is enabled at this moment, we will save bogus FPU
      contents back into new process's thread structure.
   b) if FPU is not enabled, we will go through the trap, restore
      FPU registers from the thread structure, and then save
      the same value back into the thread structure again.

Either a) or b) is bad.  Is this scenario real or just fictitious?

Please cc your reply to my email address.  Thanks.

Jun

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-08  1:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-08  1:13 [2.5 Question] Is TIF_USEDFPU cleared for a new process? Jun Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).