Skip to content

Commit

Permalink
target/alpha: Remove fallback to ev67 cpu class
Browse files Browse the repository at this point in the history
'ev67' CPU class will be returned to match everything, which makes
no sense as mentioned in the comments. Remove the logic to fall
back to 'ev67' CPU class to match everything.

Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231114235628.534334-2-gshan@redhat.com>
[PMD: Reword subject, replace 'any' -> 'ev67' on linux-user]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
  • Loading branch information
Gavin Shan authored and philmd committed Jan 5, 2024
1 parent bf96432 commit 9c115f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion linux-user/alpha/target_elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
#define ALPHA_TARGET_ELF_H
static inline const char *cpu_get_model(uint32_t eflags)
{
return "any";
return "ev67";
}
#endif
7 changes: 2 additions & 5 deletions target/alpha/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,8 @@ static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model)
typename = g_strdup_printf(ALPHA_CPU_TYPE_NAME("%s"), cpu_model);
oc = object_class_by_name(typename);
g_free(typename);

/* TODO: remove match everything nonsense */
if (!oc || object_class_is_abstract(oc)) {
/* Default to ev67; no reason not to emulate insns by default. */
oc = object_class_by_name(ALPHA_CPU_TYPE_NAME("ev67"));
if (!oc || !object_class_dynamic_cast(oc, TYPE_ALPHA_CPU)) {
return NULL;
}

return oc;
Expand Down

0 comments on commit 9c115f6

Please sign in to comment.