From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] Ensure SIGALRM causes a cpu_loop_exit
Date: Fri, 23 Nov 2007 23:43:35 +0000 [thread overview]
Message-ID: <200711232343.37131.paul@codesourcery.com> (raw)
In-Reply-To: <fb249edb0711231450u5f2405e9h1f36ec879afa114e@mail.gmail.com>
> There is a chance that when using "unix" or "dynticks" clock, the
> signal arrives when no cpu is executing.
I've seen similar stalls, but not managed to track down the source. Your
analysis seems correct.
> + /* cause an interrupt in the first cpu that tries to start running */
> + if (!env) {
> + env_pending_request | mask
IIUC We should assert that mask == CPU_INTERRUPT_EXIT. If we try to raise an
actual interrupt without an active CPU then something else is wrong. In fact
this probably means env_pending_request can be a simple boolean (indicating
we want to break out of cpu_exec), rather than munging it into
env->interrupt_request.
it took me a while to figure out exactly which race condition we're avoiding
here. How adding a comment like:
/* There is a window for signals to arrive between main_loop checking for
events and setting cpu_single_env here. Check if this occurred and we need
to exit back to the IO loop. */
> + if (env_pending_request) {
> + cpu_interrupt(env1, env_pending_request);
> + env_pending_request = 0;
> + }
> +
next prev parent reply other threads:[~2007-11-23 23:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-23 22:50 [Qemu-devel] [RFC] Ensure SIGALRM causes a cpu_loop_exit andrzej zaborowski
2007-11-23 23:43 ` Paul Brook [this message]
2007-11-24 23:13 ` andrzej zaborowski
2007-12-02 16:42 ` Thiemo Seufer
2007-12-03 3:06 ` andrzej zaborowski
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=200711232343.37131.paul@codesourcery.com \
--to=paul@codesourcery.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.