public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux@sandersweb.net
Cc: linux-kernel@vger.kernel.org,
	the arch/x86 maintainers <x86@kernel.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] x86: Don't use NOPL on 32-bit cpu's because not all systems support it.
Date: Tue, 16 Sep 2008 11:03:23 -0700	[thread overview]
Message-ID: <48CFF4EB.1050401@zytor.com> (raw)
In-Reply-To: <200809161348.24130.linux@sandersweb.net>

> 
> I think you still want the nopl enabled for 64-bits.
> 

Yes.  Accordingly, I didn't change 64 bits.

> int main()
> {
> 	signal(SIGILL, except);
> 	asm("\n"
> 		"mov $0x01, %eax\n" /* function number */
> 		".byte 0x0f, 0x3f, 0x07, 0x0b\n" /* call VPC */
> 	   );
> 	printf("Inside Virtual PC\n");
> 	return 0;
> }

Well, isn't that "interesting".  0F 3F is in the range expected 
(although not documented) to be used for 3-byte opcode prefixes in the 
future.  It's also the Centaur ALTINST instruction (which I believe have 
to be enabled via an MSR, so in that way it's not a bad choice.)

It's definitely less broken than the official way to detect VMWare, but 
still pretty daft.  (CPUID, MSR or PCI IDs make a lot more sense.)

The "official" way to detect Virtual PC is apparently to look for 
"Microsoft Corportation" as the DMI motherboard manufacturer.  This is 
downright dangerously stupid, since Microsoft likes to make false starts 
in the hardware business on a regular basis, and doesn't work with old 
Connectix VPC anyway.  However, there is supposedly "Virtual Machine" as 
the model, which can be used to disambiguate.

	-hpa

      reply	other threads:[~2008-09-16 18:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-16 15:59 [PATCH] x86: Don't use NOPL on 32-bit cpu's because not all systems support it David Sanders
2008-09-16 16:32 ` H. Peter Anvin
2008-09-16 17:00   ` Alan Cox
2008-09-16 17:28     ` H. Peter Anvin
2008-09-16 17:50     ` David Sanders
2008-09-16 17:48   ` David Sanders
2008-09-16 18:03     ` H. Peter Anvin [this message]

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=48CFF4EB.1050401@zytor.com \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@sandersweb.net \
    --cc=mingo@elte.hu \
    --cc=x86@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