[PATCH v2 1/2] target/arm: Remove dead code

Philippe Mathieu-Daudé posted 2 patches 4 days, 13 hours ago
There is a newer version of this series
[PATCH v2 1/2] target/arm: Remove dead code
Posted by Philippe Mathieu-Daudé 4 days, 13 hours ago
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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/tcg/cpu32.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c
index 0b0bc96bac2..2127d456ad6 100644
--- a/target/arm/tcg/cpu32.c
+++ b/target/arm/tcg/cpu32.c
@@ -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 = {
-- 
2.52.0


Re: [PATCH v2 1/2] target/arm: Remove dead code
Posted by Peter Maydell 13 hours ago
On Mon, 2 Feb 2026 at 15:36, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> 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.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/tcg/cpu32.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c
> index 0b0bc96bac2..2127d456ad6 100644
> --- a/target/arm/tcg/cpu32.c
> +++ b/target/arm/tcg/cpu32.c
> @@ -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
>  };

This is not entirely dead, because it's what causes
"qemu-arm -cpu help" to include "any" in its list.
But we already don't list "any" for the qemu-aarch64 help
output, so it's not really a problem to drop it from the
qemu-arm equivalent list.

I've applied this patch to target-arm.next with the
commit message adjusted accordingly:

===begin===
target/arm: Remove entry for "any" from cpu32 arm_tcg_cpus[] list

Since commit a0032cc5427 ("target/arm: Make 'any' CPU just an alias
for 'max'") the 'any' CPU QOM type is never used, because we change
"any" to "max" before creating the object.  The array entry means we
have an unnecessary type in the system, and the only user-visible
effect is that "any" is listed in the "-cpu help" output for
qemu-arm.  (System emulation already doesn't include this array
entry.)

Since qemu-aarch64 already doesn't include "any" in its "-cpu help"
output, we can reasonably drop it for qemu-arm also; remove the
not-very-useful array entry.
===endit===

-- PMM
Re: [PATCH v2 1/2] target/arm: Remove dead code
Posted by Philippe Mathieu-Daudé 11 hours ago
On 6/2/26 16:28, Peter Maydell wrote:
> On Mon, 2 Feb 2026 at 15:36, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> 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.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>   target/arm/tcg/cpu32.c | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c
>> index 0b0bc96bac2..2127d456ad6 100644
>> --- a/target/arm/tcg/cpu32.c
>> +++ b/target/arm/tcg/cpu32.c
>> @@ -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
>>   };
> 
> This is not entirely dead, because it's what causes
> "qemu-arm -cpu help" to include "any" in its list.
> But we already don't list "any" for the qemu-aarch64 help
> output, so it's not really a problem to drop it from the
> qemu-arm equivalent list.
> 
> I've applied this patch to target-arm.next with the
> commit message adjusted accordingly:
> 
> ===begin===
> target/arm: Remove entry for "any" from cpu32 arm_tcg_cpus[] list
> 
> Since commit a0032cc5427 ("target/arm: Make 'any' CPU just an alias
> for 'max'") the 'any' CPU QOM type is never used, because we change
> "any" to "max" before creating the object.  The array entry means we
> have an unnecessary type in the system, and the only user-visible
> effect is that "any" is listed in the "-cpu help" output for
> qemu-arm.  (System emulation already doesn't include this array
> entry.)
> 
> Since qemu-aarch64 already doesn't include "any" in its "-cpu help"
> output, we can reasonably drop it for qemu-arm also; remove the
> not-very-useful array entry.
> ===endit===

Thank you!

Re: [PATCH v2 1/2] target/arm: Remove dead code
Posted by Pierrick Bouvier 4 days, 10 hours ago
On 2/2/26 7:36 AM, Philippe Mathieu-Daudé wrote:
> 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.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/arm/tcg/cpu32.c | 3 ---
>   1 file changed, 3 deletions(-)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>