]> xenbits.xen.org Git - xenclient/toolstack.git/commitdiff
Force the HYPERVISOR CPUID bit for hvm guest.
authorJean Guyader <jean.guyader@eu.citrix.com>
Tue, 15 Sep 2009 10:18:29 +0000 (11:18 +0100)
committerJean Guyader <jean.guyader@eu.citrix.com>
Tue, 15 Sep 2009 10:18:29 +0000 (11:18 +0100)
libs/xc/xc_cpufeature.h
libs/xc/xc_cpuid.h

index 6cd442cfe697c43a3dd9abec5d51a0eb12384cc9..047a6c9fc797d1d960ece597da45a3f8dca9a4f1 100644 (file)
@@ -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) */
index feba45a2c045f538d3d10d6ba80d08c851b5a590..43743ef558ac92ae242956dbe75e5cc253ad3034 100644 (file)
@@ -75,6 +75,8 @@ static void do_hvm_cpuid_policy(int xc, int domid, uint32_t input, uint32_t regs
                                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) |