From: Marcelo Tosatti <mtosatti@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>
Subject: Re: [PATCH] qemu-kvm: fix guest resetting
Date: Thu, 8 May 2008 20:35:28 -0300 [thread overview]
Message-ID: <20080508233528.GB6429@dmt> (raw)
In-Reply-To: <4822B9EC.3020907@siemens.com>
Hi Jan,
On Thu, May 08, 2008 at 10:29:32AM +0200, Jan Kiszka wrote:
> Resetting guests used to be racy, deadlock-prone, or simply broken (for
> SMP). This patch fixes the issues - at least for me on x86 (tested on
> Intel SMP host, UP and SMP guest, in-kernel und user space irqchip,
> guest- and monitor-issued resets). Note that ia64 and powerpc may need
> to look into the SMP thing as well (=>kvm_arch_cpu_reset).
>
> At this chance, the patch also cleans up some unneeded reset fragments.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> @@ -317,11 +317,18 @@ void qemu_kvm_system_reset_request(void)
> {
> int i;
>
> + pause_all_threads();
> +
> + qemu_system_reset();
> +
> + for (i = 0; i < smp_cpus; ++i)
> + kvm_arch_cpu_reset(vcpu_info[i].env);
> +
> for (i = 0; i < smp_cpus; ++i) {
> - vcpu_info[i].reload_regs = 1;
> + vcpu_info[i].stop = 0;
> + vcpu_info[i].stopped = 0;
> pthread_kill(vcpu_info[i].thread, SIG_IPI);
> }
> - qemu_system_reset();
Why don't you signal the IO thread to pause all vcpu's and place their
registers and "run state" in the proper condition if the reset request
comes from the guest? It should simplify things a lot (and avoid any
changes to vl.c).
After signalling the vcpu should stop instead of returning to guest
mode.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
next prev parent reply other threads:[~2008-05-08 23:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-08 8:29 [PATCH] qemu-kvm: fix guest resetting Jan Kiszka
2008-05-08 23:35 ` Marcelo Tosatti [this message]
2008-05-09 8:13 ` Jan Kiszka
2008-05-09 16:59 ` Marcelo Tosatti
2008-05-09 18:46 ` Anthony Liguori
2008-05-10 8:26 ` Jan Kiszka
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=20080508233528.GB6429@dmt \
--to=mtosatti@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm-devel@lists.sourceforge.net \
/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