WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Problem with CPUID getting information in hvm guest
From: 胡少龙 <sunofblack@xxxxxxxx>
Date: Sun, 16 May 2010 19:39:57 -0700 (PDT)
Delivery-date: Wed, 02 Jun 2010 10:34:05 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.cn; s=s1024; t=1274063997; bh=HZET8qykFfm3Fif5JhRlp9MxUIrp2PKxjMQwYXCOzaU=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=Scxce0axm37WBHMiSTON+PUviljWpm9Yi9TCPI+LRQKHnOWM8q75e0eRilci41GxGTC3tDml8fwZrfUyzIpzWmzlYOTvHVtwqOAC6dvJQieh0jr5XUa976yDO35ByD932kpdYQD5tFn+VP2dzEY+4WzjMvqPue25qN52QCQWzXU=
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=;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>