Skip to contentSkip to conversation

target/arm: Deprecate '-cpu any'

PATCH Superseded Philippe Mathieu-Daudé 2 participants 4 messages Jan 29 – Feb 2

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover target/arm: Deprecate '-cpu any'

Arm '-cpu any' is aliased to '-cpu max' since more than 5 years. Deprecate the former in preparation of removal.

Philippe Mathieu-Daudé (2):
target/arm: Remove dead code
target/arm: Deprecate '-cpu any' (remplaced by '-cpu max')

 docs/about/deprecated.rst | 8 ++++++++
 target/arm/cpu.c          | 1 +
 target/arm/tcg/cpu32.c    | 3 ---
 3 files changed, 9 insertions(+), 3 deletions(-)
Signature · 1 line
2.52.0
#1 lore raw

PATCH 1/2 target/arm: Remove dead code

Since commit a0032cc5427 ("target/arm: Make 'any' CPU just an alias for 'max'") the 'any' entry is never used (we use 'max' instead): remove it.

---
 target/arm/tcg/cpu32.c | 3 ---
 1 file changed, 3 deletions(-)
target/arm/tcg/cpu32.c +0 -3
index 0b0bc96bac2..2127d456ad6 100644
@@ -897,9 +897,6 @@ static const ARMCPUInfo arm_tcg_cpus[] = {
 #ifndef TARGET_AARCH64
     { .name = "max",         .initfn = arm_max_initfn },
 #endif
-#ifdef CONFIG_USER_ONLY
-    { .name = "any",         .initfn = arm_max_initfn },
-#endif
 };
 
 static const TypeInfo idau_interface_type_info = {
Signature · 1 line
2.52.0
#2 lore raw

PATCH 2/2 target/arm: Deprecate '-cpu any' (remplaced by '-cpu max')

In reply to Philippe Mathieu-Daudé

Since more then 5 years the '-cpu any' is aliased to '-cpu max' (see commit a0032cc5427 "target/arm: Make 'any' CPU just an alias for 'max'"). Time to deprecate the alias so we can eventually remove the alias code. Emit a warnig meanwhile.

---
 docs/about/deprecated.rst | 8 ++++++++
 target/arm/cpu.c          | 1 +
 2 files changed, 9 insertions(+)
docs/about/deprecated.rst +8 -0
index 1d5c4f3707c..c544f23cab5 100644
@@ -181,6 +181,14 @@ is going to be so much slower it wouldn't make sense for any serious
 instrumentation. Due to implementation differences there will also be
 anomalies in things like memory instrumentation.
 
+User emulation CPUs
+-------------------
+
+Arm 'any' CPU (since 11.0)
+''''''''''''''''''''''''''
+
+The Arm 'any' CPU is an alias for the 'max' CPU. Use the latter instead.
+
 System emulator CPUs
 --------------------
 
target/arm/cpu.c +1 -0
index 6e1cbf3d614..2cf3273e8ab 100644
@@ -2218,6 +2218,7 @@ static ObjectClass *arm_cpu_class_by_name(const char *cpu_model)
      * which has the same semantics as "-cpu max".
      */
     if (!strcmp(cpunamestr, "any")) {
+        warn_report("CPU type 'any' is deprecated, use 'max' instead.");
         cpunamestr = "max";
     }
 #endif
Signature · 1 line
2.52.0
Reviewed-by on the v1 series
#3 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 12 lines · Philippe Mathieu-Daudé

Arm '-cpu any' is aliased to '-cpu max' since more than 5 years. Deprecate the former in preparation of removal.

Philippe Mathieu-Daudé (2):
target/arm: Remove dead code
target/arm: Deprecate '-cpu any' (remplaced by '-cpu max')

  docs/about/deprecated.rst | 8 ++++++++
  target/arm/cpu.c          | 1 +
  target/arm/tcg/cpu32.c    | 3 ---
  3 files changed, 9 insertions(+), 3 deletions(-)