public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Dor Laor <dor.laor@qumranet.com>
To: Avi Kivity <avi@qumranet.com>,
	kvm-devel <kvm-devel@lists.sourceforge.net>
Subject: [PATCH] Don't quit IO thread before all lvcpus stopped
Date: Thu, 24 Apr 2008 01:33:20 +0300	[thread overview]
Message-ID: <1208990000.3374.20.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]

while investigating the revert of "fix sci irq set when acpi timer" I
discovered the reason. Please also re-revert the original patch.
Thanks,
Dor

-------------
[PATCH] Don't quit IO thread before all lvcpus stopped

Call pause_all_threads() before exiting the i/o thread
main loop.
This scenario happened on system_powerdown request:
The vcpu eventually makes pm_ioport_writew (soft power off)
access that calls qemu_system_shutdown_request.
It causes the i/o thread to exit although the vcpu did not
exit yet.

One of the symptoms is that vcpu may trigger timers thus
causing a segfault since the i/o thread stopped the timer.
[This is what happened on the sci irq timer, now there is no
need to revert it[

Signed-off-by: Dor Laor <dor.laor@qumranet.com>
---
 qemu/qemu-kvm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 50589a7..78127de 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -452,7 +452,9 @@ int kvm_main_loop(void)
         pthread_mutex_unlock(&qemu_mutex);
     }
 
+    pause_all_threads();
     pthread_mutex_unlock(&qemu_mutex);
+
     return 0;
 }
 
-- 
1.5.4.1


[-- Attachment #2: 0001-Don-t-quit-IO-thread-before-all-vcpus-stopped.patch --]
[-- Type: application/mbox, Size: 1156 bytes --]

[-- Attachment #3: Type: text/plain, Size: 320 bytes --]

-------------------------------------------------------------------------
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

[-- Attachment #4: Type: text/plain, Size: 158 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

             reply	other threads:[~2008-04-23 22:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-23 22:33 Dor Laor [this message]
2008-04-24 12:47 ` [PATCH] Don't quit IO thread before all lvcpus stopped Avi Kivity
2008-04-24 13:35   ` Dor Laor
2008-04-24 16:14     ` Avi Kivity

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=1208990000.3374.20.camel@localhost.localdomain \
    --to=dor.laor@qumranet.com \
    --cc=avi@qumranet.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