diff options
author | Andrew Jones | 2020-10-01 08:17:18 +0200 |
---|---|---|
committer | Peter Maydell | 2020-10-08 16:24:32 +0200 |
commit | 68970d1e0d07e3a266141bbd9038fd9890ca88f2 (patch) | |
tree | d63c836446b8badc5006aa9ce76ca90cb2ef16c5 /target/arm/kvm_arm.h | |
parent | tests/qtest: Restore aarch64 arm-cpu-features test (diff) | |
download | qemu-68970d1e0d07e3a266141bbd9038fd9890ca88f2.tar.gz qemu-68970d1e0d07e3a266141bbd9038fd9890ca88f2.tar.xz qemu-68970d1e0d07e3a266141bbd9038fd9890ca88f2.zip |
hw/arm/virt: Implement kvm-steal-time
We add the kvm-steal-time CPU property and implement it for machvirt.
A tiny bit of refactoring was also done to allow pmu and pvtime to
use the same vcpu device helper functions.
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
Message-id: 20201001061718.101915-7-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 | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index f513702176..eb81b7059e 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -268,6 +268,24 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu); void kvm_arm_add_vcpu_properties(Object *obj); /** + * kvm_arm_steal_time_finalize: + * @cpu: ARMCPU for which to finalize kvm-steal-time + * @errp: Pointer to Error* for error propagation + * + * Validate the kvm-steal-time property selection and set its default + * based on KVM support and guest configuration. + */ +void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp); + +/** + * kvm_arm_steal_time_supported: + * + * Returns: true if KVM can enable steal time reporting + * and false otherwise. + */ +bool kvm_arm_steal_time_supported(void); + +/** * kvm_arm_aarch32_supported: * * Returns: true if KVM can enable AArch32 mode @@ -340,6 +358,16 @@ int kvm_arm_vgic_probe(void); void kvm_arm_pmu_set_irq(CPUState *cs, int irq); void kvm_arm_pmu_init(CPUState *cs); + +/** + * kvm_arm_pvtime_init: + * @cs: CPUState + * @ipa: Per-vcpu guest physical base address of the pvtime structures + * + * Initializes PVTIME for the VCPU, setting the PVTIME IPA to @ipa. + */ +void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa); + int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); #else @@ -363,6 +391,11 @@ static inline bool kvm_arm_sve_supported(void) return false; } +static inline bool kvm_arm_steal_time_supported(void) +{ + return false; +} + /* * These functions should never actually be called without KVM support. */ @@ -396,6 +429,16 @@ static inline void kvm_arm_pmu_init(CPUState *cs) g_assert_not_reached(); } +static inline void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) +{ + g_assert_not_reached(); +} + +static inline void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp) +{ + g_assert_not_reached(); +} + static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) { g_assert_not_reached(); |