@samitouri / QOSamiQemu / commits / 910ce4de83

Hexagon (linux-user/hexagon) Identify Hexagon version in ELF file

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>

Taylor Simpson committed Feb 17, 2026 at 14:22 UTC 910ce4de83b16ff6d1fb5b1c81dfefc63dfbbd0d
1 file changed +26 -17
linux-user/hexagon/elfload.c
+26 -17
@@ -10,23 +10,32 @@ const char *get_elf_cpu_model(uint32_t eflags)
10 static char buf[32];
11 int err;
12
13 - /* For now, treat anything newer than v5 as a v73 */
14 - /* FIXME - Disable instructions that are newer than the specified arch */
15 - if (eflags == 0x04 || /* v5 */
16 - eflags == 0x05 || /* v55 */
17 - eflags == 0x60 || /* v60 */
18 - eflags == 0x61 || /* v61 */
19 - eflags == 0x62 || /* v62 */
20 - eflags == 0x65 || /* v65 */
21 - eflags == 0x66 || /* v66 */
22 - eflags == 0x67 || /* v67 */
23 - eflags == 0x8067 || /* v67t */
24 - eflags == 0x68 || /* v68 */
25 - eflags == 0x69 || /* v69 */
26 - eflags == 0x71 || /* v71 */
27 - eflags == 0x8071 || /* v71t */
28 - eflags == 0x73 /* v73 */
29 - ) {
13 + switch (eflags) {
14 + case 0x04:
15 + return "v5";
16 + case 0x05:
17 + return "v55";
18 + case 0x60:
19 + return "v60";
20 + case 0x61:
21 + return "v61";
22 + case 0x62:
23 + return "v62";
24 + case 0x65:
25 + return "v65";
26 + case 0x66:
27 + return "v66";
28 + case 0x67:
29 + case 0x8067: /* v67t */
30 + return "v67";
31 + case 0x68:
32 + return "v68";
33 + case 0x69:
34 + return "v69";
35 + case 0x71:
36 + case 0x8071: /* v71t */
37 + return "v71";
38 + case 0x73:
39 return "v73";
40 }
41