qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <dahi@daveh.de>
To: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Cc: David Hildenbrand <dahi@daveh.de>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v1 2/2] gdbstub: Fix vCont behaviour
Date: Wed, 12 Oct 2016 20:38:15 +0200	[thread overview]
Message-ID: <20161012183815.GA24542@localhost> (raw)
In-Reply-To: <ab3e7339-f989-9b93-ff46-f541ba41a25a@linux.vnet.ibm.com>

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.

  parent reply	other threads:[~2016-10-12 18:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 11:50 [Qemu-devel] [PATCH v1 0/2] Qemu: gdbstub: fix vCont and single-step Claudio Imbrenda
2016-10-10 11:50 ` [Qemu-devel] [PATCH v1 1/2] gdbstub: Fix single-step Claudio Imbrenda
2016-10-10 12:51   ` Christian Borntraeger
2016-10-10 14:36     ` Paolo Bonzini
2016-10-10 15:46       ` [Qemu-devel] [PATCH] kvm-all: don't use stale dbg_data->cpu Alex Bennée
2016-10-10 16:39         ` Paolo Bonzini
2016-10-10 17:18           ` Christian Borntraeger
2016-10-11 11:48         ` Claudio Imbrenda
2016-10-10 11:50 ` [Qemu-devel] [PATCH v1 2/2] gdbstub: Fix vCont behaviour Claudio Imbrenda
2016-10-11  8:18   ` Paolo Bonzini
2016-10-12 13:15     ` David Hildenbrand
2016-10-12 13:55       ` Claudio Imbrenda
2016-10-12 16:48         ` Paolo Bonzini
2016-10-12 18:38         ` David Hildenbrand [this message]
2016-10-13  7:49           ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161012183815.GA24542@localhost \
    --to=dahi@daveh.de \
    --cc=imbrenda@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).