From e658ee456c3f056c4b29dc675f6b52d550207076 Mon Sep 17 00:00:00 2001 From: Jean Guyader Date: Tue, 15 Sep 2009 11:18:29 +0100 Subject: [PATCH] Force the HYPERVISOR CPUID bit for hvm guest. --- libs/xc/xc_cpufeature.h | 1 + libs/xc/xc_cpuid.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libs/xc/xc_cpufeature.h b/libs/xc/xc_cpufeature.h index 6cd442c..047a6c9 100644 --- a/libs/xc/xc_cpufeature.h +++ b/libs/xc/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/libs/xc/xc_cpuid.h b/libs/xc/xc_cpuid.h index feba45a..43743ef 100644 --- a/libs/xc/xc_cpuid.h +++ b/libs/xc/xc_cpuid.h @@ -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) | -- 2.39.5