public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: hadi@cyberus.ca
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Suresh Siddha <suresh.b.siddha@intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@novell.com>
Subject: Re: i387/FPU init issues...
Date: Sat, 03 May 2008 11:48:36 -0700	[thread overview]
Message-ID: <481CB384.2070704@zytor.com> (raw)
In-Reply-To: <1209834123.6972.48.camel@localhost>

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

jamal wrote:
> 
> Indeed it does - thanks.
> 
>> Please provide
>> also output of /proc/cpuinfo.
> 
> mambo:~# cat /proc/cpuinfo
> processor       : 0
> vendor_id       : GenuineIntel
> cpu family      : 6
> model           : 3
> model name      : Pentium II (Klamath)
> stepping        : 3
> cpu MHz         : 1063.771
> cache size      : 128 KB
> fdiv_bug        : no
> hlt_bug         : no
> f00f_bug        : no
> coma_bug        : no
> fpu             : yes
> fpu_exception   : yes
> cpuid level     : 2
> wp              : yes
> flags           : fpu de pse tsc msr pae mce cx8 sep pge cmov mmx fxsr
> sse sse2
> bogomips        : 2160.92
> clflush size    : 32
> power management:
> 

This is very odd.

Could you try running the attached C program on this processor and 
report the result?  (Binary included for convenience.)

Arjan: this seems to directly contradict the Intel documentation.  Do 
you have any way to find out what the deal is with this?

	-hpa

[-- Attachment #2: p6nops.c --]
[-- Type: text/x-csrc, Size: 1609 bytes --]

#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#define P6_NOP1 ".byte 0x90\n"
#define P6_NOP2 ".byte 0x66,0x90\n"
#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n"
#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n"
#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n"
#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n"
#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n"
#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n"

static sigjmp_buf bail_buf;

static void sigill(int sig)
{
	(void)sig;
	siglongjmp(bail_buf, 1);
}

static int do_test(int n)
{
	struct sigaction old_sa, sa;
	int err;

	memset(&sa, 0, sizeof sa);
	sa.sa_handler = sigill;
	sigaction(SIGILL, &sa, &old_sa);

	err = sigsetjmp(bail_buf, 1);
	if (!err) {
		switch (n) {
		case -1:
			asm volatile("ud2a"); /* Test the mechanism */
			break;
		case 0:
			asm volatile("");
			break;
		case 1:
			asm volatile(P6_NOP1);
			break;
		case 2:
			asm volatile(P6_NOP2);
			break;
		case 3:
			asm volatile(P6_NOP3);
			break;
		case 4:
			asm volatile(P6_NOP4);
			break;
		case 5:
			asm volatile(P6_NOP5);
			break;
		case 6:
			asm volatile(P6_NOP6);
			break;
		case 7:
			asm volatile(P6_NOP7);
			break;
		case 8:
			asm volatile(P6_NOP8);
			break;
		default:
			abort();
		}
	}

	sigaction(SIGILL, &old_sa, NULL);
	return err;
}

int main(void)
{
	int i;
	int test, err = 0;

	if (!do_test(-1)) {
		printf("Trap mechanism broken!\n");
		return 2;
	}

	for (i = 0; i <= 8; i++) {
		test = do_test(i);
		err |= test;
		printf("Test %d: %s\n", i, test ? "err" : "ok");
	}

	return err;
}

[-- Attachment #3: p6nops --]
[-- Type: application/octet-stream, Size: 10555 bytes --]

  parent reply	other threads:[~2008-05-03 18:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-03 10:32 i387/FPU init issues jamal
2008-05-03 10:57 ` James Courtier-Dutton
2008-05-03 13:53   ` jamal
2008-05-03 15:31 ` Thomas Gleixner
2008-05-03 17:02   ` jamal
2008-05-03 17:34     ` Ingo Molnar
2008-05-03 17:39       ` Thomas Gleixner
2008-05-04 21:31         ` Jan Engelhardt
2008-05-04 21:37           ` H. Peter Anvin
2008-05-05 13:00           ` Lennart Sorensen
2008-05-03 18:48     ` H. Peter Anvin [this message]
2008-05-03 20:07       ` Mikael Pettersson
2008-05-03 20:03     ` H. Peter Anvin
2008-05-03 17:42   ` H. Peter Anvin
2008-05-03 17:50     ` James Courtier-Dutton
2008-05-03 17:51       ` H. Peter Anvin
2008-05-03 18:18     ` Thomas Gleixner
2008-05-03 18:58       ` Mikael Pettersson
2008-05-03 19:03         ` H. Peter Anvin
2008-05-03 19:08         ` H. Peter Anvin
2008-05-03 19:17           ` Thomas Gleixner
2008-05-03 19:24             ` H. Peter Anvin
2008-05-03 19:54               ` Ingo Molnar
2008-05-03 19:56                 ` H. Peter Anvin
2008-05-03 19:49     ` Maciej W. Rozycki
2008-05-03 20:06       ` H. Peter Anvin
2008-05-03 21:17         ` Maciej W. Rozycki
2008-05-03 21:46           ` jamal
     [not found]         ` <Pine.LNX.4.55.0805032209480.20206@c <1209851170.6972.64.camel@localhost>
2008-05-04 13:08           ` Sebastian Herbszt
2008-05-04 15:06             ` jamal
2008-05-04 15:21               ` Sebastian Herbszt
2008-05-04 20:24         ` Arjan van de Ven
2008-05-04 21:07           ` H. Peter Anvin

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=481CB384.2070704@zytor.com \
    --to=hpa@zytor.com \
    --cc=arjan@linux.intel.com \
    --cc=hadi@cyberus.ca \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /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