aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2016-05-18 11:26:00 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2016-05-20 09:39:41 -0400
commit41a54482c010d8806cf56e1501bb3b61fac14cf9 (patch)
treee8b452eddf3b83137d4a771e687deee289c422d5 /arch/arm/kvm
parentc8eb3f6b9bc31abc0ab3230737fde1639c8b1ea6 (diff)
KVM: arm/arm64: Move timer IRQ map to latest possible time
We are about to modify the VGIC to allocate all data structures dynamically and store mapped IRQ information on a per-IRQ struct, which is indeed allocated dynamically at init time. Therefore, we cannot record the mapped IRQ info from the timer at timer reset time like it's done now, because VCPU reset happens before timer init. A possible later time to do this is on the first run of a per VCPU, it just requires us to move the enable state to be a per-VCPU state and do the lookup of the physical IRQ number when we are about to run the VCPU. Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r--arch/arm/kvm/arm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index be4b6394a062..ceb9345bcf07 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -459,7 +459,7 @@ static void update_vttbr(struct kvm *kvm)
459static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu) 459static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu)
460{ 460{
461 struct kvm *kvm = vcpu->kvm; 461 struct kvm *kvm = vcpu->kvm;
462 int ret; 462 int ret = 0;
463 463
464 if (likely(vcpu->arch.has_run_once)) 464 if (likely(vcpu->arch.has_run_once))
465 return 0; 465 return 0;
@@ -482,9 +482,9 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu)
482 * interrupts from the virtual timer with a userspace gic. 482 * interrupts from the virtual timer with a userspace gic.
483 */ 483 */
484 if (irqchip_in_kernel(kvm) && vgic_initialized(kvm)) 484 if (irqchip_in_kernel(kvm) && vgic_initialized(kvm))
485 kvm_timer_enable(kvm); 485 ret = kvm_timer_enable(vcpu);
486 486
487 return 0; 487 return ret;
488} 488}
489 489
490bool kvm_arch_intc_initialized(struct kvm *kvm) 490bool kvm_arch_intc_initialized(struct kvm *kvm)