aboutsummaryrefslogtreecommitdiff
path: root/target/arm/kvm.c
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2020-10-01 08:17:18 +0200
committerPeter Maydell <peter.maydell@linaro.org>2020-10-08 15:24:32 +0100
commit68970d1e0d07e3a266141bbd9038fd9890ca88f2 (patch)
treed63c836446b8badc5006aa9ce76ca90cb2ef16c5 /target/arm/kvm.c
parent05889d15d1c95163de917800cf0e1bf6faab1bc7 (diff)
downloadqemu-68970d1e0d07e3a266141bbd9038fd9890ca88f2.zip
qemu-68970d1e0d07e3a266141bbd9038fd9890ca88f2.tar.gz
qemu-68970d1e0d07e3a266141bbd9038fd9890ca88f2.tar.bz2
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.c')
-rw-r--r--target/arm/kvm.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 0dcb9bf..ffe186d 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -192,6 +192,16 @@ static void kvm_no_adjvtime_set(Object *obj, bool value, Error **errp)
ARM_CPU(obj)->kvm_adjvtime = !value;
}
+static bool kvm_steal_time_get(Object *obj, Error **errp)
+{
+ return ARM_CPU(obj)->kvm_steal_time != ON_OFF_AUTO_OFF;
+}
+
+static void kvm_steal_time_set(Object *obj, bool value, Error **errp)
+{
+ ARM_CPU(obj)->kvm_steal_time = value ? ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF;
+}
+
/* KVM VCPU properties should be prefixed with "kvm-". */
void kvm_arm_add_vcpu_properties(Object *obj)
{
@@ -207,6 +217,12 @@ void kvm_arm_add_vcpu_properties(Object *obj)
"the virtual counter. VM stopped time "
"will be counted.");
}
+
+ cpu->kvm_steal_time = ON_OFF_AUTO_AUTO;
+ object_property_add_bool(obj, "kvm-steal-time", kvm_steal_time_get,
+ kvm_steal_time_set);
+ object_property_set_description(obj, "kvm-steal-time",
+ "Set off to disable KVM steal time.");
}
bool kvm_arm_pmu_supported(void)