Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hexagon: append eflags to unknown cpu model string
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>
  • Loading branch information
quic-mathbern authored and taylorsimpson committed May 12, 2023
1 parent 23b3c1c commit 6c97e03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion linux-user/hexagon/target_elf.h
Expand Up @@ -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 */
Expand All @@ -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

0 comments on commit 6c97e03

Please sign in to comment.