All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Cain <brian.cain@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: Fabiano Rosas <farosas@suse.de>,
	Brian Cain <brian.cain@oss.qualcomm.com>,
	 Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
	Laurent Vivier <lvivier@redhat.com>, Peter Xu <peterx@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH-for-11.2 v2 03/12] target/hexagon: fix get_exe_mode assertion in hexagon_stop_thread
Date: Fri, 20 Nov 2026 10:20:22 -0800	[thread overview]
Message-ID: <20261120182031.560481-4-brian.cain@oss.qualcomm.com> (raw)
In-Reply-To: <20261120182031.560481-1-brian.cain@oss.qualcomm.com>

When a thread in WAIT mode (W=1, E=1) executes a STOP instruction,
hexagon_stop_thread must clear the wait-mode bit before clearing
the enable bit.  Without this, clear_enable_mask creates a transient
(W=1, E=0) state in MODECTL that triggers g_assert_not_reached() in
get_exe_mode() when another thread iterates all CPUs via
hex_interrupt_update.

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 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 f53d377ab14..680dcf56803 100644
--- a/target/hexagon/cpu_helper.c
+++ b/target/hexagon/cpu_helper.c
@@ -441,6 +441,7 @@ void hexagon_stop_thread(CPUHexagonState *env)
 
     BQL_LOCK_GUARD();
 
+    clear_wait_mode(env);
     thread_enabled_mask = clear_enable_mask(env);
     cs = env_cpu(env);
     cpu_interrupt(cs, CPU_INTERRUPT_HALT);
-- 
2.34.1


  parent reply	other threads:[~2026-11-20 18:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 18:20 [PATCH-for-11.2 v2 00/12] Hexagon: fix systests + migration Brian Cain
2026-11-20 18:20 ` [PATCH-for-11.2 v2 01/12] target/hexagon: read the old predicate value through C4 Brian Cain
2026-11-20 18:20 ` [PATCH-for-11.2 v2 02/12] target/hexagon: bound packet lookahead to the current page Brian Cain
2026-11-20 18:20 ` Brian Cain [this message]
2026-11-23 17:51   ` [PATCH-for-11.2 v2 03/12] target/hexagon: fix get_exe_mode assertion in hexagon_stop_thread Pierrick Bouvier
2026-11-20 18:20 ` [PATCH-for-11.2 v2 04/12] target/hexagon: deliver floating point exceptions after the packet Brian Cain
2026-11-23 17:52   ` Pierrick Bouvier
2026-11-20 18:20 ` [PATCH-for-11.2 v2 05/12] target/hexagon: report the faulting packet for stack limit exceptions Brian Cain
2026-11-23 18:01   ` Pierrick Bouvier
2026-11-20 18:20 ` [PATCH-for-11.2 v2 06/12] target/hexagon: take exceptions for cache operations Brian Cain
2026-11-23 18:02   ` Pierrick Bouvier
2026-11-23 19:11     ` Brian Cain
2026-11-20 18:20 ` [PATCH-for-11.2 v2 07/12] target/hexagon: raise decode failures at the faulting packet Brian Cain
2026-11-23 18:03   ` Pierrick Bouvier
2026-11-20 18:20 ` [PATCH-for-11.2 v2 08/12] hw/hexagon: update the glob-reg vmstate ver Brian Cain
2026-11-23 18:04   ` Pierrick Bouvier
2026-11-20 18:20 ` [PATCH-for-11.2 v2 09/12] tests/functional/hexagon: run the rest of the tests Brian Cain
2026-11-20 18:20 ` [PATCH-for-11.2 v2 10/12] tests/tcg/hexagon: packet and COF corner cases Brian Cain
2026-11-23 18:06   ` Pierrick Bouvier
2026-11-23 19:08     ` Brian Cain
2026-11-20 18:20 ` [PATCH-for-11.2 v2 11/12] hw/hexagon: honor configured RAM backends Brian Cain
2026-11-23 18:08   ` Pierrick Bouvier
2026-11-20 18:20 ` [PATCH-for-11.2 v2 12/12] hw/hexagon: version the virt machine type Brian Cain
2026-11-23 17:37   ` Pierrick Bouvier
2026-11-23 17:47     ` Daniel P. Berrangé
2026-11-23 19:03       ` Brian Cain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120182031.560481-4-brian.cain@oss.qualcomm.com \
    --to=brian.cain@oss.qualcomm.com \
    --cc=farosas@suse.de \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.