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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1214582351 -3600
# Node ID 13884410677b6319b522180d3f2582b1347d5a28
# Parent  58bf50a2c75467aaf3d1d789f28a4d070f69905e
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-unstable changeset:   17864:4bb8a4f66eff8ef4cddc4505a09782fb783c16d5
xen-unstable date:        Mon Jun 16 15:22:41 2008 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -r 58bf50a2c754 -r 13884410677b xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Thu Jun 19 11:15:57 2008 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Fri Jun 27 16:59:11 2008 +0100
@@ -697,7 +697,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;
@@ -904,6 +904,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®.