From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buOQ2-0001D1-Rx for qemu-devel@nongnu.org; Wed, 12 Oct 2016 14:38:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buOPy-00031H-ML for qemu-devel@nongnu.org; Wed, 12 Oct 2016 14:38:21 -0400 Received: from wp244.webpack.hosteurope.de ([80.237.133.13]:49013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buOPy-000315-Fm for qemu-devel@nongnu.org; Wed, 12 Oct 2016 14:38:18 -0400 Date: Wed, 12 Oct 2016 20:38:15 +0200 From: David Hildenbrand Message-ID: <20161012183815.GA24542@localhost> References: <1476100224-19760-1-git-send-email-imbrenda@linux.vnet.ibm.com> <1476100224-19760-3-git-send-email-imbrenda@linux.vnet.ibm.com> <20161012131525.GA9564@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v1 2/2] gdbstub: Fix vCont behaviour List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Claudio Imbrenda Cc: David Hildenbrand , Paolo Bonzini , qemu-devel@nongnu.org On Wed, Oct 12, 2016 at 03:55:18PM +0200, Claudio Imbrenda wrote: > On 12/10/16 15:15, David Hildenbrand wrote: > >>> + for (cx = 0; ccpus && ccpus[cx]; cx++) { > >>> + cpu_single_step(cpu, 0); > > > > This looks suspicious > > why? we set all cpus to single step, since that is the default, and then > we clear the single-step property from all CPUs that should be restarted > in normal mode, then we restart all CPUs. Those in single-step will > indeed only perform one single step, the others will run freely (at > least until the first single-step CPU stops again). actually I was more concerned about calling it on "cpu" in a loop. GDB will: - single step one thread only (stopping all other) - use vCont as default. So this means quite some ioctls on every step with some VCPUs. I doubt that it will really be a problem (e.g. for GDB single stepping instead of setting breakpoints when returning froma function), but still I want to have it said. (we actually only need 1 ioctl but call quite a lot). > > >>> + } > >>> + CPU_FOREACH(cpu) { > >>> + cpu_resume(cpu); > >>> + } > > > > Claudio, did you have a look at how s->c_cpu is used later on? I remember that we > > have to take care of some query reply packages. > > yes, that's set by the H packet and used by the c,s,m,etc packets. vCont > ignores it and doesn't change it > (see here https://sourceware.org/gdb/onlinedocs/gdb/Packets.html ) I remember something different (also having to do with clients detaching and re-attaching). Will have a look at the code when I have time.