No longer used hacked liveness_pass_1

This hack was introduced in issue#287 which later becomes endless maintainance pain.

=====

Our previous check_exit_request use `brcond` in the middle of a TranslationBlock which

breaks the assumptions and thus a hack to liveness_pass_1 is used for _all_ brcond instructions

which causes issues for MIPS and many other scenarios.

=====

This patch also resolves PC not sync-ed when no memory hooks are installed, finally. Now

Unicorn will always have correct PC no matter what happens.
This commit is contained in:
mio
2025-04-12 21:38:14 +08:00
parent e89eb87d04
commit 7f48b1dd4a
28 changed files with 80 additions and 63 deletions

View File

@@ -1575,7 +1575,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
// because qemu might generate tcg code like:
// qemu_ld_i64 x0,x1,leq,8 sync: 0 dead: 0 1
// where we don't have a change to recover x0 value
cpu_loop_exit(uc->cpu);
cpu_loop_exit_restore(uc->cpu, retaddr);
}
return 0;
}
@@ -1586,7 +1586,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
if (uc->nested_level > 0 && !uc->cpu->stopped) {
cpu_exit(uc->cpu);
// See comments above
cpu_loop_exit(uc->cpu);
cpu_loop_exit_restore(uc->cpu, retaddr);
}
return 0;
}
@@ -1660,7 +1660,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
if (uc->nested_level > 0 && !uc->cpu->stopped) {
cpu_exit(uc->cpu);
// See comments above
cpu_loop_exit(uc->cpu);
cpu_loop_exit_restore(uc->cpu, retaddr);
}
return 0;
}
@@ -1694,7 +1694,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
if (uc->nested_level > 0 && !uc->cpu->stopped) {
cpu_exit(uc->cpu);
// See comments above
cpu_loop_exit(uc->cpu);
cpu_loop_exit_restore(uc->cpu, retaddr);
}
return 0;
}