aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoffer Dall <cdall@linaro.org>2017-07-05 06:50:27 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2017-11-06 10:23:13 -0500
commit40f4cba9a579fe7ad1431269db8aec745c290ba0 (patch)
tree8237c6dea7ece744f86c56a865002a5494401c33
parent688c50aa72f64ca21767486e5eef876ec23e418c (diff)
KVM: arm/arm64: Set VCPU affinity for virt timer irq
As we are about to take physical interrupts for the virtual timer on the host but want to leave those active while running the VM (and let the VM deactivate them), we need to set the vtimer PPI affinity accordingly. Signed-off-by: Christoffer Dall <cdall@linaro.org> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r--virt/kvm/arm/arch_timer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 93c8973a71f4..eac1b3d83a86 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -649,11 +649,20 @@ int kvm_timer_hyp_init(void)
649 return err; 649 return err;
650 } 650 }
651 651
652 err = irq_set_vcpu_affinity(host_vtimer_irq, kvm_get_running_vcpus());
653 if (err) {
654 kvm_err("kvm_arch_timer: error setting vcpu affinity\n");
655 goto out_free_irq;
656 }
657
652 kvm_info("virtual timer IRQ%d\n", host_vtimer_irq); 658 kvm_info("virtual timer IRQ%d\n", host_vtimer_irq);
653 659
654 cpuhp_setup_state(CPUHP_AP_KVM_ARM_TIMER_STARTING, 660 cpuhp_setup_state(CPUHP_AP_KVM_ARM_TIMER_STARTING,
655 "kvm/arm/timer:starting", kvm_timer_starting_cpu, 661 "kvm/arm/timer:starting", kvm_timer_starting_cpu,
656 kvm_timer_dying_cpu); 662 kvm_timer_dying_cpu);
663 return 0;
664out_free_irq:
665 free_percpu_irq(host_vtimer_irq, kvm_get_running_vcpus());
657 return err; 666 return err;
658} 667}
659 668