[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] vmx: Allow restore of context from a non-Intel processor. In



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1213626161 -3600
# Node ID 4bb8a4f66eff8ef4cddc4505a09782fb783c16d5
# Parent  20d20a4858d6b1b833af3dddc317d20d30fb82d3
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@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -r 20d20a4858d6 -r 4bb8a4f66eff xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Mon Jun 16 15:21:49 2008 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Mon Jun 16 15:22:41 2008 +0100
@@ -616,7 +616,7 @@ static void vmx_load_cpu_state(struct vc
     struct vmx_msr_state *guest_state = &v->arch.hvm_vmx.msr_state;
 
     /* restore msrs */
-    guest_state->flags = data->msr_flags;
+    guest_state->flags = data->msr_flags & 7;
     guest_state->msrs[VMX_INDEX_MSR_LSTAR]        = data->msr_lstar;
     guest_state->msrs[VMX_INDEX_MSR_STAR]         = data->msr_star;
     guest_state->msrs[VMX_INDEX_MSR_SYSCALL_MASK] = data->msr_syscall_mask;
@@ -790,6 +790,9 @@ static void vmx_set_segment_register(str
     /* Not-present must mean unusable. */
     if ( !reg->attr.fields.p )
         attr |= (1u << 16);
+
+    /* VMX has strict consistency requirement for flag G. */
+    attr |= !!(reg->limit >> 20) << 15;
 
     vmx_vmcs_enter(v);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.