Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
target/arm/kvm: Have kvm_arm_add_vcpu_properties 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-4-philmd@linaro.org
[PMM: fix parameter name in doc comment too]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
philmd authored and pm215 committed Dec 19, 2023
1 parent 600f070 commit cac675b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion target/arm/cpu.c
Expand Up @@ -1686,7 +1686,7 @@ void arm_cpu_post_init(Object *obj)
}

if (kvm_enabled()) {
kvm_arm_add_vcpu_properties(obj);
kvm_arm_add_vcpu_properties(cpu);
}

#ifndef CONFIG_USER_ONLY
Expand Down
4 changes: 2 additions & 2 deletions target/arm/kvm.c
Expand Up @@ -497,10 +497,10 @@ static void kvm_steal_time_set(Object *obj, bool value, Error **errp)
}

/* KVM VCPU properties should be prefixed with "kvm-". */
void kvm_arm_add_vcpu_properties(Object *obj)
void kvm_arm_add_vcpu_properties(ARMCPU *cpu)
{
ARMCPU *cpu = ARM_CPU(obj);
CPUARMState *env = &cpu->env;
Object *obj = OBJECT(cpu);

if (arm_feature(env, ARM_FEATURE_GENERIC_TIMER)) {
cpu->kvm_adjvtime = true;
Expand Down
6 changes: 3 additions & 3 deletions target/arm/kvm_arm.h
Expand Up @@ -148,12 +148,12 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu);

/**
* kvm_arm_add_vcpu_properties:
* @obj: The CPU object to add the properties to
* @cpu: The CPU object to add the properties to
*
* Add all KVM specific CPU properties to the CPU object. These
* are the CPU properties with "kvm-" prefixed names.
*/
void kvm_arm_add_vcpu_properties(Object *obj);
void kvm_arm_add_vcpu_properties(ARMCPU *cpu);

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

static inline void kvm_arm_add_vcpu_properties(Object *obj)
static inline void kvm_arm_add_vcpu_properties(ARMCPU *cpu)
{
g_assert_not_reached();
}
Expand Down

0 comments on commit cac675b

Please sign in to comment.