[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 35/44] Hexagon: append eflags to unknown cpu model string
From: |
Taylor Simpson |
Subject: |
[PULL v2 35/44] Hexagon: append eflags to unknown cpu model string |
Date: |
Thu, 18 May 2023 13:04:02 -0700 |
From: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Running qemu-hexagon with a binary that was compiled for an arch version
unknown by qemu can produce a somewhat confusing message:
qemu-hexagon: unable to find CPU model 'unknown'
Let's give a bit more info by appending the eflags so that the message
becomes:
qemu-hexagon: unable to find CPU model 'unknown (0x69)'
Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Tested-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Message-Id:
<8a8d013cc619b94fd4fb577ae6a8df26cedb972b.1683225804.git.quic_mathbern@quicinc.com>
---
linux-user/hexagon/target_elf.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/linux-user/hexagon/target_elf.h b/linux-user/hexagon/target_elf.h
index a0271a0a2a..36056fc9f0 100644
--- a/linux-user/hexagon/target_elf.h
+++ b/linux-user/hexagon/target_elf.h
@@ -20,6 +20,9 @@
static inline const char *cpu_get_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 */
@@ -39,7 +42,9 @@ static inline const char *cpu_get_model(uint32_t eflags)
) {
return "v73";
}
- return "unknown";
+
+ err = snprintf(buf, sizeof(buf), "unknown (0x%x)", eflags);
+ return err >= 0 && err < sizeof(buf) ? buf : "unknown";
}
#endif
--
2.25.1
- [PULL v2 02/44] Hexagon (target/hexagon) Add v68 scalar instructions, (continued)
- [PULL v2 02/44] Hexagon (target/hexagon) Add v68 scalar instructions, Taylor Simpson, 2023/05/18
- [PULL v2 07/44] Hexagon (tests/tcg/hexagon) Add v69 HVX tests, Taylor Simpson, 2023/05/18
- [PULL v2 11/44] Hexagon (target/hexagon) Add DisasContext arg to gen_log_reg_write, Taylor Simpson, 2023/05/18
- [PULL v2 24/44] Hexagon (target/hexagon) Add overrides for disabled idef-parser insns, Taylor Simpson, 2023/05/18
- [PULL v2 20/44] Hexagon (target/hexagon) Short-circuit packet register writes, Taylor Simpson, 2023/05/18
- [PULL v2 23/44] Hexagon (target/hexagon) Short-circuit more HVX single instruction packets, Taylor Simpson, 2023/05/18
- [PULL v2 21/44] Hexagon (target/hexagon) Short-circuit packet predicate writes, Taylor Simpson, 2023/05/18
- [PULL v2 18/44] Hexagon (target/hexagon) Don't overlap dest writes with source reads, Taylor Simpson, 2023/05/18
- [PULL v2 25/44] Hexagon (target/hexagon) Make special new_value for USR, Taylor Simpson, 2023/05/18
- [PULL v2 10/44] meson.build Add CONFIG_HEXAGON_IDEF_PARSER, Taylor Simpson, 2023/05/18
- [PULL v2 35/44] Hexagon: append eflags to unknown cpu model string,
Taylor Simpson <=
- [PULL v2 08/44] Hexagon (target/hexagon) Add v73 scalar instructions, Taylor Simpson, 2023/05/18
- [PULL v2 30/44] Hexagon (target/hexagon) Move items to DisasContext, Taylor Simpson, 2023/05/18
- [PULL v2 31/44] Hexagon (target/hexagon) Additional instructions handled by idef-parser, Taylor Simpson, 2023/05/18
- [PULL v2 27/44] Hexagon (target/hexagon) Move new_pred_value to DisasContext, Taylor Simpson, 2023/05/18
- [PULL v2 33/44] Hexagon (target/hexagon/*.py): raise exception on reg parsing error, Taylor Simpson, 2023/05/18
- [PULL v2 28/44] Hexagon (target/hexagon) Move pred_written to DisasContext, Taylor Simpson, 2023/05/18
- [PULL v2 04/44] Hexagon (target/hexagon) Add v68 HVX instructions, Taylor Simpson, 2023/05/18
- [PULL v2 36/44] Hexagon (iclass): update J4_hintjumpr slot constraints, Taylor Simpson, 2023/05/18
- [PULL v2 29/44] Hexagon (target/hexagon) Move pkt_has_store_s1 to DisasContext, Taylor Simpson, 2023/05/18
- [PULL v2 19/44] Hexagon (target/hexagon) Mark registers as read during packet analysis, Taylor Simpson, 2023/05/18