Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MUKQo-0006vu-8p for qemu-devel@nongnu.org; Fri, 24 Jul 2009 09:03:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MUKQk-0006u8-15 for qemu-devel@nongnu.org; Fri, 24 Jul 2009 09:03:25 -0400 Received: from [199.232.76.173] (port=37639 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUKQj-0006u2-PU for qemu-devel@nongnu.org; Fri, 24 Jul 2009 09:03:21 -0400 Received: from wf-out-1314.google.com ([209.85.200.168]:45171) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MUKQj-0006WN-92 for qemu-devel@nongnu.org; Fri, 24 Jul 2009 09:03:21 -0400 Received: by wf-out-1314.google.com with SMTP id 26so457710wfd.4 for ; Fri, 24 Jul 2009 06:03:19 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 24 Jul 2009 21:03:19 +0800 Message-ID: <3cdfa5bc0907240603o676321acs42093a6bafb27324@mail.gmail.com> From: Baojun Wang Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [patch 1/1] target-ppc/translate.c: don't generate debug exception in single step mode for RFI List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hollis Blanchard hi, list This is another ppc translate tiny fix. we need inhibit generate debug exeception in single step mode when doing a RFI. RFI enforce context synchronization, if we generate a debug exception, then the next instruction executed will be the instruction right after RFI, instead of instruction in SRR0. We can set a break point at linux assembly function ``transfer_to_handler_cont'', and then do single step, and in this way we will trigger the regression. I don't know if other architecture have the same problem, but I'm not familiar with other architecture (especially in qemu). Best Regards, Wang Baojun signed-off-by: Baojun Wang diff --git a/target-ppc/translate.c b/target-ppc/translate.c index da3d7de..29276f7 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -9057,7 +9057,8 @@ static always_inline void gen_intermediate_code_internal (CPUState *env, gen_goto_tb(&ctx, 0, ctx.nip); } else if (ctx.exception != POWERPC_EXCP_BRANCH) { if (unlikely(env->singlestep_enabled)) { - gen_debug_exception(ctxp); + if(likely(ctx.exception != POWERPC_EXCP_SYNC)) + gen_debug_exception(ctxp); } /* Generate the return instruction */ tcg_gen_exit_tb(0);