ia64/xen-unstable

changeset 5763:6778d68a2c4c

Need to save and restore MSRs for VMX domains across context switches.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Jul 13 08:36:38 2005 +0000 (2005-07-13)
parents 3a4ef6acd545
children 5db799f4c40e
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Wed Jul 13 08:25:08 2005 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Wed Jul 13 08:36:38 2005 +0000
     1.3 @@ -643,6 +643,10 @@ static void load_segments(struct vcpu *p
     1.4  static void save_segments(struct vcpu *v)
     1.5  {
     1.6      struct cpu_user_regs *regs = &v->arch.guest_context.user_regs;
     1.7 +
     1.8 +    if ( VMX_DOMAIN(v) )
     1.9 +        rdmsrl(MSR_SHADOW_GS_BASE, v->arch.arch_vmx.msr_content.shadow_gs);
    1.10 +
    1.11      __asm__ __volatile__ ( "movl %%ds,%0" : "=m" (regs->ds) );
    1.12      __asm__ __volatile__ ( "movl %%es,%0" : "=m" (regs->es) );
    1.13      __asm__ __volatile__ ( "movl %%fs,%0" : "=m" (regs->fs) );
    1.14 @@ -791,7 +795,11 @@ void context_switch(struct vcpu *prev, s
    1.15  
    1.16          local_irq_enable();
    1.17          
    1.18 -        if ( !VMX_DOMAIN(next) )
    1.19 +        if ( VMX_DOMAIN(next) )
    1.20 +        {
    1.21 +            vmx_restore_msrs(next);
    1.22 +        }
    1.23 +        else
    1.24          {
    1.25              load_LDT(next);
    1.26              load_segments(realprev, next);