> Is the device also clearing the interrupt status by calling
>
qemu_set_irq() with a level of 0 (this should happen when your
>
guest's interrupt handler does whatever it needs to do to the
>
device to clear the interrupt) ? If the device is still asserting
>
the interrupt when the ISR returns, the M profile CPU architecture
>
requires that it is automatically made pending again (so it will
>
likely be taken immediately). This is documented in the ARMv7M
>
Architecture Reference Manual (DDI0403E.b) in section B3.4.1
>
"NVIC operation". QEMU implements this in the armv7m_nvic_complete_irq()
>
function.
Yes, it turns out the device does not clear the interrupt line when the
guest code tells it to. When it is fixed, this issue is solved! I can now
move on to solving other issues.
>
I think you're seeing the correct CPU behaviour here, and the
>
problem is that the device isn't deasserting the interrupt line.
>
Either the device code is wrong, or the guest code is wrong and
>
not doing what it should to tell the device to stop asserting the
>
interrupt line.
Yes, you are absolutely right. The interrupt line is not cleared, so I
am seeing pending there.
Thank you for your help and patience, I really appreciate it!
Cheers,
Ruide Zhang