ia64/xen-unstable

changeset 10549:571507a595cd

[HVM][SVM] Clean up 32bit/64bit guest register code differences.

Signed-off-by: Tom Woller <thomas.woller@amd.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Jun 28 10:01:18 2006 +0100 (2006-06-28)
parents 1da8f53ce65b
children 2966233d180d
files xen/arch/x86/hvm/svm/svm.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/svm.c	Tue Jun 27 18:24:08 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Wed Jun 28 10:01:18 2006 +0100
     1.3 @@ -215,17 +215,6 @@ static void svm_store_cpu_guest_regs(
     1.4  
     1.5      if ( regs != NULL )
     1.6      {
     1.7 -#if defined (__x86_64__)
     1.8 -        regs->rip    = vmcb->rip;
     1.9 -        regs->rsp    = vmcb->rsp;
    1.10 -        regs->rflags = vmcb->rflags;
    1.11 -        regs->cs     = vmcb->cs.sel;
    1.12 -        regs->ds     = vmcb->ds.sel;
    1.13 -        regs->es     = vmcb->es.sel;
    1.14 -        regs->ss     = vmcb->ss.sel;
    1.15 -        regs->gs     = vmcb->gs.sel;
    1.16 -        regs->fs     = vmcb->fs.sel;
    1.17 -#elif defined (__i386__)
    1.18          regs->eip    = vmcb->rip;
    1.19          regs->esp    = vmcb->rsp;
    1.20          regs->eflags = vmcb->rflags;
    1.21 @@ -235,14 +224,14 @@ static void svm_store_cpu_guest_regs(
    1.22          regs->ss     = vmcb->ss.sel;
    1.23          regs->gs     = vmcb->gs.sel;
    1.24          regs->fs     = vmcb->fs.sel;
    1.25 -#endif
    1.26      }
    1.27  
    1.28      if ( crs != NULL )
    1.29      {
    1.30 -        crs[0] = vmcb->cr0;
    1.31 -        crs[3] = vmcb->cr3;
    1.32 -        crs[4] = vmcb->cr4;
    1.33 +        /* Returning the guest's regs */
    1.34 +        crs[0] = v->arch.hvm_svm.cpu_shadow_cr0;
    1.35 +        crs[3] = v->arch.hvm_svm.cpu_cr3;
    1.36 +        crs[4] = v->arch.hvm_svm.cpu_shadow_cr4;
    1.37      }
    1.38  }
    1.39  
    1.40 @@ -258,13 +247,11 @@ static inline int long_mode_do_msr_read(
    1.41  {
    1.42      u64 msr_content = 0;
    1.43      struct vcpu *vc = current;
    1.44 -    //    struct svm_msr_state *msr = &vc->arch.hvm_svm.msr_content;
    1.45      struct vmcb_struct *vmcb = vc->arch.hvm_svm.vmcb;
    1.46  
    1.47      switch (regs->ecx)
    1.48      {
    1.49      case MSR_EFER:
    1.50 -        // msr_content = msr->msr_items[SVM_INDEX_MSR_EFER];
    1.51          msr_content = vmcb->efer;      
    1.52          msr_content &= ~EFER_SVME;
    1.53          break;
    1.54 @@ -2583,7 +2570,7 @@ void walk_shadow_and_guest_pt(unsigned l
    1.55  
    1.56      spte = l1e_empty();
    1.57  
    1.58 -    // This is actually overkill - we only need to make sure the hl2 is in-sync.
    1.59 +    /* This is actually overkill - we only need to make sure the hl2 is in-sync. */
    1.60      shadow_sync_va(v, gva);
    1.61  
    1.62      gpte.l1 = 0;