[IA64] merge increment_iip
authorawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Thu, 11 Jan 2007 21:42:24 +0000 (14:42 -0700)
committerawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Thu, 11 Jan 2007 21:42:24 +0000 (14:42 -0700)
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
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

index 737220df8f443ae99203d0eb6a2b4f80377caa79..08247e1c1485c181c7ad2a39eff15f689b835ad6 100644 (file)
@@ -362,7 +362,7 @@ void emulate_io_inst(VCPU *vcpu, u64 padr, u64 ma)
             temp += post_update;
        vcpu_set_gr(vcpu,inst.M15.r3,temp,0);
 
-       vmx_vcpu_increment_iip(vcpu);
+       vcpu_increment_iip(vcpu);
        return;
     }
     // Floating-point Load Pair + Imm ldfp8 M12
@@ -382,9 +382,9 @@ void emulate_io_inst(VCPU *vcpu, u64 padr, u64 ma)
         vcpu_set_fpreg(vcpu,inst.M12.f2,&v);
         padr += 8;
         vcpu_set_gr(vcpu,inst.M12.r3,padr,0);
-        vmx_vcpu_increment_iip(vcpu);
+        vcpu_increment_iip(vcpu);
         return;
-    }                                  
+    }
     else{
         panic_domain
          (NULL,"This memory access instr can't be emulated: %lx pc=%lx\n ",
@@ -420,5 +420,5 @@ void emulate_io_inst(VCPU *vcpu, u64 padr, u64 ma)
 */
         }
     }
-    vmx_vcpu_increment_iip(vcpu);
+    vcpu_increment_iip(vcpu);
 }
