summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2012-05-28 03:18:33 +0400
committerMichael Roth <mdroth@linux.vnet.ibm.com>2012-06-25 08:48:56 -0500
commitb993b863e78ae54c5e966f4e1626bc37c560e6aa (patch)
tree2772f6eac19cdec84859dabc117fda1918018d4a
parentexec: fix TB invalidation after breakpoint insertion/deletion (diff)
downloadqemu-kvm-b993b863e78ae54c5e966f4e1626bc37c560e6aa.tar.gz
qemu-kvm-b993b863e78ae54c5e966f4e1626bc37c560e6aa.tar.bz2
qemu-kvm-b993b863e78ae54c5e966f4e1626bc37c560e6aa.zip
target-xtensa: fix CCOUNT for conditional branches
Taken conditional branches fail to update CCOUNT register because accumulated ccount_delta is reset during translation of non-taken branch. To fix it only update CCOUNT once per conditional branch instruction translation. This fixes guest linux freeze on LTP waitpid06 test. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit d865f307399441919d6646545b7735e57920da04) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--target-xtensa/translate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 521c0e622..a542a319d 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -388,6 +388,7 @@ static bool gen_check_loop_end(DisasContext *dc, int slot)
dc->next_pc == dc->lend) {
int label = gen_new_label();
+ gen_advance_ccount(dc);
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_SR[LCOUNT], 0, label);
tcg_gen_subi_i32(cpu_SR[LCOUNT], cpu_SR[LCOUNT], 1);
gen_jumpi(dc, dc->lbeg, slot);
@@ -410,6 +411,7 @@ static void gen_brcond(DisasContext *dc, TCGCond cond,
{
int label = gen_new_label();
+ gen_advance_ccount(dc);
tcg_gen_brcond_i32(cond, t0, t1, label);
gen_jumpi_check_loop_end(dc, 0);
gen_set_label(label);