Re: [PATCH] x86: Don't use NOPL on 32-bit cpu's because not all systems support it.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Sanders
Date: Tuesday, September 16, 2008 - 10:48 am

On Tuesday 16 September 2008 12:32, H. Peter Anvin wrote:

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

This is how I detect virtual pc.  I based it on a google search.  Microsoft 
itself provides no info:

#include <stdio.h>
#include <signal.h>
#include <stdlib.h>

void except(int e)
{
	printf("Not in Virtual PC\n");
	exit(1);
}

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;
}


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] x86: Don't use NOPL on 32-bit cpu's because no ..., David Sanders, (Tue Sep 16, 10:48 am)