Fix incorrect exception_index use
authorBlue Swirl <blauwirbel@gmail.com>
Sun, 14 Feb 2010 07:23:50 +0000 (07:23 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 14 Feb 2010 07:23:50 +0000 (07:23 +0000)
env->exception_index should be cleared with -1, not 0.

See also 821b19fe923ac49a24cdb4af902584fdd019cee6.

Spotted by Igor Kovalenko.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-alpha/helper.c
target-s390x/kvm.c
target-sh4/helper.c

index be7d37b0d9c07cdfd4b28ad617b5f44506bcacfe..1e0bc4a15545899422994ab1e118e571778ea8ad 100644 (file)
@@ -467,7 +467,7 @@ void do_interrupt (CPUState *env)
 
     env->ipr[IPR_EXC_ADDR] = env->pc | 1;
     excp = env->exception_index;
-    env->exception_index = 0;
+    env->exception_index = -1;
     env->error_code = 0;
     /* XXX: disable interrupts and memory mapping */
     if (env->ipr[IPR_PAL_BASE] != -1ULL) {
index 09925639249648994ecaba3e1435e67c73c8029d..0199a650f611d74a57942c84f5da80cd8be1e550 100644 (file)
@@ -186,7 +186,7 @@ static void kvm_s390_interrupt_internal(CPUState *env, int type, uint32_t parm,
     }
 
     env->halted = 0;
-    env->exception_index = 0;
+    env->exception_index = -1;
 
     kvmint.type = type;
     kvmint.parm = parm;
@@ -325,7 +325,7 @@ static int s390_cpu_restart(CPUState *env)
 {
     kvm_s390_interrupt(env, KVM_S390_RESTART, 0);
     env->halted = 0;
-    env->exception_index = 0;
+    env->exception_index = -1;
     qemu_cpu_kick(env);
     dprintf("DONE: SIGP cpu restart: %p\n", env);
     return 0;
index f38e6abdaf2da82e7abc734c902a4240cad080bc..d2ff6691e0f345c004a359748a9f21334a6d423b 100644 (file)
@@ -38,7 +38,7 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,
                             int mmu_idx, int is_softmmu)
 {
     env->tea = address;
-    env->exception_index = 0;
+    env->exception_index = -1;
     switch (rw) {
     case 0:
         env->exception_index = 0x0a0;