ia64/xen-unstable

changeset 19662:fe68405201d2

x86: Fix 32-bit build.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed May 27 15:55:29 2009 +0100 (2009-05-27)
parents 326b24bfa9f9
children 8baf03526ab1
files xen/arch/x86/hvm/svm/svm.c xen/arch/x86/x86_emulate/x86_emulate.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/svm.c	Wed May 27 14:03:09 2009 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Wed May 27 15:55:29 2009 +0100
     1.3 @@ -1186,34 +1186,6 @@ static void svm_vmexit_do_rdtsc(struct c
     1.4      hvm_rdtsc_intercept(regs);
     1.5  }
     1.6  
     1.7 -static void svm_dump_regs(const char *from, struct cpu_user_regs *regs)
     1.8 -{
     1.9 -    printk("Dumping guest's current registers at %s...\n", from);
    1.10 -    printk("Size of regs = 0x%lx, address = %p\n",
    1.11 -           sizeof(struct cpu_user_regs), regs);
    1.12 -
    1.13 -    printk("r15 = 0x%016"PRIx64", r14 = 0x%016"PRIx64"\n",
    1.14 -           regs->r15, regs->r14);
    1.15 -    printk("r13 = 0x%016"PRIx64", r12 = 0x%016"PRIx64"\n",
    1.16 -           regs->r13, regs->r12);
    1.17 -    printk("rbp = 0x%016"PRIx64", rbx = 0x%016"PRIx64"\n",
    1.18 -           regs->rbp, regs->rbx);
    1.19 -    printk("r11 = 0x%016"PRIx64", r10 = 0x%016"PRIx64"\n",
    1.20 -           regs->r11, regs->r10);
    1.21 -    printk("r9  = 0x%016"PRIx64", r8  = 0x%016"PRIx64"\n",
    1.22 -           regs->r9, regs->r8);
    1.23 -    printk("rax = 0x%016"PRIx64", rcx = 0x%016"PRIx64"\n",
    1.24 -           regs->rax, regs->rcx);
    1.25 -    printk("rdx = 0x%016"PRIx64", rsi = 0x%016"PRIx64"\n",
    1.26 -           regs->rdx, regs->rsi);
    1.27 -    printk("rdi = 0x%016"PRIx64", rsp = 0x%016"PRIx64"\n",
    1.28 -           regs->rdi, regs->rsp);
    1.29 -    printk("error code = 0x%08"PRIx32", entry_vector = 0x%08"PRIx32"\n",
    1.30 -           regs->error_code, regs->entry_vector);
    1.31 -    printk("rip = 0x%016"PRIx64", rflags = 0x%016"PRIx64"\n",
    1.32 -           regs->rip, regs->rflags);
    1.33 -}
    1.34 -
    1.35  static void svm_vmexit_ud_intercept(struct cpu_user_regs *regs)
    1.36  {
    1.37      struct hvm_emulate_ctxt ctxt;
    1.38 @@ -1310,7 +1282,6 @@ asmlinkage void svm_vmexit_handler(struc
    1.39      if ( unlikely(exit_reason == VMEXIT_INVALID) )
    1.40      {
    1.41          svm_dump_vmcb(__func__, vmcb);
    1.42 -        svm_dump_regs(__func__, regs);
    1.43          goto exit_and_crash;
    1.44      }
    1.45  
     2.1 --- a/xen/arch/x86/x86_emulate/x86_emulate.c	Wed May 27 14:03:09 2009 +0100
     2.2 +++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Wed May 27 15:55:29 2009 +0100
     2.3 @@ -3599,6 +3599,7 @@ x86_emulate(
     2.4          cs.attr.bytes = 0xc9b; /* G+DB+P+S+Code */
     2.5          ss.attr.bytes = 0xc93; /* G+DB+P+S+Data */
     2.6  
     2.7 +#ifdef __x86_64__
     2.8          if ( in_longmode(ctxt, ops) )
     2.9          {
    2.10              cs.attr.fields.db = 0;
    2.11 @@ -3618,11 +3619,12 @@ x86_emulate(
    2.12              _regs.eflags &= ~(msr_content | EFLG_RF);
    2.13          }
    2.14          else
    2.15 +#endif
    2.16          {
    2.17              rc = ops->read_msr(MSR_STAR, &msr_content, ctxt);
    2.18              fail_if(rc != 0);
    2.19  
    2.20 -            _regs.rcx = _regs.rip;
    2.21 +            _regs.ecx = _regs.eip;
    2.22              _regs.eip = (uint32_t)msr_content;
    2.23              _regs.eflags &= ~(EFLG_VM | EFLG_IF | EFLG_RF);
    2.24          }
    2.25 @@ -3783,11 +3785,11 @@ x86_emulate(
    2.26  
    2.27          rc = ops->read_msr(MSR_SYSENTER_EIP, &msr_content, ctxt);
    2.28          fail_if(rc != 0);
    2.29 -        _regs.rip = msr_content;
    2.30 +        _regs.eip = msr_content;
    2.31  
    2.32          rc = ops->read_msr(MSR_SYSENTER_ESP, &msr_content, ctxt);
    2.33          fail_if(rc != 0);
    2.34 -        _regs.rsp = msr_content;
    2.35 +        _regs.esp = msr_content;
    2.36  
    2.37          break;
    2.38      }
    2.39 @@ -3846,8 +3848,8 @@ x86_emulate(
    2.40          rc = ops->write_segment(x86_seg_ss, &ss, ctxt);
    2.41          fail_if(rc != 0);
    2.42  
    2.43 -        _regs.rip = _regs.rdx;
    2.44 -        _regs.rsp = _regs.rcx;
    2.45 +        _regs.eip = _regs.edx;
    2.46 +        _regs.esp = _regs.ecx;
    2.47          break;
    2.48      }
    2.49