James Harper
2007-Sep-21 04:04 UTC
[Xen-devel] How to determine if I am running under Xen?
Does anyone have a code snippet that I could use (in kernel space) to determine if I am running under Xen or not in a HVM domain? Thanks James _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Chris Lalancette
2007-Sep-21 04:30 UTC
Re: [Xen-devel] How to determine if I am running under Xen?
James Harper wrote:> Does anyone have a code snippet that I could use (in kernel space) to > determine if I am running under Xen or not in a HVM domain? > > Thanks > > JamesI don''t have a code snippet....but a script I saw around here basically did "cat /proc/acpi/dsdt | grep xen" to determine whether they were on an HVM domain or not. You can probably pretty easily call the same functions that generate the dsdt from the kernel to determine the information. Chris Lalancette _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2007-Sep-21 06:23 UTC
Re: [Xen-devel] How to determine if I am running under Xen?
On Fri, 2007-09-21 at 14:04 +1000, James Harper wrote:> Does anyone have a code snippet that I could use (in kernel space) to > determine if I am running under Xen or not in a HVM domain?"cpuid eax=0x40000000" will return XenVMMXenVMM in (ebx,ecx,edx) or you could just look for the Xen PCI device -- see unmodified_drivers in the xen source for examples of both. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel