1 /* virt-what-cpuid-helper: Are we running inside KVM or Xen HVM?
2 * Copyright (C) 2008 Red Hat Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* This program was suggested by Gleb Natapov and written by Paolo
20 * Bonzini, with a few modifications by Richard W.M. Jones.
26 #if defined(__i386__) || defined(__x86_64__)
30 unsigned int eax = 0x40000000;
31 unsigned int *sig32 = (unsigned int *)sig;
33 "xor %%ebx, %%ebx; cpuid"
34 : "=a" (eax), "=b" (sig32[0]), "=c" (sig32[1]), "=d" (sig32[2])
42 /* nothing for other architectures */
51 memset (sig, 0, sizeof sig);
58 * XenVMMXenVMM Xen HVM guest
59 * VMwareVMware VMware guest