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

[Xen-changelog] [xen-unstable] [HVM][SVM] Clean up 32bit/64bit guest register code differences.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 571507a595cd63471df9a5ed89db91e7c897714f
# Parent  1da8f53ce65b40c6caaf1bc65c1447efb3810d59
[HVM][SVM] Clean up 32bit/64bit guest register code differences.

Signed-off-by: Tom Woller <thomas.woller@xxxxxxx>
---
 xen/arch/x86/hvm/svm/svm.c |   23 +++++------------------
 1 files changed, 5 insertions(+), 18 deletions(-)

diff -r 1da8f53ce65b -r 571507a595cd xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Tue Jun 27 18:24:08 2006 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c        Wed Jun 28 10:01:18 2006 +0100
@@ -215,17 +215,6 @@ static void svm_store_cpu_guest_regs(
 
     if ( regs != NULL )
     {
-#if defined (__x86_64__)
-        regs->rip    = vmcb->rip;
-        regs->rsp    = vmcb->rsp;
-        regs->rflags = vmcb->rflags;
-        regs->cs     = vmcb->cs.sel;
-        regs->ds     = vmcb->ds.sel;
-        regs->es     = vmcb->es.sel;
-        regs->ss     = vmcb->ss.sel;
-        regs->gs     = vmcb->gs.sel;
-        regs->fs     = vmcb->fs.sel;
-#elif defined (__i386__)
         regs->eip    = vmcb->rip;
         regs->esp    = vmcb->rsp;
         regs->eflags = vmcb->rflags;
@@ -235,14 +224,14 @@ static void svm_store_cpu_guest_regs(
         regs->ss     = vmcb->ss.sel;
         regs->gs     = vmcb->gs.sel;
         regs->fs     = vmcb->fs.sel;
-#endif
     }
 
     if ( crs != NULL )
     {
-        crs[0] = vmcb->cr0;
-        crs[3] = vmcb->cr3;
-        crs[4] = vmcb->cr4;
+        /* Returning the guest's regs */
+        crs[0] = v->arch.hvm_svm.cpu_shadow_cr0;
+        crs[3] = v->arch.hvm_svm.cpu_cr3;
+        crs[4] = v->arch.hvm_svm.cpu_shadow_cr4;
     }
 }
 
@@ -258,13 +247,11 @@ static inline int long_mode_do_msr_read(
 {
     u64 msr_content = 0;
     struct vcpu *vc = current;
-    //    struct svm_msr_state *msr = &vc->arch.hvm_svm.msr_content;
     struct vmcb_struct *vmcb = vc->arch.hvm_svm.vmcb;
 
     switch (regs->ecx)
     {
     case MSR_EFER:
-        // msr_content = msr->msr_items[SVM_INDEX_MSR_EFER];
         msr_content = vmcb->efer;      
         msr_content &= ~EFER_SVME;
         break;
@@ -2583,7 +2570,7 @@ void walk_shadow_and_guest_pt(unsigned l
 
     spte = l1e_empty();
 
-    // This is actually overkill - we only need to make sure the hl2 is 
in-sync.
+    /* This is actually overkill - we only need to make sure the hl2 is 
in-sync. */
     shadow_sync_va(v, gva);
 
     gpte.l1 = 0;

_______________________________________________
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®.