mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@csd.uu.se>
To: jim.houston@comcast.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Pentium Pro - sysenter - doublefault
Date: Thu, 21 Aug 2003 23:32:40 +0200	[thread overview]
Message-ID: <16197.14968.235907.128727@gargle.gargle.HOWL> (raw)
In-Reply-To: <1061498486.3072.308.camel@new.localdomain>

Jim Houston writes:
 > Hi Everyone,
 > 
 > I upgraded my Pentium Pro system to Redhat 9, installed a
 > linux-2.6.0-test3 kernel, and it fails with a double-fault when
 > init starts.
 > 
 > The code which decides if it is o.k. to use sysenter is broken for
 > some Pentium Pro cpus ,in particular, this bit of code from
 > arch/i386/kernel/cpu/intel.c:
 > 
 > 	/* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it */
 > 	if ( c->x86 == 6 && c->x86_model < 3 && c->x86_mask < 3 )
 > 		clear_bit(X86_FEATURE_SEP, c->x86_capability);
 > 
 > On my cpu model=1 and mask=9, it doesn't clear 86_FEATURE_SEP.
 > This results in a double-fault when init starts.  The double-fault
 > happens on the sysexit.  The new double-fault handler caught this
 > nicely, and I was able to debug this with kgdb.
 > 
 > The logic above is exactly what Intel says to do in "IA-32 Intel®
 > Architecture Software Developer's Manual, Volume 2: Instruction Set
 > Reference" on page 3-767.  It also says that sysenter was added to the
 > Pentium II.

I double-checked AP-485 (24161823.pdf, the "real" reference to CPUID),
and it says (section 3.4) that SEP is unsupported when the signature
as a whole is less that 0x633. This means all PPros, and PII Model 3s
with steppings less than 3.

The problem is that the kernel check you quoted above is buggy: the
c->x86_model < 3 && c->x86_mask < 3 part fails for late-stepping PPros
since c->x86_mask >= 3 for them. The test should be rewritten as:

        if (c->x86 == 6 && (c->x86_model < 3 ||
                            (c->x86_model == 3 && c->x86_mask < 3)))
                clear_bit(X86_FEATURE_SEP, c->x86_capability);

/Mikael

  reply	other threads:[~2003-08-21 21:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-21 20:41 Jim Houston
2003-08-21 21:32 ` Mikael Pettersson [this message]
2003-08-22  2:18   ` [PATCH2] " Jim Houston
2003-08-25  5:56   ` [PATCH] " Jamie Lokier
2003-08-25  6:09   ` Jamie Lokier
2003-09-03 12:50     ` Pavel Machek
2003-09-08 14:05       ` Jamie Lokier
2003-08-25  4:05 ` Jamie Lokier
2003-08-25  4:14   ` Jakob Oestergaard
2003-08-25  5:50     ` Jamie Lokier
2003-08-25  6:29       ` Jamie Lokier
2003-08-25  7:49         ` Jakob Oestergaard
2003-08-25 18:15         ` Jim Houston
2003-08-26 12:26   ` Richard Curnow
2003-08-27 14:01     ` Jamie Lokier
2003-08-27 14:23       ` Richard Curnow
2003-08-27 14:25       ` dl-ipaddr
2003-08-27 15:15       ` Stan Bubrouski
2003-08-27 16:02       ` Pasi Savolainen

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=16197.14968.235907.128727@gargle.gargle.HOWL \
    --to=mikpe@csd.uu.se \
    --cc=jim.houston@comcast.net \
    --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®