mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jun Sun <jsun@mvista.com>
To: linux-kernel@vger.kernel.org
Cc: jsun@mvista.com
Subject: [2.5 Question] Is TIF_USEDFPU cleared for a new process?
Date: Fri, 7 Feb 2003 17:13:16 -0800	[thread overview]
Message-ID: <20030207171316.B27605@mvista.com> (raw)

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

                 reply	other threads:[~2003-02-08  1:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20030207171316.B27605@mvista.com \
    --to=jsun@mvista.com \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®