From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYmk7-0005Jm-91 for qemu-devel@nongnu.org; Sun, 27 May 2012 19:19:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SYmk5-0004Fj-Or for qemu-devel@nongnu.org; Sun, 27 May 2012 19:19:22 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:63855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYmk5-0004Ff-Ej for qemu-devel@nongnu.org; Sun, 27 May 2012 19:19:21 -0400 Received: by lbok6 with SMTP id k6so1972868lbo.4 for ; Sun, 27 May 2012 16:19:19 -0700 (PDT) From: Max Filippov Date: Mon, 28 May 2012 03:18:33 +0400 Message-Id: <1338160713-22393-1-git-send-email-jcmvbkbc@gmail.com> Subject: [Qemu-devel] [PATCH 1.1] target-xtensa: fix CCOUNT for conditional branches List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Max Filippov , Anthony Liguori 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 --- target-xtensa/translate.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 521c0e6..a542a31 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); -- 1.7.7.6