diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2013-01-23 13:21:59 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2013-02-11 14:06:00 -0500 |
commit | 967f84275ba74eac696f798ce1a780285170b5e7 (patch) | |
tree | e8dfd11d9587c0faf1511765e84127ed50b6d6dc /arch/arm/kvm/arm.c | |
parent | c7e3ba64ba16eddfbfc66ec099860f40e808e124 (diff) |
ARM: KVM: arch_timers: Wire the init code and config option
It is now possible to select CONFIG_KVM_ARM_TIMER to enable the
KVM architected timer support.
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/kvm/arm.c')
-rw-r--r-- | arch/arm/kvm/arm.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 800b2cd804d3..9ada5549216d 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c | |||
@@ -289,6 +289,7 @@ int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu) | |||
289 | void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu) | 289 | void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu) |
290 | { | 290 | { |
291 | kvm_mmu_free_memory_caches(vcpu); | 291 | kvm_mmu_free_memory_caches(vcpu); |
292 | kvm_timer_vcpu_terminate(vcpu); | ||
292 | kmem_cache_free(kvm_vcpu_cache, vcpu); | 293 | kmem_cache_free(kvm_vcpu_cache, vcpu); |
293 | } | 294 | } |
294 | 295 | ||
@@ -330,6 +331,9 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) | |||
330 | if (ret) | 331 | if (ret) |
331 | return ret; | 332 | return ret; |
332 | 333 | ||
334 | /* Set up the timer */ | ||
335 | kvm_timer_vcpu_init(vcpu); | ||
336 | |||
333 | return 0; | 337 | return 0; |
334 | } | 338 | } |
335 | 339 | ||
@@ -1103,6 +1107,13 @@ static int init_hyp_mode(void) | |||
1103 | vgic_present = true; | 1107 | vgic_present = true; |
1104 | #endif | 1108 | #endif |
1105 | 1109 | ||
1110 | /* | ||
1111 | * Init HYP architected timer support | ||
1112 | */ | ||
1113 | err = kvm_timer_hyp_init(); | ||
1114 | if (err) | ||
1115 | goto out_free_mappings; | ||
1116 | |||
1106 | kvm_info("Hyp mode initialized successfully\n"); | 1117 | kvm_info("Hyp mode initialized successfully\n"); |
1107 | return 0; | 1118 | return 0; |
1108 | out_free_vfp: | 1119 | out_free_vfp: |