exporting patch: # HG changeset patch # User Wei Huang # Date 1293045835 21600 # Branch lwp2 # Node ID f963fa2d256d6af97e8b079191657bf55555e416 # Parent 77e98097afc63c774b329343788f71495a7e5934 Add LWP (bit 62) to XSTATE_MASK definition diff -r 77e98097afc6 -r f963fa2d256d xen/arch/x86/i387.c --- a/xen/arch/x86/i387.c Wed Dec 22 12:18:18 2010 -0600 +++ b/xen/arch/x86/i387.c Wed Dec 22 13:23:55 2010 -0600 @@ -187,7 +187,7 @@ * Set CR4_OSXSAVE and run "cpuid" to get xsave_cntxt_size. */ set_in_cr4(X86_CR4_OSXSAVE); - set_xcr0(eax & XCNTXT_MASK); + set_xcr0((((u64)edx << 32) | eax) & XCNTXT_MASK); cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx); if ( cpu == 0 ) diff -r 77e98097afc6 -r f963fa2d256d xen/include/asm-x86/i387.h --- a/xen/include/asm-x86/i387.h Wed Dec 22 12:18:18 2010 -0600 +++ b/xen/include/asm-x86/i387.h Wed Dec 22 13:23:55 2010 -0600 @@ -22,11 +22,12 @@ int xsave_alloc_save_area(struct vcpu *v); void xsave_free_save_area(struct vcpu *v); -#define XSTATE_FP (1 << 0) -#define XSTATE_SSE (1 << 1) -#define XSTATE_YMM (1 << 2) +#define XSTATE_FP (1ULL << 0) +#define XSTATE_SSE (1ULL << 1) +#define XSTATE_YMM (1ULL << 2) +#define XSTATE_LWP (1ULL << 62) /* AMD lightweight profiling */ #define XSTATE_FP_SSE (XSTATE_FP | XSTATE_SSE) -#define XCNTXT_MASK (XSTATE_FP | XSTATE_SSE | XSTATE_YMM) +#define XCNTXT_MASK (XSTATE_FP | XSTATE_SSE | XSTATE_YMM | XSTATE_LWP) #define XSTATE_YMM_OFFSET (512 + 64) #define XSTATE_YMM_SIZE 256 #define XSAVEOPT (1 << 0)