diff options
author | Keir Fraser <keir@xen.org> | 2012-01-22 10:20:03 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2012-01-22 10:20:03 +0000 |
commit | 9346f6cfbfb992b4fb38b802b794f194f1209dbf (patch) | |
tree | 474c02eeb700382ec999001d1ae71a342e0bcb43 /xen/arch/x86/domain.c | |
parent | acbae3dcf66c00c03cfbb07aad2a278b54ab0c08 (diff) | |
download | xen-9346f6cfbfb992b4fb38b802b794f194f1209dbf.tar.gz xen-9346f6cfbfb992b4fb38b802b794f194f1209dbf.tar.bz2 xen-9346f6cfbfb992b4fb38b802b794f194f1209dbf.zip |
x86/hvm: No need to arch_set_info_guest() before restoring per-vcpu HVM state.
Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/domain.c')
-rw-r--r-- | xen/arch/x86/domain.c | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 0c85cbb130..61d83c859f 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -709,13 +709,7 @@ CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt); #undef xen_vcpu_guest_context #endif -/* - * This is called by do_domctl(XEN_DOMCTL_setvcpucontext, ...), boot_vcpu(), - * and hvm_load_cpu_ctxt(). - * - * Note that for a HVM guest NULL may be passed for the context pointer, - * meaning "use current values". - */ +/* Called by XEN_DOMCTL_setvcpucontext and VCPUOP_initialise. */ int arch_set_info_guest( struct vcpu *v, vcpu_guest_context_u c) { @@ -735,7 +729,7 @@ int arch_set_info_guest( #else #define c(fld) (c.nat->fld) #endif - flags = c.nat ? c(flags) : v->arch.vgc_flags; + flags = c(flags); if ( !is_hvm_vcpu(v) ) { @@ -791,28 +785,25 @@ int arch_set_info_guest( v->arch.vgc_flags = flags; - if ( c.nat ) + memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt)); + if ( !compat ) { - memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt)); - if ( !compat ) - { - memcpy(&v->arch.user_regs, &c.nat->user_regs, sizeof(c.nat->user_regs)); - if ( !is_hvm_vcpu(v) ) - memcpy(v->arch.pv_vcpu.trap_ctxt, c.nat->trap_ctxt, - sizeof(c.nat->trap_ctxt)); - } + memcpy(&v->arch.user_regs, &c.nat->user_regs, sizeof(c.nat->user_regs)); + if ( !is_hvm_vcpu(v) ) + memcpy(v->arch.pv_vcpu.trap_ctxt, c.nat->trap_ctxt, + sizeof(c.nat->trap_ctxt)); + } #ifdef CONFIG_COMPAT - else - { - XLAT_cpu_user_regs(&v->arch.user_regs, &c.cmp->user_regs); - for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i ) - XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i, - c.cmp->trap_ctxt + i); - } -#endif - for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i ) - v->arch.debugreg[i] = c(debugreg[i]); + else + { + XLAT_cpu_user_regs(&v->arch.user_regs, &c.cmp->user_regs); + for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i ) + XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i, + c.cmp->trap_ctxt + i); } +#endif + for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i ) + v->arch.debugreg[i] = c(debugreg[i]); v->arch.user_regs.eflags |= 2; |