aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-10-22 16:05:15 -0700
committerRichard Henderson <richard.henderson@linaro.org>2023-10-25 01:01:12 -0700
commit554abe47c7b4b68c716edb68b8843f64490d7e55 (patch)
tree61c44fff6455e2dd5fb4ec3b43845ff7f1a73237
parent5f25b383a8b76055607cabeb287a0b0e903da50c (diff)
downloadqemu-554abe47c7b4b68c716edb68b8843f64490d7e55.zip
qemu-554abe47c7b4b68c716edb68b8843f64490d7e55.tar.gz
qemu-554abe47c7b4b68c716edb68b8843f64490d7e55.tar.bz2
target/sparc: Partition cpu features
In the sparc32 binaries, do not advertise features only available to sparc64, so they cannot be enabled. In the sparc64 binaries, do not advertise features mandatory in v9, so they cannot be disabled. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--target/sparc/cpu.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index f527244..bb1a155 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -546,14 +546,17 @@ static const sparc_def_t sparc_defs[] = {
/* This must match sparc_cpu_properties[]. */
static const char * const feature_name[] = {
[CPU_FEATURE_BIT_FLOAT128] = "float128",
- [CPU_FEATURE_BIT_MUL] = "mul",
- [CPU_FEATURE_BIT_DIV] = "div",
+#ifdef TARGET_SPARC64
+ [CPU_FEATURE_BIT_CMT] = "cmt",
+ [CPU_FEATURE_BIT_GL] = "gl",
+ [CPU_FEATURE_BIT_HYPV] = "hypv",
[CPU_FEATURE_BIT_VIS1] = "vis1",
[CPU_FEATURE_BIT_VIS2] = "vis2",
+#else
+ [CPU_FEATURE_BIT_MUL] = "mul",
+ [CPU_FEATURE_BIT_DIV] = "div",
[CPU_FEATURE_BIT_FSMULD] = "fsmuld",
- [CPU_FEATURE_BIT_HYPV] = "hypv",
- [CPU_FEATURE_BIT_CMT] = "cmt",
- [CPU_FEATURE_BIT_GL] = "gl",
+#endif
};
static void print_features(uint32_t features, const char *prefix)
@@ -832,22 +835,25 @@ static PropertyInfo qdev_prop_nwindows = {
static Property sparc_cpu_properties[] = {
DEFINE_PROP_BIT("float128", SPARCCPU, env.def.features,
CPU_FEATURE_BIT_FLOAT128, false),
- DEFINE_PROP_BIT("mul", SPARCCPU, env.def.features,
- CPU_FEATURE_BIT_MUL, false),
- DEFINE_PROP_BIT("div", SPARCCPU, env.def.features,
- CPU_FEATURE_BIT_DIV, false),
+#ifdef TARGET_SPARC64
+ DEFINE_PROP_BIT("cmt", SPARCCPU, env.def.features,
+ CPU_FEATURE_BIT_CMT, false),
+ DEFINE_PROP_BIT("gl", SPARCCPU, env.def.features,
+ CPU_FEATURE_BIT_GL, false),
+ DEFINE_PROP_BIT("hypv", SPARCCPU, env.def.features,
+ CPU_FEATURE_BIT_HYPV, false),
DEFINE_PROP_BIT("vis1", SPARCCPU, env.def.features,
CPU_FEATURE_BIT_VIS1, false),
DEFINE_PROP_BIT("vis2", SPARCCPU, env.def.features,
CPU_FEATURE_BIT_VIS2, false),
+#else
+ DEFINE_PROP_BIT("mul", SPARCCPU, env.def.features,
+ CPU_FEATURE_BIT_MUL, false),
+ DEFINE_PROP_BIT("div", SPARCCPU, env.def.features,
+ CPU_FEATURE_BIT_DIV, false),
DEFINE_PROP_BIT("fsmuld", SPARCCPU, env.def.features,
CPU_FEATURE_BIT_FSMULD, false),
- DEFINE_PROP_BIT("hypv", SPARCCPU, env.def.features,
- CPU_FEATURE_BIT_HYPV, false),
- DEFINE_PROP_BIT("cmt", SPARCCPU, env.def.features,
- CPU_FEATURE_BIT_CMT, false),
- DEFINE_PROP_BIT("gl", SPARCCPU, env.def.features,
- CPU_FEATURE_BIT_GL, false),
+#endif
DEFINE_PROP_UNSIGNED("iu-version", SPARCCPU, env.def.iu_version, 0,
qdev_prop_uint64, target_ulong),
DEFINE_PROP_UINT32("fpu-version", SPARCCPU, env.def.fpu_version, 0),