From patchwork Thu Nov 10 17:11:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 124965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 73E57B6F93 for ; Fri, 11 Nov 2011 04:11:50 +1100 (EST) Received: from localhost ([::1]:39398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROYAE-0005kY-8H for incoming@patchwork.ozlabs.org; Thu, 10 Nov 2011 12:11:46 -0500 Received: from eggs.gnu.org ([140.186.70.92]:48460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROYA9-0005kS-7O for qemu-devel@nongnu.org; Thu, 10 Nov 2011 12:11:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROYA8-0007d0-0A for qemu-devel@nongnu.org; Thu, 10 Nov 2011 12:11:41 -0500 Received: from cantor2.suse.de ([195.135.220.15]:58063 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROYA7-0007cq-Rh for qemu-devel@nongnu.org; Thu, 10 Nov 2011 12:11:39 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id A5CCD8980B; Thu, 10 Nov 2011 18:11:38 +0100 (CET) Message-ID: <4EBC05CA.1080907@suse.de> Date: Thu, 10 Nov 2011 18:11:38 +0100 From: Alexander Graf User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Thunderbird/3.1.8 MIME-Version: 1.0 To: Sebastian Bauer References: <1dff061de511be8246b1e86a63cbf4a8@sebastianbauer.info> In-Reply-To: <1dff061de511be8246b1e86a63cbf4a8@sebastianbauer.info> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH] PPC: Fix for the gdb single step problem on an rfi instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 08/10/2011 01:41 PM, Sebastian Bauer wrote: > When using gdb to single step a ppc interrupt routine, the execution > flow passes > the rfi instruction without actually returning from the interrupt. The > patch > fixes this by avoiding to update the nip when the debug exception is > raised > and a previous POWERPC_EXCP_SYNC was set. The latter is the case only, > if code for > rfi or a related instruction was generated. > > Signed-off-by: Sebastian Bauer > --- > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > index fd7c208..42b91fd 100644 > --- a/target-ppc/translate.c > +++ b/target-ppc/translate.c > @@ -287,7 +287,7 @@ static inline void > gen_debug_exception(DisasContext *ctx) > { > TCGv_i32 t0; > > - if (ctx->exception != POWERPC_EXCP_BRANCH) > + if (ctx->exception != POWERPC_EXCP_BRANCH && ctx->exception != > POWERPC_EXCP_SYNC) > gen_update_nip(ctx, ctx->nip); I fixed the patch up to align with the coding style rules: tcg_temp_free_i32(t0); Otherwise, applied to ppc-next now. Thanks a lot! And sorry for the late reply again. Please send your next patch CC'ed to qemu-ppc@nongnu.org - that makes it a lot easier for to not lose track of it :). Alex diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 99e995c..66eae30 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -298,8 +298,10 @@ static inline void gen_debug_exception(DisasContext *ctx) { TCGv_i32 t0; - if (ctx->exception != POWERPC_EXCP_BRANCH) + if ((ctx->exception != POWERPC_EXCP_BRANCH) && + (ctx->exception != POWERPC_EXCP_SYNC)) { gen_update_nip(ctx, ctx->nip); + } t0 = tcg_const_i32(EXCP_DEBUG); gen_helper_raise_exception(t0);