[RFC PATCH 02/13] target/arm: Remove aarch64 test for kvm

Richard Henderson posted 13 patches 1 month, 3 weeks ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
[RFC PATCH 02/13] target/arm: Remove aarch64 test for kvm
Posted by Richard Henderson 1 month, 3 weeks ago
We no longer support kvm for aarch32, therefore the aarch64
test is trivially true.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/cpu64.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 5d7c6b7fbb..10c6796548 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -767,9 +767,7 @@ static void aarch64_host_initfn(Object *obj)
     ARMCPU *cpu = ARM_CPU(obj);
 #if defined(CONFIG_KVM)
     kvm_arm_set_cpu_features_from_host(cpu);
-    if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
-        aarch64_add_sve_properties(obj);
-    }
+    aarch64_add_sve_properties(obj);
 #elif defined(CONFIG_HVF)
     hvf_arm_set_cpu_features_from_host(cpu);
 #elif defined(CONFIG_WHPX)
-- 
2.43.0
Re: [RFC PATCH 02/13] target/arm: Remove aarch64 test for kvm
Posted by Peter Maydell 1 month, 2 weeks ago
On Mon, 16 Feb 2026 at 03:45, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> We no longer support kvm for aarch32, therefore the aarch64
> test is trivially true.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/cpu64.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
> index 5d7c6b7fbb..10c6796548 100644
> --- a/target/arm/cpu64.c
> +++ b/target/arm/cpu64.c
> @@ -767,9 +767,7 @@ static void aarch64_host_initfn(Object *obj)
>      ARMCPU *cpu = ARM_CPU(obj);
>  #if defined(CONFIG_KVM)
>      kvm_arm_set_cpu_features_from_host(cpu);
> -    if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
> -        aarch64_add_sve_properties(obj);
> -    }
> +    aarch64_add_sve_properties(obj);
>  #elif defined(CONFIG_HVF)
>      hvf_arm_set_cpu_features_from_host(cpu);
>  #elif defined(CONFIG_WHPX)


Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
Re: [RFC PATCH 02/13] target/arm: Remove aarch64 test for kvm
Posted by Mohamed Mediouni 1 month, 3 weeks ago
> On 16. Feb 2026, at 04:44, Richard Henderson <richard.henderson@linaro.org> wrote:
> 
> We no longer support kvm for aarch32, therefore the aarch64
> test is trivially true.
> 
Hello,

Probably harmless but aren’t AArch32 guests on an AArch64 KVM host still supported?

aarch64_cpu_set_aarch64 in target/arm/cpu.c unsets ARM_FEATURE_AARCH64
for being able to support that case.

Thank you,
> 
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/arm/cpu64.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
> index 5d7c6b7fbb..10c6796548 100644
> --- a/target/arm/cpu64.c
> +++ b/target/arm/cpu64.c
> @@ -767,9 +767,7 @@ static void aarch64_host_initfn(Object *obj)
>     ARMCPU *cpu = ARM_CPU(obj);
> #if defined(CONFIG_KVM)
>     kvm_arm_set_cpu_features_from_host(cpu);
> -    if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
> -        aarch64_add_sve_properties(obj);
> -    }
> +    aarch64_add_sve_properties(obj);
> #elif defined(CONFIG_HVF)
>     hvf_arm_set_cpu_features_from_host(cpu);
> #elif defined(CONFIG_WHPX)
> -- 
> 2.43.0
> 
> 
Re: [RFC PATCH 02/13] target/arm: Remove aarch64 test for kvm
Posted by Richard Henderson 1 month, 3 weeks ago
On 2/16/26 14:23, Mohamed Mediouni wrote:
> 
>> On 16. Feb 2026, at 04:44, Richard Henderson <richard.henderson@linaro.org> wrote:
>>
>> We no longer support kvm for aarch32, therefore the aarch64
>> test is trivially true.
>>
> Hello,
> 
> Probably harmless but aren’t AArch32 guests on an AArch64 KVM host still supported?

Yes, via the aarch64=off property. Here, we are only concerned about adding or not adding 
the sve property set.

Note that all properties are processed much later when we consume the command-line.  We 
can't conditionally add properties based on other properties.


r~

> 
> aarch64_cpu_set_aarch64 in target/arm/cpu.c unsets ARM_FEATURE_AARCH64
> for being able to support that case.
> 
> Thank you,
>>
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>> target/arm/cpu64.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
>> index 5d7c6b7fbb..10c6796548 100644
>> --- a/target/arm/cpu64.c
>> +++ b/target/arm/cpu64.c
>> @@ -767,9 +767,7 @@ static void aarch64_host_initfn(Object *obj)
>>      ARMCPU *cpu = ARM_CPU(obj);
>> #if defined(CONFIG_KVM)
>>      kvm_arm_set_cpu_features_from_host(cpu);
>> -    if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
>> -        aarch64_add_sve_properties(obj);
>> -    }
>> +    aarch64_add_sve_properties(obj);
>> #elif defined(CONFIG_HVF)
>>      hvf_arm_set_cpu_features_from_host(cpu);
>> #elif defined(CONFIG_WHPX)
>> -- 
>> 2.43.0
>>
>>
>