public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@transmeta.com>
To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Cc: Hugh Dickins <hugh@veritas.com>,
	Richard Gooch <rgooch@atnf.csiro.au>,
	linux-kernel@vger.kernel.org
Subject: Re: CPU capabilities -- an update proposal
Date: Fri, 02 Feb 2001 12:40:17 -0800	[thread overview]
Message-ID: <3A7B1B31.1CCED9D9@transmeta.com> (raw)
In-Reply-To: <Pine.GSO.3.96.1010202161941.28509L-100000@delta.ds2.pg.gda.pl>

Hi there,

I like what you have done here, but there are a few things...

> diff -up --recursive --new-file linux-2.4.0-ac12.macro/include/asm-i386/bugs.h linux-2.4.0-ac12/include/asm-i386/bugs.h
> --- linux-2.4.0-ac12.macro/include/asm-i386/bugs.h      Sun Jan 28 09:41:20 2001
> +++ linux-2.4.0-ac12/include/asm-i386/bugs.h    Wed Jan 31 22:18:40 2001
> @@ -83,12 +83,12 @@ static void __init check_fpu(void)
>                 extern void __buggy_fxsr_alignment(void);
>                 __buggy_fxsr_alignment();
>         }
> -       if (cpu_has_fxsr) {
> +       if (boot_has_fxsr) {
>                 printk(KERN_INFO "Enabling fast FPU save and restore... ");
>                 set_in_cr4(X86_CR4_OSFXSR);
>                 printk("done.\n");
>         }
> -       if (cpu_has_xmm) {
> +       if (boot_has_xmm) {
>                 printk(KERN_INFO "Enabling unmasked SIMD FPU exception support... ");
>                 set_in_cr4(X86_CR4_OSXMMEXCPT);
>                 printk("done.\n");

Once you enable OSFXSR (therefore allowing user-space code to issue SSE
instructions) you *have* to save using FXSAVE, which you can only do if
*all* CPUs support FXSR.  Therefore, I would say this is a buggy
change... it is not save to enable OSFXSR unless *all* the CPUs support
FXSR (they don't have to all support SSE, however, although since you
can't control which CPU you execute on, it's pretty useless if they
don't.)

This may mean the code needs to be restructured; I haven't looked at it
in detail.

	-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-02-02 20:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-02 20:22 CPU capabilities -- an update proposal Maciej W. Rozycki
2001-02-02 20:40 ` H. Peter Anvin [this message]
2001-02-03  0:31   ` Hugh Dickins
2001-02-02 23:58 ` Hugh Dickins
2001-02-03  1:14   ` H. Peter Anvin
2001-02-05 13:49   ` Maciej W. Rozycki

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=3A7B1B31.1CCED9D9@transmeta.com \
    --to=hpa@transmeta.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@ds2.pg.gda.pl \
    --cc=rgooch@atnf.csiro.au \
    /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