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-users

[Xen-users] xen guest detection.

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] xen guest detection.
From: "Michael Closson" <closms@xxxxxxxxx>
Date: Tue, 18 Mar 2008 10:46:43 -0400
Delivery-date: Tue, 18 Mar 2008 07:47:19 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=v/FBcmMZwI5lAhhR9ZnywAz3GCg8cCsMyvoY+YppqpA=; b=A27Nq7KzfhdqsUAds0h3z2QG7pkL4ezoGgFnpVBueDEhfmGInKmPSYsj9VjNgZvYVjTLJ9FVoFX5YdhYeIpGuRTEQQM/41gyGI5GCOKbkcbpYcUuUvz4iJdZJtbr+8QOpd/pabYcCLgQ6F+sLXfRIGmw/6CRYbUQbtM3jc4hKSQ=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=x3Qqf56+UIGtjUE2uPz8MGToPHALXfxDQYm74GqVL5Yc+jdinP3hNR2FpqO4OIFWBxfkCsg5hZOyXE9e4+f9LmmUq+6s2PtIqDKF/lS8Xc2iVclcLNPFibV773D4hLd2nsKQ+N1gXlKF6zPtfkgKyJi2bMRp4kr8pzLQM4qLLps=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Hey All,
 
I'm working on robust way for a process to be able to detect that it is running in xen guest, and distinguish between a para-vitualized and fully-virtualized environment.
 
Here are the clues I can use:
 
#1) If I pin a process to a specific virtual cpu with sched_setaffinity() and then fetch the proccesors local apic id with the cpuid instruction, multiple calls will/may give me different ids since the xen hypervisor doesn't always map the same virtual cpu to the same physical cpu.
 
This method isn't very robust.  Say a in-guest process runs cpuid multiple times and always gets the same apic id.  Maybe there is only one processor on the host and maybe the hypervisor just keeps mapping the virtual cpu to the same physical cpu for each call.
 
#2) I noticed that in a para-virt environment, the motherboard BIOS area in physical ram (64k starting at 0xf0000) is all zeros.  But can I count on this to be the same for future versions of xen?
 
#3) Check the existence of /proc/xen and the absence of xend/the xend xmlrpc socket.  This method is a little bit error prone because paths may change (Xen installation may be redhat or xen enterprise).  Other proccesses may match "xend".  How can I distinguish the two cases: 1) baremetal + xen enabled kernel but xend is not installed  2) a real xen guest environment.
 
#4) Check if the virtual ethernet hw address is a xen address.  But I think users can just specify there own ethernet hw address.
 
 
Thoughts?
 
I'm leaning toward #2 or #3.
 
Thanks Ahead!
Mike Closson
 
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
<Prev in Thread] Current Thread [Next in Thread>