summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/reset.c
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2012-12-07 17:52:03 +0000
committerMarc Zyngier <marc.zyngier@arm.com>2013-06-12 16:40:32 +0100
commit003300de6c3e51934fb52eb2677f6f4fb4996cbd (patch)
tree1d214ebdd5cdcc9f86a0a44c6670a55c4da7f53f /arch/arm64/kvm/reset.c
parentf61701e0a24a09aa4a44baf24e57dcc5e706afa8 (diff)
downloadlinux-003300de6c3e51934fb52eb2677f6f4fb4996cbd.tar.bz2
arm64: KVM: Plug the arch timer
Add support for the in-kernel timer emulation. Reviewed-by: Christopher Covington <cov@codeaurora.org> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/kvm/reset.c')
-rw-r--r--arch/arm64/kvm/reset.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
index f6536a06231a..766150ac76ed 100644
--- a/arch/arm64/kvm/reset.c
+++ b/arch/arm64/kvm/reset.c
@@ -23,6 +23,8 @@
#include <linux/kvm_host.h>
#include <linux/kvm.h>
+#include <kvm/arm_arch_timer.h>
+
#include <asm/cputype.h>
#include <asm/ptrace.h>
#include <asm/kvm_arm.h>
@@ -36,6 +38,11 @@ static const struct kvm_regs default_regs_reset = {
PSR_F_BIT | PSR_D_BIT),
};
+static const struct kvm_irq_level default_vtimer_irq = {
+ .irq = 27,
+ .level = 1,
+};
+
int kvm_arch_dev_ioctl_check_extension(long ext)
{
int r;
@@ -58,11 +65,13 @@ int kvm_arch_dev_ioctl_check_extension(long ext)
*/
int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
{
+ const struct kvm_irq_level *cpu_vtimer_irq;
const struct kvm_regs *cpu_reset;
switch (vcpu->arch.target) {
default:
cpu_reset = &default_regs_reset;
+ cpu_vtimer_irq = &default_vtimer_irq;
break;
}
@@ -72,5 +81,8 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
/* Reset system registers */
kvm_reset_sys_regs(vcpu);
+ /* Reset timer */
+ kvm_timer_vcpu_reset(vcpu, cpu_vtimer_irq);
+
return 0;
}