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

Re: [Xen-users] xen guest detection.

To: "Michael Closson" <closms@xxxxxxxxx>
Subject: Re: [Xen-users] xen guest detection.
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=yU77LT8iQPsdp813MUzu2xVfG6L324blY/15HKXwKlE=; b=KxNyK0sry69OpPLhr3I1YOWhTStLyS7bMir7YbEdfzxM4MXzHjMnBIPZZScJ8jz9J+rmGKrHxOXpI1qI5lgYY4xJ9YGZYObEztY60PGQjDlGwPrUe0Gu4JaL54J4s4/PKFUmMTWRTu1TJzbP7ZQcXApuWK86zRSeTDz1cFu3IdE=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1a965ca40803180746w459246b5udf01d17cb4b1d1df@xxxxxxxxxxxxxx>
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>
References: <1a965ca40803180746w459246b5udf01d17cb4b1d1df@xxxxxxxxxxxxxx>
Reply-to: deshantm@xxxxxxxxx
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx


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
<Prev in Thread] Current Thread [Next in Thread>