diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-06-04 17:25:41 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-06-04 17:25:41 +0200 |
commit | 10b2b21a241795394637167bd4b076f2de17741f (patch) | |
tree | 1c69c4e55a295502a3c6c92e5dd359862a95865c /xen/include/asm-x86/xstate.h | |
parent | 10f969150025498fe27d985f9021a68f8c7acc31 (diff) | |
download | xen-10b2b21a241795394637167bd4b076f2de17741f.tar.gz xen-10b2b21a241795394637167bd4b076f2de17741f.tar.bz2 xen-10b2b21a241795394637167bd4b076f2de17741f.zip |
x86: fix XCR0 handling
- both VMX and SVM ignored the ECX input to XSETBV
- both SVM and VMX used the full 64-bit RAX when calculating the input
mask to XSETBV
- faults on XSETBV did not get recovered from
Also consolidate the handling for PV and HVM into a single function,
and make the per-CPU variable "xcr0" static to xstate.c.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Diffstat (limited to 'xen/include/asm-x86/xstate.h')
-rw-r--r-- | xen/include/asm-x86/xstate.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h index 6d64f37827..49168f3293 100644 --- a/xen/include/asm-x86/xstate.h +++ b/xen/include/asm-x86/xstate.h @@ -9,7 +9,6 @@ #define __ASM_XSTATE_H #include <xen/types.h> -#include <xen/percpu.h> #define FCW_DEFAULT 0x037f #define MXCSR_DEFAULT 0x1f80 @@ -34,9 +33,6 @@ #define XSTATE_NONLAZY (XSTATE_LWP) #define XSTATE_LAZY (XSTATE_ALL & ~XSTATE_NONLAZY) -/* extended state variables */ -DECLARE_PER_CPU(uint64_t, xcr0); - extern unsigned int xsave_cntxt_size; extern u64 xfeature_mask; @@ -75,11 +71,12 @@ struct xsave_struct } __attribute__ ((packed, aligned (64))); /* extended state operations */ -void set_xcr0(u64 xfeatures); +bool_t __must_check set_xcr0(u64 xfeatures); uint64_t get_xcr0(void); void xsave(struct vcpu *v, uint64_t mask); void xrstor(struct vcpu *v, uint64_t mask); bool_t xsave_enabled(const struct vcpu *v); +int __must_check handle_xsetbv(u32 index, u64 new_bv); /* extended state init and cleanup functions */ void xstate_free_save_area(struct vcpu *v); |