qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] hax: fix breakage in locking


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] hax: fix breakage in locking
Date: Mon, 20 Mar 2017 12:38:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0


On 20/03/2017 11:15, Vincent Palatin wrote:
> use qemu_mutex_lock_iothread consistently in qemu_hax_cpu_thread_fn() as
> done in other _thread_fn functions, instead of grabbing directly the
> BQL. This way we ensure that iothread_locked is properly set.
> 
> On v2.9.0-rc0, QEMU was dying in an assertion in the mutex code when
> running with '--enable-hax' either on OSX or Windows. This bug was triggered
> since the code modification for multithreading added new usages of
> qemu_mutex_iothread_locked.
> This fixes the breakage on both platforms, I can now run again a full
> Chromium OS image with HAX kernel acceleration.
> 
> Signed-off-by: Vincent Palatin <address@hidden>
> ---
>  cpus.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/cpus.c b/cpus.c
> index b84a392dda..167d9615e1 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1344,8 +1344,9 @@ static void *qemu_hax_cpu_thread_fn(void *arg)
>  {
>      CPUState *cpu = arg;
>      int r;
> +
> +    qemu_mutex_lock_iothread();
>      qemu_thread_get_self(cpu->thread);
> -    qemu_mutex_lock(&qemu_global_mutex);
>  
>      cpu->thread_id = qemu_get_thread_id();
>      cpu->created = true;
> 

Queued, thanks.

Paolo



reply via email to

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