ia64/xen-unstable

changeset 18813:4107618ee0d8

x86: support CPUID hypervisor feature bit

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Nov 19 16:10:39 2008 +0000 (2008-11-19)
parents 4c67985c552e
children bddd2d344c54
files tools/libxc/xc_cpufeature.h tools/libxc/xc_cpuid_x86.c xen/arch/x86/traps.c xen/include/asm-x86/cpufeature.h
line diff
     1.1 --- a/tools/libxc/xc_cpufeature.h	Wed Nov 19 13:17:31 2008 +0000
     1.2 +++ b/tools/libxc/xc_cpufeature.h	Wed Nov 19 16:10:39 2008 +0000
     1.3 @@ -83,6 +83,7 @@
     1.4  #define X86_FEATURE_SSE4_1	(4*32+19) /* Streaming SIMD Extensions 4.1 */
     1.5  #define X86_FEATURE_SSE4_2	(4*32+20) /* Streaming SIMD Extensions 4.2 */
     1.6  #define X86_FEATURE_POPCNT	(4*32+23) /* POPCNT instruction */
     1.7 +#define X86_FEATURE_HYPERVISOR	(4*32+31) /* Running under some hypervisor */
     1.8  
     1.9  /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
    1.10  #define X86_FEATURE_XSTORE	(5*32+ 2) /* on-CPU RNG present (xstore insn) */
     2.1 --- a/tools/libxc/xc_cpuid_x86.c	Wed Nov 19 13:17:31 2008 +0000
     2.2 +++ b/tools/libxc/xc_cpuid_x86.c	Wed Nov 19 16:10:39 2008 +0000
     2.3 @@ -194,6 +194,8 @@ static void xc_cpuid_hvm_policy(
     2.4                      bitmaskof(X86_FEATURE_SSE4_2) |
     2.5                      bitmaskof(X86_FEATURE_POPCNT));
     2.6  
     2.7 +        regs[2] |= bitmaskof(X86_FEATURE_HYPERVISOR);
     2.8 +
     2.9          regs[3] &= (bitmaskof(X86_FEATURE_FPU) |
    2.10                      bitmaskof(X86_FEATURE_VME) |
    2.11                      bitmaskof(X86_FEATURE_DE) |
    2.12 @@ -309,6 +311,7 @@ static void xc_cpuid_pv_policy(
    2.13          clear_bit(X86_FEATURE_XTPR, regs[2]);
    2.14          clear_bit(X86_FEATURE_PDCM, regs[2]);
    2.15          clear_bit(X86_FEATURE_DCA, regs[2]);
    2.16 +        set_bit(X86_FEATURE_HYPERVISOR, regs[2]);
    2.17          break;
    2.18      case 0x80000001:
    2.19          if ( !guest_64bit )
     3.1 --- a/xen/arch/x86/traps.c	Wed Nov 19 13:17:31 2008 +0000
     3.2 +++ b/xen/arch/x86/traps.c	Wed Nov 19 16:10:39 2008 +0000
     3.3 @@ -755,6 +755,7 @@ static void pv_cpuid(struct cpu_user_reg
     3.4          __clear_bit(X86_FEATURE_XTPR % 32, &c);
     3.5          __clear_bit(X86_FEATURE_PDCM % 32, &c);
     3.6          __clear_bit(X86_FEATURE_DCA % 32, &c);
     3.7 +        __set_bit(X86_FEATURE_HYPERVISOR % 32, &c);
     3.8          break;
     3.9      case 0x80000001:
    3.10          /* Modify Feature Information. */
     4.1 --- a/xen/include/asm-x86/cpufeature.h	Wed Nov 19 13:17:31 2008 +0000
     4.2 +++ b/xen/include/asm-x86/cpufeature.h	Wed Nov 19 16:10:39 2008 +0000
     4.3 @@ -94,6 +94,7 @@
     4.4  #define X86_FEATURE_SSE4_2	(4*32+20) /* Streaming SIMD Extensions 4.2 */
     4.5  #define X86_FEATURE_X2APIC	(4*32+21) /* Extended xAPIC */
     4.6  #define X86_FEATURE_POPCNT	(4*32+23) /* POPCNT instruction */
     4.7 +#define X86_FEATURE_HYPERVISOR	(4*32+31) /* Running under some hypervisor */
     4.8  
     4.9  /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
    4.10  #define X86_FEATURE_XSTORE	(5*32+ 2) /* on-CPU RNG present (xstore insn) */