Received: from eggs.gnu.org ([2001:4830:134:3::10]:46613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgz9z-0001d1-1L for qemu-devel@nongnu.org; Mon, 05 Sep 2016 15:02:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgz9u-0001IN-3o for qemu-devel@nongnu.org; Mon, 05 Sep 2016 15:02:23 -0400 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]:33406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgz9t-0001IE-Sf for qemu-devel@nongnu.org; Mon, 05 Sep 2016 15:02:18 -0400 Received: by mail-pa0-x242.google.com with SMTP id vy10so9755671pac.0 for ; Mon, 05 Sep 2016 12:02:17 -0700 (PDT) Sender: Richard Henderson References: <1473076452-19795-1-git-send-email-rabin.vincent@axis.com> <1473076452-19795-5-git-send-email-rabin.vincent@axis.com> From: Richard Henderson Message-ID: <8dce9f44-9b7e-9225-c08e-ea6f09bb33f9@twiddle.net> Date: Mon, 5 Sep 2016 12:02:14 -0700 MIME-Version: 1.0 In-Reply-To: <1473076452-19795-5-git-send-email-rabin.vincent@axis.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/9] target-cris: sync CC state at load/stores. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rabin Vincent , edgar.iglesias@gmail.com Cc: "Edgar E. Iglesias" , qemu-devel@nongnu.org, Rabin Vincent On 09/05/2016 04:54 AM, Rabin Vincent wrote: > From: "Edgar E. Iglesias" > > Icount may choose to abort and recompile a TB at any load/store. We > need to sync the CC state at these insns. > > Signed-off-by: Edgar E. Iglesias > Signed-off-by: Rabin Vincent > --- > target-cris/translate.c | 9 +++++++++ > target-cris/translate_v10.c | 3 +++ > 2 files changed, 12 insertions(+) > > diff --git a/target-cris/translate.c b/target-cris/translate.c > index f4a8d7d..c280e24 100644 > --- a/target-cris/translate.c > +++ b/target-cris/translate.c > @@ -1098,6 +1098,9 @@ static void gen_load64(DisasContext *dc, TCGv_i64 dst, TCGv addr) > { > int mem_index = cpu_mmu_index(&dc->cpu->env, false); > > + /* Due to icount, we need to update the CC flags on load/stores. */ > + cris_evaluate_flags(dc); > + This is not the proper way to handle this. You should arrange to sync the CC flags in restore_state_to_opc. There are plenty of examples in the tree you can examine. It looks like there's plenty of room for cleanup for cris here. r~