ia64/xen-unstable

changeset 17870:4bb8a4f66eff

vmx: Allow restore of context from a non-Intel processor. In
particular, VMX requires segment 'granularity' to be set correctly, so
we force it if need be in vmx_set_segment_register().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jun 16 15:22:41 2008 +0100 (2008-06-16)
parents 20d20a4858d6
children 0df3bf8aac1e
files xen/arch/x86/hvm/vmx/vmx.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Mon Jun 16 15:21:49 2008 +0100
     1.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Mon Jun 16 15:22:41 2008 +0100
     1.3 @@ -616,7 +616,7 @@ static void vmx_load_cpu_state(struct vc
     1.4      struct vmx_msr_state *guest_state = &v->arch.hvm_vmx.msr_state;
     1.5  
     1.6      /* restore msrs */
     1.7 -    guest_state->flags = data->msr_flags;
     1.8 +    guest_state->flags = data->msr_flags & 7;
     1.9      guest_state->msrs[VMX_INDEX_MSR_LSTAR]        = data->msr_lstar;
    1.10      guest_state->msrs[VMX_INDEX_MSR_STAR]         = data->msr_star;
    1.11      guest_state->msrs[VMX_INDEX_MSR_SYSCALL_MASK] = data->msr_syscall_mask;
    1.12 @@ -791,6 +791,9 @@ static void vmx_set_segment_register(str
    1.13      if ( !reg->attr.fields.p )
    1.14          attr |= (1u << 16);
    1.15  
    1.16 +    /* VMX has strict consistency requirement for flag G. */
    1.17 +    attr |= !!(reg->limit >> 20) << 15;
    1.18 +
    1.19      vmx_vmcs_enter(v);
    1.20  
    1.21      switch ( seg )