ia64/xen-unstable

changeset 13366:db72b85b81bb

[IA64] merge increment_iip

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
author awilliam@xenbuild2.aw
date Thu Jan 11 14:42:24 2007 -0700 (2007-01-11)
parents d607d575ec6a
children 01ea554f1c5e
files xen/arch/ia64/vmx/mmio.c xen/arch/ia64/vmx/vmx_process.c xen/arch/ia64/vmx/vmx_vcpu.c xen/arch/ia64/vmx/vmx_virt.c xen/arch/ia64/xen/vcpu.c xen/include/asm-ia64/vcpu.h xen/include/asm-ia64/vmx_vcpu.h
line diff
     1.1 --- a/xen/arch/ia64/vmx/mmio.c	Thu Jan 11 14:27:39 2007 -0700
     1.2 +++ b/xen/arch/ia64/vmx/mmio.c	Thu Jan 11 14:42:24 2007 -0700
     1.3 @@ -362,7 +362,7 @@ void emulate_io_inst(VCPU *vcpu, u64 pad
     1.4              temp += post_update;
     1.5  	vcpu_set_gr(vcpu,inst.M15.r3,temp,0);
     1.6  
     1.7 -	vmx_vcpu_increment_iip(vcpu);
     1.8 +	vcpu_increment_iip(vcpu);
     1.9  	return;
    1.10      }
    1.11      // Floating-point Load Pair + Imm ldfp8 M12
    1.12 @@ -382,9 +382,9 @@ void emulate_io_inst(VCPU *vcpu, u64 pad
    1.13          vcpu_set_fpreg(vcpu,inst.M12.f2,&v);
    1.14          padr += 8;
    1.15          vcpu_set_gr(vcpu,inst.M12.r3,padr,0);
    1.16 -        vmx_vcpu_increment_iip(vcpu);
    1.17 +        vcpu_increment_iip(vcpu);
    1.18          return;
    1.19 -    }					
    1.20 +    }
    1.21      else{
    1.22          panic_domain
    1.23  	  (NULL,"This memory access instr can't be emulated: %lx pc=%lx\n ",
    1.24 @@ -420,5 +420,5 @@ void emulate_io_inst(VCPU *vcpu, u64 pad
    1.25  */
    1.26          }
    1.27      }
    1.28 -    vmx_vcpu_increment_iip(vcpu);
    1.29 +    vcpu_increment_iip(vcpu);
    1.30  }
     2.1 --- a/xen/arch/ia64/vmx/vmx_process.c	Thu Jan 11 14:27:39 2007 -0700
     2.2 +++ b/xen/arch/ia64/vmx/vmx_process.c	Thu Jan 11 14:42:24 2007 -0700
     2.3 @@ -93,7 +93,7 @@ void vmx_reflect_interruption(u64 ifa, u
     2.4          if (vector == IA64_FP_FAULT_VECTOR) {
     2.5              status = handle_fpu_swa(1, regs, isr);
     2.6              if (!status) {
     2.7 -                vmx_vcpu_increment_iip(vcpu);
     2.8 +                vcpu_increment_iip(vcpu);
     2.9                  return;
    2.10              } else if (IA64_RETRY == status)
    2.11                  return;
    2.12 @@ -104,7 +104,7 @@ void vmx_reflect_interruption(u64 ifa, u
    2.13              if (!status)
    2.14                  return;
    2.15              else if (IA64_RETRY == status) {
    2.16 -                vmx_vcpu_decrement_iip(vcpu);
    2.17 +                vcpu_decrement_iip(vcpu);
    2.18                  return;
    2.19              }
    2.20          }
    2.21 @@ -143,16 +143,16 @@ vmx_ia64_handle_break (unsigned long ifa
    2.22              /* Allow hypercalls only when cpl = 0.  */
    2.23              if (iim == d->arch.breakimm) {
    2.24                  ia64_hypercall(regs);
    2.25 -                vmx_vcpu_increment_iip(v);
    2.26 +                vcpu_increment_iip(v);
    2.27                  return IA64_NO_FAULT;
    2.28              }
    2.29              else if(iim == DOMN_PAL_REQUEST){
    2.30                  pal_emul(v);
    2.31 -                vmx_vcpu_increment_iip(v);
    2.32 +                vcpu_increment_iip(v);
    2.33                  return IA64_NO_FAULT;
    2.34              }else if(iim == DOMN_SAL_REQUEST){
    2.35                  sal_emul(v);
    2.36 -                vmx_vcpu_increment_iip(v);
    2.37 +                vcpu_increment_iip(v);
    2.38                  return IA64_NO_FAULT;
    2.39              }
    2.40          }
     3.1 --- a/xen/arch/ia64/vmx/vmx_vcpu.c	Thu Jan 11 14:27:39 2007 -0700
     3.2 +++ b/xen/arch/ia64/vmx/vmx_vcpu.c	Thu Jan 11 14:42:24 2007 -0700
     3.3 @@ -145,48 +145,6 @@ vmx_vcpu_set_psr(VCPU *vcpu, unsigned lo
     3.4      return ;
     3.5  }
     3.6  
     3.7 -/* Adjust slot both in pt_regs and vpd, upon vpsr.ri which
     3.8 - * should have sync with ipsr in entry.
     3.9 - *
    3.10 - * Clear some bits due to successfully emulation.
    3.11 - */
    3.12 -IA64FAULT vmx_vcpu_increment_iip(VCPU *vcpu)
    3.13 -{
    3.14 -    // TODO: trap_bounce?? Eddie
    3.15 -    REGS *regs = vcpu_regs(vcpu);
    3.16 -    IA64_PSR *ipsr = (IA64_PSR *)&regs->cr_ipsr;
    3.17 -
    3.18 -    if (ipsr->ri == 2) {
    3.19 -        ipsr->ri = 0;
    3.20 -        regs->cr_iip += 16;
    3.21 -    } else {
    3.22 -        ipsr->ri++;
    3.23 -    }
    3.24 -
    3.25 -    ipsr->val &=
    3.26 -            (~ (IA64_PSR_ID |IA64_PSR_DA | IA64_PSR_DD |
    3.27 -                IA64_PSR_SS | IA64_PSR_ED | IA64_PSR_IA
    3.28 -            ));
    3.29 -
    3.30 -    return (IA64_NO_FAULT);
    3.31 -}
    3.32 -
    3.33 -
    3.34 -IA64FAULT vmx_vcpu_decrement_iip(VCPU *vcpu)
    3.35 -{
    3.36 -    REGS *regs = vcpu_regs(vcpu);
    3.37 -    IA64_PSR *ipsr = (IA64_PSR *)&regs->cr_ipsr;
    3.38 -    
    3.39 -    if (ipsr->ri == 0) {
    3.40 -        ipsr->ri = 2;
    3.41 -        regs->cr_iip -= 16;
    3.42 -    } else {
    3.43 -        ipsr->ri--;
    3.44 -    }
    3.45 -    return (IA64_NO_FAULT);
    3.46 -}
    3.47 -
    3.48 -
    3.49  IA64FAULT vmx_vcpu_cover(VCPU *vcpu)
    3.50  {
    3.51      REGS *regs = vcpu_regs(vcpu);
    3.52 @@ -199,15 +157,12 @@ IA64FAULT vmx_vcpu_cover(VCPU *vcpu)
    3.53      return (IA64_NO_FAULT);
    3.54  }
    3.55  
    3.56 -
    3.57  struct virtual_platform_def *
    3.58  vmx_vcpu_get_plat(VCPU *vcpu)
    3.59  {
    3.60      return &(vcpu->domain->arch.vmx_platform);
    3.61  }
    3.62  
    3.63 -
    3.64 -
    3.65  IA64FAULT vmx_vcpu_set_rr(VCPU *vcpu, u64 reg, u64 val)
    3.66  {
    3.67      ia64_rr oldrr,newrr;
     4.1 --- a/xen/arch/ia64/vmx/vmx_virt.c	Thu Jan 11 14:27:39 2007 -0700
     4.2 +++ b/xen/arch/ia64/vmx/vmx_virt.c	Thu Jan 11 14:42:24 2007 -0700
     4.3 @@ -1568,7 +1568,7 @@ if ( (cause == 0xff && opcode == 0x1e000
     4.4  #endif
     4.5  
     4.6      if ( status == IA64_NO_FAULT && cause !=EVENT_RFI ) {
     4.7 -        vmx_vcpu_increment_iip(vcpu);
     4.8 +        vcpu_increment_iip(vcpu);
     4.9      }
    4.10  
    4.11      recover_if_physical_mode(vcpu);
     5.1 --- a/xen/arch/ia64/xen/vcpu.c	Thu Jan 11 14:27:39 2007 -0700
     5.2 +++ b/xen/arch/ia64/xen/vcpu.c	Thu Jan 11 14:42:24 2007 -0700
     5.3 @@ -695,6 +695,20 @@ IA64FAULT vcpu_increment_iip(VCPU * vcpu
     5.4  	return IA64_NO_FAULT;
     5.5  }
     5.6  
     5.7 +IA64FAULT vcpu_decrement_iip(VCPU * vcpu)
     5.8 +{
     5.9 +	REGS *regs = vcpu_regs(vcpu);
    5.10 +	struct ia64_psr *ipsr = (struct ia64_psr *)&regs->cr_ipsr;
    5.11 +
    5.12 +	if (ipsr->ri == 0) {
    5.13 +		ipsr->ri = 2;
    5.14 +		regs->cr_iip -= 16;
    5.15 +	} else
    5.16 +		ipsr->ri--;
    5.17 +
    5.18 +	return IA64_NO_FAULT;
    5.19 +}
    5.20 +
    5.21  IA64FAULT vcpu_set_ifa(VCPU * vcpu, u64 val)
    5.22  {
    5.23  	PSCB(vcpu, ifa) = val;
     6.1 --- a/xen/include/asm-ia64/vcpu.h	Thu Jan 11 14:27:39 2007 -0700
     6.2 +++ b/xen/include/asm-ia64/vcpu.h	Thu Jan 11 14:42:24 2007 -0700
     6.3 @@ -77,6 +77,7 @@ extern IA64FAULT vcpu_get_ipsr(VCPU * vc
     6.4  extern IA64FAULT vcpu_get_isr(VCPU * vcpu, u64 * pval);
     6.5  extern IA64FAULT vcpu_get_iip(VCPU * vcpu, u64 * pval);
     6.6  extern IA64FAULT vcpu_increment_iip(VCPU * vcpu);
     6.7 +extern IA64FAULT vcpu_decrement_iip(VCPU * vcpu);
     6.8  extern IA64FAULT vcpu_get_ifa(VCPU * vcpu, u64 * pval);
     6.9  extern IA64FAULT vcpu_get_itir(VCPU * vcpu, u64 * pval);
    6.10  extern unsigned long vcpu_get_itir_on_fault(VCPU * vcpu, u64 ifa);
     7.1 --- a/xen/include/asm-ia64/vmx_vcpu.h	Thu Jan 11 14:27:39 2007 -0700
     7.2 +++ b/xen/include/asm-ia64/vmx_vcpu.h	Thu Jan 11 14:42:24 2007 -0700
     7.3 @@ -115,8 +115,6 @@ extern void memwrite_v(VCPU * vcpu, thas
     7.4                         size_t s);
     7.5  extern void memwrite_p(VCPU * vcpu, u64 * src, u64 * dest, size_t s);
     7.6  extern void vcpu_load_kernel_regs(VCPU * vcpu);
     7.7 -extern IA64FAULT vmx_vcpu_increment_iip(VCPU * vcpu);
     7.8 -extern IA64FAULT vmx_vcpu_decrement_iip(VCPU * vcpu);
     7.9  extern void vmx_switch_rr7(unsigned long, shared_info_t *, void *, void *,
    7.10                             void *);
    7.11