From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkAJ4-0002dJ-1e for qemu-devel@nongnu.org; Wed, 14 Sep 2016 09:32:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkAIz-0003JF-Lh for qemu-devel@nongnu.org; Wed, 14 Sep 2016 09:32:53 -0400 Received: from bastet.se.axis.com ([195.60.68.11]:35389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkAIz-0003HV-Ae for qemu-devel@nongnu.org; Wed, 14 Sep 2016 09:32:49 -0400 Date: Wed, 14 Sep 2016 15:32:44 +0200 Message-Id: <201609141332.u8EDWi3e012606@ignucius.se.axis.com> From: Hans-Peter Nilsson In-reply-to: <20160912224951.GL16305@toto> (edgar.iglesias@gmail.com) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 7/9] target-cris: ignore prefix insns in singlestep List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: edgar.iglesias@gmail.com Cc: qemu-devel@nongnu.org, rabinv@axis.com > Date: Tue, 13 Sep 2016 00:49:51 +0200 > From: "Edgar E. Iglesias" > On Mon, Sep 05, 2016 at 01:54:10PM +0200, Rabin Vincent wrote: > > From: Hans-Peter Nilsson > >=20 > > Don't count prefix instructions as separate when singlestepping. > >=20 > > For example, for this following instruction > >=20 > > 1ad8: a011 e00b move.d r0,[r1-96] > >=20 > > before this patch, we get two register dumps: > >=20 > > PC=3D1ad8 CCS=3D0 btaken=3D1 btarget=3D1ac6 > > cc_op=3D1 cc_src=3D3746 cc_dest=3D1 cc_result=3Dea2 cc_mask=3D0 > > $r0=3D00000000 $r1=3D00004360 $r2=3D00004308 $r3=3D0000026c > > $r4=3D00002076 $r5=3D00002022 $r6=3D00000000 $r7=3D00000000 > > $r8=3D00000000 $r9=3D00000ea2 $r10=3D00000002 $r11=3D00004308 > > $r12=3D00001080 $r13=3D00000ec0 $sp=3D0000bfd8 $pc=3D00001ad4 > >=20 > > PC=3D1ada CCS=3D800 btaken=3D1 btarget=3D1ac6 > > cc_op=3D1 cc_src=3D3746 cc_dest=3D1 cc_result=3Dea2 cc_mask=3D0 > > $r0=3D00000000 $r1=3D00004360 $r2=3D00004308 $r3=3D0000026c > > $r4=3D00002076 $r5=3D00002022 $r6=3D00000000 $r7=3D00000000 > > $r8=3D00000000 $r9=3D00000ea2 $r10=3D00000002 $r11=3D00004308 > > $r12=3D00001080 $r13=3D00000ec0 $sp=3D0000bfd8 $pc=3D00001ad4 > >=20 > > With the patch, we get only one: > >=20 > > PC=3D1ad8 CCS=3D0 btaken=3D1 btarget=3D1ac6 > > cc_op=3D1 cc_src=3D3746 cc_dest=3D1 cc_result=3Dea2 cc_mask=3D0 > > $r0=3D00000000 $r1=3D00004360 $r2=3D00004308 $r3=3D0000026c > > $r4=3D00002076 $r5=3D00002022 $r6=3D00000000 $r7=3D00000000 > > $r8=3D00000000 $r9=3D00000ea2 $r10=3D00000002 $r11=3D00004308 > > $r12=3D00001080 $r13=3D00000ec0 $sp=3D0000bfd8 $pc=3D00001ad4 >=20 > Hi, >=20 > A concern I have is that we can't guard against all split prefix > sequences (e.g at page boundaries or with icount). So it may be more > confusing to see the prefix insns sometimes than every time. I've forgotten most details, and have to refer to Rabin for useful answers. However, from the few glimpses I remember, basically I had to key on "singlestep" and force a re-translation to get usable dumps that didn't skip dump of state from all instructions inside a translated hunk on subsequent executions. There were some hacks^Wpatches left-out (for being too invasive and hackish, IIRC) to that effect, not sure how they affected this particular code here. > Perhaps we should more clearly be showing prefix state in the logs? No: I'd rather just not have prefix instructions dumped separately whenever possible as dumps get really big really quick, but maybe both this patch and a prefix indicator then, to reduce confusion. I guess a better deal would be a method that enables consistent dumps; page boundaries and icount shouldn't affect dumps. Maybe qemu has improved and there's a generic method to get useful register dumps *from every instruction at every execution* these days. > BTW, are you guys doing post-processing on this Certainly. The output was massaged to have the same format as dumps from another simulator, then fed into a script for use together with the executable to get readable output (somewhat at call-graph-level). > or is it only > for human inspection? >=20 > Cheers, > Edgar >=20 >=20 > >=20 > > Signed-off-by: Hans-Peter Nilsson > > Signed-off-by: Rabin Vincent > > --- > > target-cris/translate.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > >=20 > > diff --git a/target-cris/translate.c b/target-cris/translate.c > > index a4512b5..c9b1e65 100644 > > --- a/target-cris/translate.c > > +++ b/target-cris/translate.c > > @@ -3262,7 +3262,8 @@ void gen_intermediate_code(CPUCRISState *env, s= truct TranslationBlock *tb) > > } > > } while (!dc->is_jmp && !dc->cpustate_changed > > && !tcg_op_buf_full() > > - && !singlestep > > + /* We don't count prefix insns as separate wrt. singlest= ep. */ > > + && (!singlestep || (dc->tb_flags & PFIX_FLAG)) > > && (dc->pc < next_page_start) > > && num_insns < max_insns); > > =20 > > --=20 > > 2.1.4 > >=20 >=20 brgds, H-P