aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/reset.c
diff options
context:
space:
mode:
authorJintack Lim <jintack@cs.columbia.edu>2017-02-03 10:20:03 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2017-02-08 10:13:34 -0500
commita91d18551e7b35e34a04b6fd199ca8568e7e9315 (patch)
tree77f47ef83c6ce0d35fbaf25e993ad6f264330d5f /arch/arm/kvm/reset.c
parent009a5701bb2d166073f75643bc9237fe014c6bf5 (diff)
KVM: arm/arm64: Initialize the emulated EL1 physical timer
Initialize the emulated EL1 physical timer with the default irq number. Signed-off-by: Jintack Lim <jintack@cs.columbia.edu> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/kvm/reset.c')
-rw-r--r--arch/arm/kvm/reset.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/kvm/reset.c b/arch/arm/kvm/reset.c
index 4b5e802e57d1..1da8b2d14550 100644
--- a/arch/arm/kvm/reset.c
+++ b/arch/arm/kvm/reset.c
@@ -37,6 +37,11 @@ static struct kvm_regs cortexa_regs_reset = {
37 .usr_regs.ARM_cpsr = SVC_MODE | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT, 37 .usr_regs.ARM_cpsr = SVC_MODE | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT,
38}; 38};
39 39
40static const struct kvm_irq_level cortexa_ptimer_irq = {
41 { .irq = 30 },
42 .level = 1,
43};
44
40static const struct kvm_irq_level cortexa_vtimer_irq = { 45static const struct kvm_irq_level cortexa_vtimer_irq = {
41 { .irq = 27 }, 46 { .irq = 27 },
42 .level = 1, 47 .level = 1,
@@ -58,6 +63,7 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
58{ 63{
59 struct kvm_regs *reset_regs; 64 struct kvm_regs *reset_regs;
60 const struct kvm_irq_level *cpu_vtimer_irq; 65 const struct kvm_irq_level *cpu_vtimer_irq;
66 const struct kvm_irq_level *cpu_ptimer_irq;
61 67
62 switch (vcpu->arch.target) { 68 switch (vcpu->arch.target) {
63 case KVM_ARM_TARGET_CORTEX_A7: 69 case KVM_ARM_TARGET_CORTEX_A7:
@@ -65,6 +71,7 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
65 reset_regs = &cortexa_regs_reset; 71 reset_regs = &cortexa_regs_reset;
66 vcpu->arch.midr = read_cpuid_id(); 72 vcpu->arch.midr = read_cpuid_id();
67 cpu_vtimer_irq = &cortexa_vtimer_irq; 73 cpu_vtimer_irq = &cortexa_vtimer_irq;
74 cpu_ptimer_irq = &cortexa_ptimer_irq;
68 break; 75 break;
69 default: 76 default:
70 return -ENODEV; 77 return -ENODEV;
@@ -77,5 +84,5 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
77 kvm_reset_coprocs(vcpu); 84 kvm_reset_coprocs(vcpu);
78 85
79 /* Reset arch_timer context */ 86 /* Reset arch_timer context */
80 return kvm_timer_vcpu_reset(vcpu, cpu_vtimer_irq); 87 return kvm_timer_vcpu_reset(vcpu, cpu_vtimer_irq, cpu_ptimer_irq);
81} 88}