hax: fix breakage in locking
PATCH 1/1 hax: fix breakage in locking
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.
--- cpus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
cpus.c +2 -1
@@ -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;
Signature · 1 line
2.12.0.367.g23dc2f6d3c-goog
Paolo Bonzini
AppliedQuoted 22 lines · Vincent Palatin
use
qemu_mutex_lock_iothreadconsistently inqemu_hax_cpu_thread_fn()as done in other_thread_fnfunctions, instead of grabbing directly the BQL. This way we ensure thatiothread_lockedis 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 <[email protected]>--- cpus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)cpus.c +0
-0
cpus.c static void *qemu_hax_cpu_thread_fn(void *arg) · line 1352
Quoted 10 lines
cpus.c +2
-1@@ -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