I agree with this implementation. Though WFI seems make no sense for a userspace program, we should not have assumption that the userspace program will not use this instruction.
It seems ARM manual does not defined the implementation of function EnterLowPowerState(); However, before executing this instruction, there are some checks like below: if PSTATE.EL == EL0 then // Check for traps described by the OS which may be EL1 or EL2. AArch32.CheckForWFxTrap(EL1, FALSE); I am not sure whether it is complex/required to implement this in QEMU. Maybe patch the WFI as a NOP looks like the best idea at this moment. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1926759 Title: WFI instruction results in unhandled CPU exception Status in QEMU: Confirmed Bug description: Hi I refer to the WFI instruction. The bytecode is 0xe320f003. After the execution, qemu exit with the following crash log. qemu: unhandled CPU exception 0x10001 - aborting R00=00000001 R01=40800b34 R02=40800b3c R03=000102ec R04=00010a28 R05=00010158 R06=00087460 R07=00010158 R08=00000000 R09=00000000 R10=00085b7c R11=408009f4 R12=40800a08 R13=408009f0 R14=0001057c R15=000102f8 PSR=60000010 -ZC- A usr32 qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x7f5c21d0fa12 WFI aims to enter a low-power state and wait for interrupt. The raised exception seems not a right behavior. I can provide a testcase if you needed. Many thanks. Regards Muhui To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1926759/+subscriptions