From: Andi Kleen Subject: Re: Detect Vanerpool Date: 08 Mar 2006 14:21:57 +0100 Message-ID: References: <440E0EED.7090508@dark-green.com> <1deaeb8463d1e484ac3a2503bcad2d25@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <1deaeb8463d1e484ac3a2503bcad2d25@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Keir Fraser writes: > On 7 Mar 2006, at 22:53, gimli wrote: > > > I have a new Intel iMac with the Yonah CPU. How can i determine if > > Vanderpool is enabled or not. What should i see in /proc/cpuinfo ? > > 2.6.16 Linux kernels will list 'vmx' as one of the CPU features. You > cannot determine whether VMX is supported by looking at /proc/cpuinfo > if you are running an earlier kernel. In theory it could be still disabled by someone (e.g. another Hypervisor) in the IA32 FEATURE MSR. On an earlier kernel it can be tested with this simple program (modulo the feature MSR) -Andi /* Detect if machine supports VMX. Written 2005 by Andi Kleen */ #include static inline unsigned int cpuid_ecx(unsigned int op) { unsigned int eax, ecx; __asm__("cpuid" : "=a" (eax), "=c" (ecx) : "0" (op) : "bx", "dx" ); return ecx; } int main(void) { unsigned f = cpuid_ecx(1); if (f & (1<<5)) printf("Machine has VT\n"); else printf("Machine doesn't have VT\n"); }