index f8ff340a780b40826301fa9717d4df860a00926b..acce2c0bf9af985665607720b7b3d34faa1d8d36 100644 (file)
@@ -93,7 +93,7 @@ void vmx_reflect_interruption(u64 ifa, u64 isr, u64 iim,
         if (vector == IA64_FP_FAULT_VECTOR) {
             status = handle_fpu_swa(1, regs, isr);
             if (!status) {
-                vmx_vcpu_increment_iip(vcpu);
+                vcpu_increment_iip(vcpu);
                 return;
             } else if (IA64_RETRY == status)
                 return;
@@ -104,7 +104,7 @@ void vmx_reflect_interruption(u64 ifa, u64 isr, u64 iim,
             if (!status)
                 return;
             else if (IA64_RETRY == status) {
-                vmx_vcpu_decrement_iip(vcpu);
+                vcpu_decrement_iip(vcpu);
                 return;
             }
         }
@@ -143,16 +143,16 @@ vmx_ia64_handle_break (unsigned long ifa, struct pt_regs *regs, unsigned long is
             /* Allow hypercalls only when cpl = 0.  */
             if (iim == d->arch.breakimm) {
                 ia64_hypercall(regs);
-                vmx_vcpu_increment_iip(v);
+                vcpu_increment_iip(v);
                 return IA64_NO_FAULT;
             }
             else if(iim == DOMN_PAL_REQUEST){
                 pal_emul(v);
-                vmx_vcpu_increment_iip(v);
+                vcpu_increment_iip(v);
                 return IA64_NO_FAULT;
             }else if(iim == DOMN_SAL_REQUEST){
                 sal_emul(v);
-                vmx_vcpu_increment_iip(v);
+                vcpu_increment_iip(v);
                 return IA64_NO_FAULT;
             }
         }
index 322afe354235dedb543527482cc7ffa5ea260d68..5c1ab3305f772addf90bf2ce8344febbab32f3d7 100644 (file)
@@ -145,48 +145,6 @@ vmx_vcpu_set_psr(VCPU *vcpu, unsigned long value)
     return ;
 }
 
-/* Adjust slot both in pt_regs and vpd, upon vpsr.ri which
- * should have sync with ipsr in entry.
- *
- * Clear some bits due to successfully emulation.
- */
-IA64FAULT vmx_vcpu_increment_iip(VCPU *vcpu)
-{
-    // TODO: trap_bounce?? Eddie
-    REGS *regs = vcpu_regs(vcpu);
-    IA64_PSR *ipsr = (IA64_PSR *)&regs->cr_ipsr;
-
-    if (ipsr->ri == 2) {
-        ipsr->ri = 0;
-        regs->cr_iip += 16;
-    } else {
-        ipsr->ri++;
-    }
-
-    ipsr->val &=
-            (~ (IA64_PSR_ID |IA64_PSR_DA | IA64_PSR_DD |
-                IA64_PSR_SS | IA64_PSR_ED | IA64_PSR_IA
-            ));
-
-    return (IA64_NO_FAULT);
-}
-
-
-IA64FAULT vmx_vcpu_decrement_iip(VCPU *vcpu)
-{
-    REGS *regs = vcpu_regs(vcpu);
-    IA64_PSR *ipsr = (IA64_PSR *)&regs->cr_ipsr;
-    
-    if (ipsr->ri == 0) {
-        ipsr->ri = 2;
-        regs->cr_iip -= 16;
-    } else {
-        ipsr->ri--;
-    }
-    return (IA64_NO_FAULT);
-}
-
-
 IA64FAULT vmx_vcpu_cover(VCPU *vcpu)
 {
     REGS *regs = vcpu_regs(vcpu);
@@ -199,15 +157,12 @@ IA64FAULT vmx_vcpu_cover(VCPU *vcpu)
     return (IA64_NO_FAULT);
 }
 
-
 struct virtual_platform_def *
 vmx_vcpu_get_plat(VCPU *vcpu)
 {
     return &(vcpu->domain->arch.vmx_platform);
 }
 
-
-
 IA64FAULT vmx_vcpu_set_rr(VCPU *vcpu, u64 reg, u64 val)
 {
     ia64_rr oldrr,newrr;
index 54c2e67b25bf3a08988efe70ff5a2c76ec143f6a..9926c6ed8fe8a20a592ac978193ce982df7592be 100644 (file)
@@ -1568,7 +1568,7 @@ if ( (cause == 0xff && opcode == 0x1e000000000) || cause == 0 ) {
 #endif
 
     if ( status == IA64_NO_FAULT && cause !=EVENT_RFI ) {
-        vmx_vcpu_increment_iip(vcpu);
+        vcpu_increment_iip(vcpu);
     }
 
     recover_if_physical_mode(vcpu);
index 10a8227ef7d43d0193b568e6ab4dbc646b48e93f..0eceeb38ae533a1f48cae5c20fb06e06f4657f18 100644 (file)
@@ -695,6 +695,20 @@ IA64FAULT vcpu_increment_iip(VCPU * vcpu)
        return IA64_NO_FAULT;
 }
 
+IA64FAULT vcpu_decrement_iip(VCPU * vcpu)
+{
+       REGS *regs = vcpu_regs(vcpu);
+       struct ia64_psr *ipsr = (struct ia64_psr *)&regs->cr_ipsr;
+
+       if (ipsr->ri == 0) {
+               ipsr->ri = 2;
+               regs->cr_iip -= 16;
+       } else
+               ipsr->ri--;
+
+       return IA64_NO_FAULT;
+}
+
 IA64FAULT vcpu_set_ifa(VCPU * vcpu, u64 val)
 {
        PSCB(vcpu, ifa) = val;
index e403213d65a9f00fa87b581c8fb4337040fc6627..248d25dc2053f40032fb4b95f34a60aef33633e6 100644 (file)
@@ -77,6 +77,7 @@ extern IA64FAULT vcpu_get_ipsr(VCPU * vcpu, u64 * pval);
 extern IA64FAULT vcpu_get_isr(VCPU * vcpu, u64 * pval);
 extern IA64FAULT vcpu_get_iip(VCPU * vcpu, u64 * pval);
 extern IA64FAULT vcpu_increment_iip(VCPU * vcpu);
+extern IA64FAULT vcpu_decrement_iip(VCPU * vcpu);
 extern IA64FAULT vcpu_get_ifa(VCPU * vcpu, u64 * pval);
 extern IA64FAULT vcpu_get_itir(VCPU * vcpu, u64 * pval);
 extern unsigned long vcpu_get_itir_on_fault(VCPU * vcpu, u64 ifa);
index 0defc0d4f40cf6c9e5f8127c60618697a70067c0..24b3b60578fd43b913d6288bc35a1e8350114619 100644 (file)
@@ -115,8 +115,6 @@ extern void memwrite_v(VCPU * vcpu, thash_data_t * vtlb, u64 * src, u64 * dest,
                        size_t s);
 extern void memwrite_p(VCPU * vcpu, u64 * src, u64 * dest, size_t s);
 extern void vcpu_load_kernel_regs(VCPU * vcpu);
-extern IA64FAULT vmx_vcpu_increment_iip(VCPU * vcpu);
-extern IA64FAULT vmx_vcpu_decrement_iip(VCPU * vcpu);
 extern void vmx_switch_rr7(unsigned long, shared_info_t *, void *, void *,
                            void *);