From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbwEF-0004wj-J5 for qemu-devel@nongnu.org; Fri, 23 Nov 2012 11:35:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbwE9-0004kM-GW for qemu-devel@nongnu.org; Fri, 23 Nov 2012 11:35:47 -0500 Message-ID: <50AFA5DA.7010608@suse.de> Date: Fri, 23 Nov 2012 17:35:38 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] Fix missing TRACE exception List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Julio Guerra , qemu-ppc@nongnu.org, qemu-devel@nongnu.org Am 23.11.2012 17:06, schrieb Alexander Graf: >=20 > On 19.10.2012, at 12:17, Julio Guerra wrote: >=20 >> This patch fixes bug 1031698 : >> https://bugs.launchpad.net/qemu/+bug/1031698 >> >> If we look at the (truncated) translation of the conditional branch >> instruction in the test submitted in the bug post, the call to the >> exception helper is missing in the "bne-false" chunk of translated >> code : >> >> IN: >> bne- 0x1800278 >> >> OUT: >> 0xb544236d: jne 0xb5442396 >> >> 0xb5442373: mov %ebp,(%esp) >> 0xb5442376: mov $0x44,%ebx >> 0xb544237b: mov %ebx,0x4(%esp) >> 0xb544237f: mov $0x1800278,%ebx >> 0xb5442384: mov %ebx,0x25c(%ebp) >> 0xb544238a: call 0x827475a >> ^^^^^^^^^^^^^^^^^^ >> # OK : call the exception helper function >> >> 0xb5442396: mov %ebp,(%esp) >> 0xb5442399: mov $0x44,%ebx >> 0xb544239e: mov %ebx,0x4(%esp) >> 0xb54423a2: mov $0x1800270,%ebx >> 0xb54423a7: mov %ebx,0x25c(%ebp) >> # KO : missing "call 0x827475a" >> >> >> Indeed, gen_exception(ctx, excp) called by gen_goto_tb (called by >> gen_bcond) changes ctx->exception's value to excp's : >> >> gen_bcond() >> { >> gen_goto_tb(ctx, 0, ctx->nip + li - 4); >> /* ctx->exception value is POWERPC_EXCP_BRANCH */ >> >> gen_goto_tb(ctx, 1, ctx->nip); >> /* ctx->exception now value is POWERPC_EXCP_TRACE */ >> } >> >> >> Making the following gen_goto_tb()'s test false during the second call= : >> >> if ((ctx->singlestep_enabled & >> (CPU_BRANCH_STEP | CPU_SINGLE_STEP)) && >> ctx->exception =3D=3D POWERPC_EXCP_BRANCH /* false...*/) { >> target_ulong tmp =3D ctx->nip; >> ctx->nip =3D dest; >> /* ... and this is the missing call */ >> gen_exception(ctx, POWERPC_EXCP_TRACE); >> ctx->nip =3D tmp; >> } >> >> So the patch simply adds the missing matching case, fixing our problem= . >> >> Signed-off-by: Julio Guerra >=20 > Thanks, applied to ppc-next :) Please don't forget to add the missing "target-ppc: ". :) Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg