# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1227111039 0
# Node ID 4107618ee0d8aceb517f43ffa79197a041ed4bcf
# Parent 4c67985c552e88c03b0d446f34c47bd382d2d702
x86: support CPUID hypervisor feature bit
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
tools/libxc/xc_cpufeature.h | 1 +
tools/libxc/xc_cpuid_x86.c | 3 +++
xen/arch/x86/traps.c | 1 +
xen/include/asm-x86/cpufeature.h | 1 +
4 files changed, 6 insertions(+)
diff -r 4c67985c552e -r 4107618ee0d8 tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h Wed Nov 19 13:17:31 2008 +0000
+++ b/tools/libxc/xc_cpufeature.h Wed Nov 19 16:10:39 2008 +0000
@@ -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 -r 4c67985c552e -r 4107618ee0d8 tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c Wed Nov 19 13:17:31 2008 +0000
+++ b/tools/libxc/xc_cpuid_x86.c Wed Nov 19 16:10:39 2008 +0000
@@ -193,6 +193,8 @@ static void xc_cpuid_hvm_policy(
bitmaskof(X86_FEATURE_SSE4_1) |
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) |
@@ -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 )
diff -r 4c67985c552e -r 4107618ee0d8 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c Wed Nov 19 13:17:31 2008 +0000
+++ b/xen/arch/x86/traps.c Wed Nov 19 16:10:39 2008 +0000
@@ -755,6 +755,7 @@ static void pv_cpuid(struct cpu_user_reg
__clear_bit(X86_FEATURE_XTPR % 32, &c);
__clear_bit(X86_FEATURE_PDCM % 32, &c);
__clear_bit(X86_FEATURE_DCA % 32, &c);
+ __set_bit(X86_FEATURE_HYPERVISOR % 32, &c);
break;
case 0x80000001:
/* Modify Feature Information. */
diff -r 4c67985c552e -r 4107618ee0d8 xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h Wed Nov 19 13:17:31 2008 +0000
+++ b/xen/include/asm-x86/cpufeature.h Wed Nov 19 16:10:39 2008 +0000
@@ -94,6 +94,7 @@
#define X86_FEATURE_SSE4_2 (4*32+20) /* Streaming SIMD Extensions 4.2 */
#define X86_FEATURE_X2APIC (4*32+21) /* Extended xAPIC */
#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) */
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|