diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-11-19 16:10:39 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-11-19 16:10:39 +0000 |
commit | ceb1434f7d3ac4c2b541facc29bef8abf6ae0442 (patch) | |
tree | 80c6786796b45d7f0e44c6c3d3a7ff6066a7e952 /tools | |
parent | e1054557f90f9ec1552fa5e75b302acbd5b069cb (diff) | |
download | xen-ceb1434f7d3ac4c2b541facc29bef8abf6ae0442.tar.gz xen-ceb1434f7d3ac4c2b541facc29bef8abf6ae0442.tar.bz2 xen-ceb1434f7d3ac4c2b541facc29bef8abf6ae0442.zip |
x86: support CPUID hypervisor feature bit
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxc/xc_cpufeature.h | 1 | ||||
-rw-r--r-- | tools/libxc/xc_cpuid_x86.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h index 6cd442cfe6..047a6c9fc7 100644 --- a/tools/libxc/xc_cpufeature.h +++ b/tools/libxc/xc_cpufeature.h @@ -83,6 +83,7 @@ #define X86_FEATURE_SSE4_1 (4*32+19) /* Streaming SIMD Extensions 4.1 */ #define X86_FEATURE_SSE4_2 (4*32+20) /* Streaming SIMD Extensions 4.2 */ #define X86_FEATURE_POPCNT (4*32+23) /* POPCNT instruction */ +#define X86_FEATURE_HYPERVISOR (4*32+31) /* Running under some hypervisor */ /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ #define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */ diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index 6a8e7594c8..d75fe2b013 100644 --- a/tools/libxc/xc_cpuid_x86.c +++ b/tools/libxc/xc_cpuid_x86.c @@ -194,6 +194,8 @@ static void xc_cpuid_hvm_policy( bitmaskof(X86_FEATURE_SSE4_2) | bitmaskof(X86_FEATURE_POPCNT)); + regs[2] |= bitmaskof(X86_FEATURE_HYPERVISOR); + regs[3] &= (bitmaskof(X86_FEATURE_FPU) | bitmaskof(X86_FEATURE_VME) | bitmaskof(X86_FEATURE_DE) | @@ -309,6 +311,7 @@ static void xc_cpuid_pv_policy( clear_bit(X86_FEATURE_XTPR, regs[2]); clear_bit(X86_FEATURE_PDCM, regs[2]); clear_bit(X86_FEATURE_DCA, regs[2]); + set_bit(X86_FEATURE_HYPERVISOR, regs[2]); break; case 0x80000001: if ( !guest_64bit ) |