summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm/arm.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2019-10-24 16:04:09 +0200
committerMarc Zyngier <maz@kernel.org>2019-10-24 16:04:09 +0200
commita4b28f5c67983d92c911ca1404728bc4ea958c0e (patch)
tree9e33ce5332ee983a7424fe6146f91f2f4f551a15 /virt/kvm/arm/arm.c
parentKVM: arm/arm64: Allow user injection of external data aborts (diff)
parentKVM: arm64: Select TASK_DELAY_ACCT+TASKSTATS rather than SCHEDSTATS (diff)
downloadlinux-a4b28f5c67983d92c911ca1404728bc4ea958c0e.tar.xz
linux-a4b28f5c67983d92c911ca1404728bc4ea958c0e.zip
Merge remote-tracking branch 'kvmarm/kvm-arm64/stolen-time' into kvmarm-master/next
Diffstat (limited to 'virt/kvm/arm/arm.c')
-rw-r--r--virt/kvm/arm/arm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
index 12064780f1d8..c11d6613f4ee 100644
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -40,6 +40,10 @@
#include <asm/kvm_coproc.h>
#include <asm/sections.h>
+#include <kvm/arm_hypercalls.h>
+#include <kvm/arm_pmu.h>
+#include <kvm/arm_psci.h>
+
#ifdef REQUIRES_VIRT
__asm__(".arch_extension virt");
#endif
@@ -373,6 +377,8 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
kvm_arm_reset_debug_ptr(vcpu);
+ kvm_arm_pvtime_vcpu_init(&vcpu->arch);
+
return kvm_vgic_vcpu_init(vcpu);
}
@@ -402,6 +408,8 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
kvm_vcpu_load_sysregs(vcpu);
kvm_arch_vcpu_load_fp(vcpu);
kvm_vcpu_pmu_restore_guest(vcpu);
+ if (kvm_arm_is_pvtime_enabled(&vcpu->arch))
+ kvm_make_request(KVM_REQ_RECORD_STEAL, vcpu);
if (single_task_running())
vcpu_clear_wfe_traps(vcpu);
@@ -667,6 +675,9 @@ static void check_vcpu_requests(struct kvm_vcpu *vcpu)
* that a VCPU sees new virtual interrupts.
*/
kvm_check_request(KVM_REQ_IRQ_PENDING, vcpu);
+
+ if (kvm_check_request(KVM_REQ_RECORD_STEAL, vcpu))
+ kvm_update_stolen_time(vcpu);
}
}