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>,
Marco Liebel <marco.liebel@oss.qualcomm.com>
Subject: [PATCH-for-11.2 v2 02/12] target/hexagon: bound packet lookahead to the current page
Date: Fri, 20 Nov 2026 10:20:21 -0800 [thread overview]
Message-ID: <20261120182031.560481-3-brian.cain@oss.qualcomm.com> (raw)
In-Reply-To: <20261120182031.560481-1-brian.cain@oss.qualcomm.com>
From: Marco Liebel <marco.liebel@oss.qualcomm.com>
Do not fetch an unmapped page while deciding where to end a TB.
This lets complete packets retire before a straddling packet faults,
and preserves the correct packet restart address.
Signed-off-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
target/hexagon/translate.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c
index ec1d79e31f6..41a0f2b0852 100644
--- a/target/hexagon/translate.c
+++ b/target/hexagon/translate.c
@@ -1620,6 +1620,11 @@ static bool pkt_crosses_page(CPUHexagonState *env, DisasContext *ctx)
int nwords;
for (nwords = 0; !found_end && nwords < PACKET_WORDS_MAX; nwords++) {
+ /* Look ahead only on this page; a fault must not discard this TB. */
+ if (ctx->base.pc_next + nwords * sizeof(uint32_t) - page_start >=
+ TARGET_PAGE_SIZE) {
+ return true;
+ }
uint32_t word = translator_ldl_end(env, &ctx->base,
ctx->base.pc_next
+ nwords * sizeof(uint32_t),
--
2.34.1
next prev 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 ` Brian Cain [this message]
2026-11-20 18:20 ` [PATCH-for-11.2 v2 03/12] target/hexagon: fix get_exe_mode assertion in hexagon_stop_thread Brian Cain
2026-11-23 17:51 ` 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-3-brian.cain@oss.qualcomm.com \
--to=brian.cain@oss.qualcomm.com \
--cc=farosas@suse.de \
--cc=lvivier@redhat.com \
--cc=marco.liebel@oss.qualcomm.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.