All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Cain <brian.cain@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
	Brian Cain <brian.cain@oss.qualcomm.com>
Subject: [PATCH 1/5] target/hexagon: acquire BQL before reading interrupt state
Date: Sun, 18 Oct 2026 23:09:07 -0700	[thread overview]
Message-ID: <20261019060911.1479329-2-brian.cain@oss.qualcomm.com> (raw)
In-Reply-To: <20261019060911.1479329-1-brian.cain@oss.qualcomm.com>

Move BQL_LOCK_GUARD() to the top of hex_check_interrupts.

There was a race with hex_interrupt_update on other vCPU threads when
enabling MTTCG.

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 target/hexagon/hex_interrupts.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/target/hexagon/hex_interrupts.c b/target/hexagon/hex_interrupts.c
index 03e1f28da9b..340007dd545 100644
--- a/target/hexagon/hex_interrupts.c
+++ b/target/hexagon/hex_interrupts.c
@@ -386,17 +386,19 @@ bool hex_check_interrupts(CPUHexagonState *env)
 {
     CPUState *cs = env_cpu(env);
     bool int_handled = false;
-    bool ssr_ex = get_ssr_ex(env);
+    bool ssr_ex;
     int max_ints = 32;
     bool schedcfgen;
 
+    BQL_LOCK_GUARD();
+
+    ssr_ex = get_ssr_ex(env);
+
     /* Early exit if nothing pending */
     if (get_ipend(env) == 0) {
         restore_state(env, false);
         return false;
     }
-
-    BQL_LOCK_GUARD();
     /* Only check priorities when schedcfgen is set */
     schedcfgen = get_schedcfgen(env);
     for (int i = 0; i < max_ints; i++) {
-- 
2.34.1


  reply	other threads:[~2026-10-19  6:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  6:09 [PATCH 0/5] Hexagon: enable MTTCG Brian Cain
2026-10-19  6:09 ` Brian Cain [this message]
2026-10-19 21:35   ` [PATCH 1/5] target/hexagon: acquire BQL before reading interrupt state Pierrick Bouvier
2026-10-19  6:09 ` [PATCH 2/5] target/hexagon: check exception_index in has_work Brian Cain
2026-10-19 21:36   ` Pierrick Bouvier
2026-10-19  6:09 ` [PATCH 3/5] target/hexagon: drop a pending HALT when resuming Brian Cain
2026-10-19 21:36   ` Pierrick Bouvier
2026-10-19  6:09 ` [PATCH 4/5] hw/intc: ciad should forward its mask to l2vic Brian Cain
2026-10-19 21:39   ` Pierrick Bouvier
2026-10-19  6:09 ` [PATCH 5/5] target/hexagon: enable MTTCG for system emulation Brian Cain
2026-10-19 21:38   ` Pierrick Bouvier

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=20261019060911.1479329-2-brian.cain@oss.qualcomm.com \
    --to=brian.cain@oss.qualcomm.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.