[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Problem with CPUID getting information in hvm guest


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: èåé <sunofblack@xxxxxxxx>
  • Date: Sun, 16 May 2010 19:39:57 -0700 (PDT)
  • Delivery-date: Wed, 02 Jun 2010 10:34:05 -0700
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.cn; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=M9qRSZhAbaaBKO+zsLdfQdrUC7zciMSmQfabDPpYiOjqVx1gBaX52Neqf7q1xrWB2ovxZCcqCoz46bGXXy/CCxbTWjpOGWjFOPkFH0aaqlb4XdsHtaCWyoj6wEjY0G3kiw6zUl6/GekhEeXr602VwTwb6kvhYSjdIDSZKmzMeoU=;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi,
I am using fellowing code get xen vmm string , but came out with "GenuntelineI", not "XenVMMXenVMM", i am using xen 3.41 on ubuntu 8.04 ,is some thing changed ? Thx.
 
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
typedef union
{
 uint32_t r[3];
 char string[12];
}cpuid_t;
#define CPUID(command,result) \
    __asm __volatile(\
  "CPUID"\
  : "=b"(result.r[0]),"=c"(cpu.r[1]),"=d"(cpu.r[2])\
  : "a"(command));
int main(void)
{
 cpuid_t cpu;
 CPUID(0,cpu);
 printf("cpu.string=%s\n",cpu.string);
 if(strncmp(cpu.string,"XenVMMXenVMM",12)==0)
 {
  printf("Running as a Xen HVM guest\n");
 }
 else
 {
  printf("Running on native hardware or a non Xen hypervisor\n");
 }
 return 0;
}

 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.