From: Jan Kiszka <jan.kiszka@web.de>
To: Jun Koi <junkoi2004@gmail.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
TeLeMan <geleman@gmail.com>, Glauber Costa <glommer@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Alexander Graf <agraf@suse.de>,
qemu-devel@nongnu.org, Avi Kivity <avi@redhat.com>
Subject: [Qemu-devel] Re: [PATCH 8/8] Rework debug exception processing for gdb use
Date: Fri, 23 Jul 2010 09:57:55 +0200 [thread overview]
Message-ID: <4C494B83.9080200@web.de> (raw)
In-Reply-To: <AANLkTikZp_USzvWDEmBqeReBCBJpmwqGBV7J8+NSYBS8@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]
Jun Koi wrote:
> On Fri, Jul 23, 2010 at 1:58 PM, TeLeMan <geleman@gmail.com> wrote:
>> On Fri, Jun 25, 2010 at 22:56, Jan Kiszka <jan.kiszka@siemens.com> wrote:
>>> Guest debugging is currently broken under CONFIG_IOTHREAD. The reason is
>>> inconsistent or even lacking signaling the debug events from the source
>>> VCPU to the main loop and the gdbstub.
>>>
>>> This patch addresses the issue by pushing this signaling into a
>>> CPUDebugExcpHandler: cpu_debug_handler is registered as first handler,
>>> thus will be executed last after potential breakpoint emulation
>>> handlers. It sets informs the gdbstub about the debug event source,
>>> requests a debug exit of the main loop and stops the current VCPU. This
>>> mechanism works both for TCG and KVM, with and without IO-thread.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> ---
>>> cpus.c | 26 ++++++++++++++++----------
>>> kvm-all.c | 2 --
>>> 2 files changed, 16 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/cpus.c b/cpus.c
>>> index c024421..a607d9a 100644
>>> --- a/cpus.c
>>> +++ b/cpus.c
>>> @@ -140,6 +140,13 @@ static int any_cpu_has_work(void)
>>> return 0;
>>> }
>>>
>>> +static void cpu_debug_handler(CPUState *env)
>>> +{
>>> + gdb_set_stop_cpu(env);
>>> + debug_requested = EXCP_DEBUG;
>>> + vm_stop(EXCP_DEBUG);
>>> +}
>> Is debug_requested or vm_stop() redundant?
>>
>
> certainly that debug_requested should only take value of 0 or 1.
This works analogously to vmstop_requested: The stop reason code is
transfered along the request. Granted, there is only one code used here
so far.
This whole thing could probably be simplified if we did not have to
support both single- and multi-threaded QEMU execution models. But
that's the situation ATM.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2010-07-23 7:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-25 14:56 [Qemu-devel] [PATCH 0/8] Fix various IO-thread breakages Jan Kiszka
2010-06-25 14:56 ` [Qemu-devel] [PATCH 1/8] Introduce proper compiler barrier Jan Kiszka
2010-06-25 14:56 ` [Qemu-devel] [PATCH 2/8] Fix cpu_unlink_tb race Jan Kiszka
2010-06-25 14:56 ` [Qemu-devel] [PATCH 3/8] Init qemu_system_cond Jan Kiszka
2010-06-25 14:56 ` [Qemu-devel] [PATCH 4/8] Fix cpu_exit for tcp_cpu_exec Jan Kiszka
2010-06-25 14:56 ` [Qemu-devel] [PATCH 5/8] Fix qemu_wait_io_event processing in io-thread mode Jan Kiszka
2010-06-25 14:56 ` [Qemu-devel] [PATCH 6/8] Drop redundant global cur_cpu variable Jan Kiszka
2010-06-25 14:56 ` [Qemu-devel] [PATCH 7/8] Rename tcg_cpu_exec and tcg_has_work Jan Kiszka
2010-06-25 14:56 ` [Qemu-devel] [PATCH 8/8] Rework debug exception processing for gdb use Jan Kiszka
2010-07-23 4:58 ` TeLeMan
2010-07-23 5:44 ` Jun Koi
2010-07-23 7:57 ` Jan Kiszka [this message]
2010-06-27 12:38 ` [Qemu-devel] Re: [PATCH 0/8] Fix various IO-thread breakages Paolo Bonzini
2010-06-28 13:51 ` Marcelo Tosatti
2010-07-22 12:15 ` [Qemu-devel] " Aurelien Jarno
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=4C494B83.9080200@web.de \
--to=jan.kiszka@web.de \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=geleman@gmail.com \
--cc=glommer@redhat.com \
--cc=junkoi2004@gmail.com \
--cc=mtosatti@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).