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

Re: [Xen-users] xen guest detection.


  • To: "Michael Closson" <closms@xxxxxxxxx>
  • From: "Todd Deshane" <deshantm@xxxxxxxxx>
  • Date: Tue, 18 Mar 2008 12:26:03 -0400
  • Cc: xen-users@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 18 Mar 2008 09:26:36 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=ZX60UXLg+N6Q9Ooe9QE76cbz8H/FlU697MYY0JNtxBk58uW3SDcSWxvswcRhPlO44GatHEF4JZf6lWg1SYdJtyyCb52HvIBYZPFGEWNkunBWvP97WfzCbiO1TbDJL8PUGD52sOADDh46NPPWYZeXBCjaqGaufXFG1qIAbXgnEcQ=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>



On Tue, Mar 18, 2008 at 10:46 AM, Michael Closson <closms@xxxxxxxxx> wrote:
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

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

 


Rackspace

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