From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2M5A-0002Pm-Vy for qemu-devel@nongnu.org; Thu, 15 Apr 2010 06:14:01 -0400 Received: from [140.186.70.92] (port=56849 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2M57-0002Nw-W0 for qemu-devel@nongnu.org; Thu, 15 Apr 2010 06:13:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2M56-0001gW-CG for qemu-devel@nongnu.org; Thu, 15 Apr 2010 06:13:57 -0400 Received: from david.siemens.de ([192.35.17.14]:23340) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2M55-0001g8-Vl for qemu-devel@nongnu.org; Thu, 15 Apr 2010 06:13:56 -0400 Message-ID: <4BC6E6DA.3040100@siemens.com> Date: Thu, 15 Apr 2010 12:13:46 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: Missing singlestep for already-translated code? References: <4BC47340.3030407@siemens.com> <4BC48D85.7050903@siemens.com> <4BC6E44D.5080406@aurel32.net> In-Reply-To: <4BC6E44D.5080406@aurel32.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: "qemu-devel@nongnu.org" , Alexander Graf , Jun Koi Aurelien Jarno wrote: > Jun Koi a =E9crit : >> On Wed, Apr 14, 2010 at 12:28 AM, Jan Kiszka = wrote: >>> Alexander Graf wrote: >>>> On 13.04.2010, at 15:36, Jan Kiszka wrote: >>>> >>>>> Jun Koi wrote: >>>>>> Hi, >>>>>> >>>>>> I am looking into the singlestep command in monitor interface, and= it >>>>>> seems that we only take into account the singlestep flag when we a= re >>>>>> translating code. >>>>>> So for the already-translated code, we will miss singlestep? >>>>> This feature is broken. For TCG, it should at least flush the >>>>> translation buffer, and for KVM it has to enable single-stepping in= the >>>>> kernel. That's what happens automatically when you call cpu_single_= step. >>>>> I guess 'singlestep' wants to be somehow orthogonal to this. But th= is is >>>>> the wrong approach. >>>>> >>>>> Does anyone actually used this feature or still does so? It looks f= airly >>>>> redundant to me, kind of a poor-man's gdb front-end as part of the >>>>> monitor console. >>>> Not sure what it does, but I use -singlestep quite a lot to get regi= ster dumps for instructions when using -d cpu. >>> Ah, "singlestep" is not about stopping the VM after each instruction = but >>> about limiting the TB length to a single instruction. Badly named and >>> poorly documented. >>> >>> In that case, the dynamic switch should already be fine by adding a >>> tb_flush() on enable. Still, someone should also patch at least the d= ocs. >>> >=20 > What's the real point of flushing the tb to get it retranslated again? > It will be retranslated in the exact same way. Nope. AFAIU, 'singlestep' will enforce single-instruction TBs. Jan --=20 Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux