qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] Ensure SIGALRM causes a cpu_loop_exit


From: Paul Brook
Subject: Re: [Qemu-devel] [RFC] Ensure SIGALRM causes a cpu_loop_exit
Date: Fri, 23 Nov 2007 23:43:35 +0000
User-agent: KMail/1.9.7

>   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;
> +    }
> +





reply via email to

[Prev in Thread] Current Thread [Next in Thread]