[PULL 14/20] target/arm: Drop kvm_arm_sve_supported

Maintainers: Peter Maydell <peter.maydell@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, Shannon Zhao <shannon.zhaosl@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Beniamino Galvani <b.galvani@gmail.com>, Strahinja Jankovic <strahinja.p.jankovic@gmail.com>, Alistair Francis <alistair@alistair23.me>, Alexander Graf <agraf@csgraf.de>
There is a newer version of this series
[PULL 14/20] target/arm: Drop kvm_arm_sve_supported
Posted by Peter Maydell 3 days, 16 hours ago
From: Richard Henderson <richard.henderson@linaro.org>

This function has only one real use, so inline it and
drop the stubs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260216034432.23912-7-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/kvm-stub.c |  5 -----
 target/arm/kvm.c      |  9 +--------
 target/arm/kvm_arm.h  | 12 ------------
 3 files changed, 1 insertion(+), 25 deletions(-)

diff --git a/target/arm/kvm-stub.c b/target/arm/kvm-stub.c
index f2de36aef3..f1d0ca09e6 100644
--- a/target/arm/kvm-stub.c
+++ b/target/arm/kvm-stub.c
@@ -37,11 +37,6 @@ bool kvm_arm_pmu_supported(void)
     return false;
 }
 
-bool kvm_arm_sve_supported(void)
-{
-    return false;
-}
-
 bool kvm_arm_mte_supported(void)
 {
     return false;
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index b00172a289..495ac0709a 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -246,7 +246,6 @@ static int get_host_cpu_reg(int fd, ARMHostCPUFeatures *ahcf,
 
 static uint32_t kvm_arm_sve_get_vls(int fd)
 {
-    /* Only call this function if kvm_arm_sve_supported() returns true. */
     uint64_t vls[KVM_ARM64_SVE_VLS_WORDS];
     struct kvm_one_reg reg = {
         .id = KVM_REG_ARM64_SVE_VLS,
@@ -298,7 +297,7 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
      * Ask for SVE if supported, so that we can query ID_AA64ZFR0,
      * which is otherwise RAZ.
      */
-    sve_supported = kvm_arm_sve_supported();
+    sve_supported = kvm_check_extension(kvm_state, KVM_CAP_ARM_SVE);
     if (sve_supported) {
         init.features[0] |= 1 << KVM_ARM_VCPU_SVE;
     }
@@ -1937,11 +1936,6 @@ bool kvm_arm_el2_supported(void)
     return kvm_check_extension(kvm_state, KVM_CAP_ARM_EL2);
 }
 
-bool kvm_arm_sve_supported(void)
-{
-    return kvm_check_extension(kvm_state, KVM_CAP_ARM_SVE);
-}
-
 bool kvm_arm_mte_supported(void)
 {
     return kvm_check_extension(kvm_state, KVM_CAP_ARM_MTE);
@@ -2000,7 +1994,6 @@ int kvm_arch_init_vcpu(CPUState *cs)
         cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PMU_V3;
     }
     if (cpu_isar_feature(aa64_sve, cpu)) {
-        assert(kvm_arm_sve_supported());
         cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_SVE;
     }
     if (cpu_isar_feature(aa64_pauth, cpu)) {
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
index 97549766ea..cee06b5f0b 100644
--- a/target/arm/kvm_arm.h
+++ b/target/arm/kvm_arm.h
@@ -176,13 +176,6 @@ bool kvm_arm_aarch32_supported(void);
  */
 bool kvm_arm_pmu_supported(void);
 
-/**
- * kvm_arm_sve_supported:
- *
- * Returns true if KVM can enable SVE and false otherwise.
- */
-bool kvm_arm_sve_supported(void);
-
 /**
  * kvm_arm_mte_supported:
  *
@@ -208,11 +201,6 @@ static inline bool kvm_arm_pmu_supported(void)
     return false;
 }
 
-static inline bool kvm_arm_sve_supported(void)
-{
-    return false;
-}
-
 static inline bool kvm_arm_mte_supported(void)
 {
     return false;
-- 
2.43.0