All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: Detect Vanerpool
Date: 08 Mar 2006 14:21:57 +0100	[thread overview]
Message-ID: <p73k6b5f4wa.fsf@verdi.suse.de> (raw)
In-Reply-To: <1deaeb8463d1e484ac3a2503bcad2d25@cl.cam.ac.uk>

Keir Fraser <Keir.Fraser@cl.cam.ac.uk> 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 <stdio.h>

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");
}

  reply	other threads:[~2006-03-08 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-07 22:53 Detect Vanerpool gimli
2006-03-08  8:43 ` Keir Fraser
2006-03-08 13:21   ` Andi Kleen [this message]
2006-03-08  9:35 ` Thorolf Godawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=p73k6b5f4wa.fsf@verdi.suse.de \
    --to=ak@suse.de \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.