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/arch/x86/domain.c | |
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/arch/x86/domain.c')
-rw-r--r-- | xen/arch/x86/domain.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 5c89197692..48f3487102 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1332,8 +1332,9 @@ static void __context_switch(void) if ( !is_idle_vcpu(n) ) { memcpy(stack_regs, &n->arch.user_regs, CTXT_SWITCH_STACK_BYTES); - if ( xsave_enabled(n) && n->arch.xcr0 != get_xcr0() ) - set_xcr0(n->arch.xcr0); + if ( xsave_enabled(n) && n->arch.xcr0 != get_xcr0() && + !set_xcr0(n->arch.xcr0) ) + BUG(); vcpu_restore_fpu_eager(n); n->arch.ctxt_switch_to(n); } |