diff mbox series

[v3,09/33] target/arm/cpu: remove TARGET_AARCH64 around aarch64_cpu_dump_state common

Message ID 20250501062344.2526061-10-pierrick.bouvier@linaro.org
State Superseded
Headers show
Series single-binary: compile target/arm twice | expand

Commit Message

Pierrick Bouvier May 1, 2025, 6:23 a.m. UTC
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 target/arm/cpu.c | 11 -----------
 1 file changed, 11 deletions(-)

Comments

Philippe Mathieu-Daudé May 1, 2025, 7:06 p.m. UTC | #1
Missing the "Why?". Answer, because it is guarded by is_a64().

Should we assert on is_a64() on entry?

On 1/5/25 08:23, Pierrick Bouvier wrote:
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>   target/arm/cpu.c | 11 -----------
>   1 file changed, 11 deletions(-)
> 
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index 37b11e8866f..00ae2778058 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -1183,8 +1183,6 @@ static void arm_disas_set_info(CPUState *cpu, disassemble_info *info)
>   #endif
>   }
>   
> -#ifdef TARGET_AARCH64
> -
>   static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
>   {
>       ARMCPU *cpu = ARM_CPU(cs);
> @@ -1342,15 +1340,6 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
>       }
>   }
>   
> -#else
> -
> -static inline void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
> -{
> -    g_assert_not_reached();
> -}
> -
> -#endif
> -
>   static void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags)
>   {
>       ARMCPU *cpu = ARM_CPU(cs);
Pierrick Bouvier May 3, 2025, 9:18 p.m. UTC | #2
On 5/1/25 12:06 PM, Philippe Mathieu-Daudé wrote:
> Missing the "Why?". Answer, because it is guarded by is_a64().
> 

We are guaranteed it was not used because the whole definition is under 
TARGET_AARCH64 (and not only the code inside the function).
If it was called before, out of this target, it would have triggered a 
g_assert_not_reached().

As well, yes, it's guarded by is_a64(env).
I'll update description with this.

> Should we assert on is_a64() on entry?
> 

I don't think so, from the reason above 'If it was called before'.

> On 1/5/25 08:23, Pierrick Bouvier wrote:
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> ---
>>    target/arm/cpu.c | 11 -----------
>>    1 file changed, 11 deletions(-)
>>
>> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
>> index 37b11e8866f..00ae2778058 100644
>> --- a/target/arm/cpu.c
>> +++ b/target/arm/cpu.c
>> @@ -1183,8 +1183,6 @@ static void arm_disas_set_info(CPUState *cpu, disassemble_info *info)
>>    #endif
>>    }
>>    
>> -#ifdef TARGET_AARCH64
>> -
>>    static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
>>    {
>>        ARMCPU *cpu = ARM_CPU(cs);
>> @@ -1342,15 +1340,6 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
>>        }
>>    }
>>    
>> -#else
>> -
>> -static inline void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
>> -{
>> -    g_assert_not_reached();
>> -}
>> -
>> -#endif
>> -
>>    static void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags)
>>    {
>>        ARMCPU *cpu = ARM_CPU(cs);
>
diff mbox series

Patch

diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 37b11e8866f..00ae2778058 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1183,8 +1183,6 @@  static void arm_disas_set_info(CPUState *cpu, disassemble_info *info)
 #endif
 }
 
-#ifdef TARGET_AARCH64
-
 static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
 {
     ARMCPU *cpu = ARM_CPU(cs);
@@ -1342,15 +1340,6 @@  static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
     }
 }
 
-#else
-
-static inline void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
-{
-    g_assert_not_reached();
-}
-
-#endif
-
 static void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags)
 {
     ARMCPU *cpu = ARM_CPU(cs);