WFI interrupt checking mechanism and return address issue
This problem is more easier to reproduce when having hypervisor running in M mode, as WFI triggers intrusction fault to yield scheduling on CPU when TW bit is set in mstatus CSR. After mret, it would be repeately go back to WFI itself rather than pc+4, so as to repeatly trigger the trap. This is not intended behavior. And interrupt dection mechnism is not aligned with spec, as current linux kernel disable interrupt before entering WFI so interrupt triggering should negelect the global interrupt enable bits in CSR.
Yes, trying to do that.
As you’ve assigned yourself to this, does this mean you’re going to fix it?