Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
target/arm/kvm: Have kvm_arm_sve_get_vls take a ARMCPU argument
Unify the "kvm_arm.h" API: All functions related to ARM vCPUs
take a ARMCPU* argument. Use the CPU() QOM cast macro When
calling the generic vCPU API from "sysemu/kvm.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Message-id: 20231123183518.64569-6-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
philmd authored and pm215 committed Dec 19, 2023
1 parent bc1b09b commit d633928
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion target/arm/cpu64.c
Expand Up @@ -66,7 +66,7 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp)
*/
if (kvm_enabled()) {
if (kvm_arm_sve_supported()) {
cpu->sve_vq.supported = kvm_arm_sve_get_vls(CPU(cpu));
cpu->sve_vq.supported = kvm_arm_sve_get_vls(cpu);
vq_supported = cpu->sve_vq.supported;
} else {
assert(!cpu_isar_feature(aa64_sve, cpu));
Expand Down
2 changes: 1 addition & 1 deletion target/arm/kvm.c
Expand Up @@ -1801,7 +1801,7 @@ bool kvm_arm_sve_supported(void)

QEMU_BUILD_BUG_ON(KVM_ARM64_SVE_VQ_MIN != 1);

uint32_t kvm_arm_sve_get_vls(CPUState *cs)
uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu)
{
/* Only call this function if kvm_arm_sve_supported() returns true. */
static uint64_t vls[KVM_ARM64_SVE_VLS_WORDS];
Expand Down
6 changes: 3 additions & 3 deletions target/arm/kvm_arm.h
Expand Up @@ -129,13 +129,13 @@ void kvm_arm_destroy_scratch_host_vcpu(int *fdarray);

/**
* kvm_arm_sve_get_vls:
* @cs: CPUState
* @cpu: ARMCPU
*
* Get all the SVE vector lengths supported by the KVM host, setting
* the bits corresponding to their length in quadwords minus one
* (vq - 1) up to ARM_MAX_VQ. Return the resulting map.
*/
uint32_t kvm_arm_sve_get_vls(CPUState *cs);
uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu);

/**
* kvm_arm_set_cpu_features_from_host:
Expand Down Expand Up @@ -278,7 +278,7 @@ static inline void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp)
g_assert_not_reached();
}

static inline uint32_t kvm_arm_sve_get_vls(CPUState *cs)
static inline uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu)
{
g_assert_not_reached();
}
Expand Down

0 comments on commit d633928

Please sign in to comment.