qemu-discuss
[Top][All Lists]
Advanced

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

Does QEMU support raising irq in thread created by device?


From: alan.gu
Subject: Does QEMU support raising irq in thread created by device?
Date: Wed, 21 Apr 2021 17:33:49 +0800

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

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