A thread entering wait mode raises CPU_INTERRUPT_HALT on itself and only
takes it once its TB ends.  If another thread resumes it in between, the
HALT is still pending.

Clear the HALT on resume.

Reviewed-by: Pierrick Bouvier <[email protected]>
Signed-off-by: Brian Cain <[email protected]>
---
 target/hexagon/cpu_helper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/hexagon/cpu_helper.c b/target/hexagon/cpu_helper.c
index c66ad88108d..919fcbc7c97 100644
--- a/target/hexagon/cpu_helper.c
+++ b/target/hexagon/cpu_helper.c
@@ -98,6 +98,7 @@ static void hexagon_resume_thread(CPUHexagonState *env)
     clear_wait_mode(env);
     cs = env_cpu(env);
     ASSERT_DIRECT_TO_GUEST_UNSET(env, cs->exception_index);
+    cpu_reset_interrupt(cs, CPU_INTERRUPT_HALT);
     cs->halted = false;
     cs->exception_index = HEX_EVENT_NONE;
     qemu_cpu_kick(cs);
-- 
2.34.1

Reply via email to