diff options
author | Andrew Jones <drjones@redhat.com> | 2019-10-31 15:27:33 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-11-01 20:40:59 +0000 |
commit | 6fa8a37949d912bb463caa0c139ff0ca88c6ec33 (patch) | |
tree | 4997a693b0d50948a64a572e02296b4124741896 /target/arm/kvm_arm.h | |
parent | 0cdb4020b34b455fb9ef1e6283407d952cb02e63 (diff) |
target/arm/cpu64: max cpu: Support sve properties with KVM
Extend the SVE vq map initialization and validation with KVM's
supported vector lengths when KVM is enabled. In order to determine
and select supported lengths we add two new KVM functions for getting
and setting the KVM_REG_ARM64_SVE_VLS pseudo-register.
This patch has been co-authored with Richard Henderson, who reworked
the target/arm/cpu64.c changes in order to push all the validation and
auto-enabling/disabling steps into the finalizer, resulting in a nice
LOC reduction.
Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Message-id: 20191031142734.8590-9-drjones@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/kvm_arm.h')
-rw-r--r-- | target/arm/kvm_arm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 7c12f1501a..8e14d400e8 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -213,6 +213,17 @@ typedef struct ARMHostCPUFeatures { bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf); /** + * kvm_arm_sve_get_vls: + * @cs: CPUState + * @map: bitmap to fill in + * + * Get all the SVE vector lengths supported by the KVM host, setting + * the bits corresponding to their length in quadwords minus one + * (vq - 1) in @map up to ARM_MAX_VQ. + */ +void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map); + +/** * kvm_arm_set_cpu_features_from_host: * @cpu: ARMCPU to set the features for * @@ -316,6 +327,7 @@ static inline int kvm_arm_vgic_probe(void) static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq) {} static inline void kvm_arm_pmu_init(CPUState *cs) {} +static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) {} #endif static inline const char *gic_class_name(void) |