Hi,

 

I'm building a device with QEMU. In realization of the device, I created a
thread with qemu_thread_create. The thread is a dead loop blocking at
reading a socket. If it gets something from the socket, the thread will
raise irq with qemu_set_irq.

When I run the program, sometimes I get

Bail out! ERROR:../accel/tcg/tcg-cpus.c:69:tcg_cpus_handle_interrupt:
assertion failed: (qemu_mutex_iothread_locked())

I tried to hook gdb to the program and watch the value causing the assertion
- iothread_locked, the value is false.

While in the meantime, another thread (probably some vcpu) has just taken
its iothread_locked lock. I assume it's irrelevant.

I also searched other instances of references of qemu_thread_create. none of
the created threads manipulates irq.

So I'm wandering is this problem because QEMU does not support qemu_set_irq
in a thread that is neither QEMU mainloop or vcpu?

Is there a better way in QEMU to get the work done, probably without
creating a thread?

 

I will bother you with more details if the above is not sufficient.

Thank you.

Reply via email to