Skip to content

Commit 7e16aa8

Browse files
committed
KVM: arm/arm64: Fix preemptible timer active state crazyness
We were setting the physical active state on the GIC distributor in a preemptible section, which could cause us to set the active state on different physical CPU from the one we were actually going to run on, hacoc ensues. Since we are no longer descheduling/scheduling soft timers in the flush/sync timer functions, simply moving the timer flush into a non-preemptible section. Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
1 parent 498cd5c commit 7e16aa8

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

arch/arm/kvm/arm.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -563,18 +563,13 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
563563
if (vcpu->arch.power_off || vcpu->arch.pause)
564564
vcpu_sleep(vcpu);
565565

566-
/*
567-
* Disarming the background timer must be done in a
568-
* preemptible context, as this call may sleep.
569-
*/
570-
kvm_timer_flush_hwstate(vcpu);
571-
572566
/*
573567
* Preparing the interrupts to be injected also
574568
* involves poking the GIC, which must be done in a
575569
* non-preemptible context.
576570
*/
577571
preempt_disable();
572+
kvm_timer_flush_hwstate(vcpu);
578573
kvm_vgic_flush_hwstate(vcpu);
579574

580575
local_irq_disable();

0 commit comments

Comments
 (0)