public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: "Liu, Eric E" <eric.e.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: The reason of using Qcow images to boot smp Windows fail ?
Date: Tue, 08 Jan 2008 12:04:30 +0200	[thread overview]
Message-ID: <47834AAE.1090806@qumranet.com> (raw)
In-Reply-To: <9D7649D18729DE4BB2BD7B494F7FEDC2D052E8-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>

Liu, Eric E wrote:
> Hi Avi
> 	For current commit Windows SMP guests will fail to boot if using
> Qcow images based on the original backend file on a remote network file
> system.  I found out that one Ap thread is hang at the place of
> bdrv_read_em() -> qemu_aio_wait() -> sigwait(), which is waiting for the
> signal SIGUSR2. Since AIO thread sends a SIGUSR2 to QEMU to indicate the
> completion of an AIO request, and if we use Qcow img, it will wait for
> the signal. In current code we don't mask the signal SIGUSR2 in VCPU0 's
> thread, so it may eat the signal the Ap thread is waiting for. if I mask
> the signal as fellow: 
>
>   1 diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
>   2 index 9aee903..9fe4235 100644
>   3 --- a/qemu/qemu-kvm.c
>   4 +++ b/qemu/qemu-kvm.c
>   5 @@ -310,9 +310,10 @@ static void setup_kernel_sigmask(CPUState *env)
>   6
>   7      sigprocmask(SIG_BLOCK, NULL, &set);
>   8      sigdelset(&set, SIG_IPI);
>   9 -    if (env->cpu_index == 0)
>  10 +    if (env->cpu_index == 0) {
>  11         sigandset(&set, &set, &io_negsigset);
>  12 -
>  13 +       sigaddset(&set, SIGUSR2);
>  14 +    }
>  15      kvm_set_signal_mask(kvm_context, env->cpu_index, &set);
>  16  }
>
>  Windows SMP guests will boot successfully. I am not very clear that why
> we don't mask it, do you have other consideration? thx.
>
>   

The intent was that vcpu 0 will handle all I/O and timers, simply to be 
similar to regular qemu.  But as you say, this breaks aio, so we should 
remove SIGUSR2 from io_sigset and io_negsigset and enable it like SIG_IPI.

Longer term I'd like to move network I/O and alarm handling to a 
separate thread to reduce vmexits, but that's a separate issue.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

      parent reply	other threads:[~2008-01-08 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-08  9:23 The reason of using Qcow images to boot smp Windows fail ? Liu, Eric E
     [not found] ` <9D7649D18729DE4BB2BD7B494F7FEDC2D052E8-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2008-01-08 10:04   ` Avi Kivity [this message]

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=47834AAE.1090806@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=eric.e.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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