From: Brian Cain <brian.cain@oss.qualcomm.com>
To: qemu-devel@nongnu.org, stefanha@redhat.com
Cc: brian.cain@oss.qualcomm.com,
Taylor Simpson <ltaylorsimpson@gmail.com>,
Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>,
Anton Johansson <anjo@rev.ng>,
Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
Laurent Vivier <laurent@vivier.eu>
Subject: [PULL 2/9] Hexagon (linux-user/hexagon) Identify Hexagon version in ELF file
Date: Thu, 23 Apr 2026 19:35:59 -0700 [thread overview]
Message-ID: <20260424023606.2556830-3-brian.cain@oss.qualcomm.com> (raw)
In-Reply-To: <20260424023606.2556830-1-brian.cain@oss.qualcomm.com>
From: Taylor Simpson <ltaylorsimpson@gmail.com>
Return proper Hexagon CPU version from get_elf_cpu_model
Co-authored-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
Co-authored-by: Brian Cain <brian.cain@oss.qualcomm.com>
Signed-off-by: Taylor Simpson <ltaylorsimpson@gmail.com>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
linux-user/hexagon/elfload.c | 43 ++++++++++++++++++++++--------------
1 file changed, 26 insertions(+), 17 deletions(-)
diff --git a/linux-user/hexagon/elfload.c b/linux-user/hexagon/elfload.c
index d8b545032ab..39b02018145 100644
--- a/linux-user/hexagon/elfload.c
+++ b/linux-user/hexagon/elfload.c
@@ -10,23 +10,32 @@ const char *get_elf_cpu_model(uint32_t eflags)
static char buf[32];
int err;
- /* For now, treat anything newer than v5 as a v73 */
- /* FIXME - Disable instructions that are newer than the specified arch */
- if (eflags == 0x04 || /* v5 */
- eflags == 0x05 || /* v55 */
- eflags == 0x60 || /* v60 */
- eflags == 0x61 || /* v61 */
- eflags == 0x62 || /* v62 */
- eflags == 0x65 || /* v65 */
- eflags == 0x66 || /* v66 */
- eflags == 0x67 || /* v67 */
- eflags == 0x8067 || /* v67t */
- eflags == 0x68 || /* v68 */
- eflags == 0x69 || /* v69 */
- eflags == 0x71 || /* v71 */
- eflags == 0x8071 || /* v71t */
- eflags == 0x73 /* v73 */
- ) {
+ switch (eflags) {
+ case 0x04:
+ return "v5";
+ case 0x05:
+ return "v55";
+ case 0x60:
+ return "v60";
+ case 0x61:
+ return "v61";
+ case 0x62:
+ return "v62";
+ case 0x65:
+ return "v65";
+ case 0x66:
+ return "v66";
+ case 0x67:
+ case 0x8067: /* v67t */
+ return "v67";
+ case 0x68:
+ return "v68";
+ case 0x69:
+ return "v69";
+ case 0x71:
+ case 0x8071: /* v71t */
+ return "v71";
+ case 0x73:
return "v73";
}
--
2.34.1
next prev parent reply other threads:[~2026-04-24 2:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 2:35 [PULL 0/9] hex queue Brian Cain
2026-04-24 2:35 ` [PULL 1/9] Hexagon (target/hexagon) Properly handle Hexagon CPU version Brian Cain
2026-04-24 2:35 ` Brian Cain [this message]
2026-04-24 2:36 ` [PULL 3/9] Hexagon (target/hexagon) Add Hexagon definition field to DisasContext Brian Cain
2026-04-24 2:36 ` [PULL 4/9] Hexagon (target/hexagon) Introduce tag_rev_info.c.inc Brian Cain
2026-04-24 2:36 ` [PULL 5/9] Hexagon (target/hexagon) Check each opcode against current CPU definition Brian Cain
2026-04-24 2:36 ` [PULL 6/9] Hexagon (target/hexagon) Disassembly of invalid packets Brian Cain
2026-04-24 2:36 ` [PULL 7/9] tests/tcg/hexagon: Add test for revision-gated instruction decoding Brian Cain
2026-04-24 2:36 ` [PULL 8/9] Hexagon (target/hexagon) Remove snprint_a_pkt_debug Brian Cain
2026-04-24 2:36 ` [PULL 9/9] target/hexagon: Change DisasContext packet type Brian Cain
2026-04-25 16:59 ` [PULL 0/9] hex queue Stefan Hajnoczi
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=20260424023606.2556830-3-brian.cain@oss.qualcomm.com \
--to=brian.cain@oss.qualcomm.com \
--cc=anjo@rev.ng \
--cc=laurent@vivier.eu \
--cc=ltaylorsimpson@gmail.com \
--cc=matheus.bernardino@oss.qualcomm.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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.