Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c142801 authored by Avi Kivity's avatar Avi Kivity
Browse files

KVM: Fix unbounded preemption latency



When preparing to enter the guest, if an interrupt comes in while
preemption is disabled but interrupts are still enabled, we miss a
preemption point.  Fix by explicitly checking whether we need to
reschedule.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 97db56ce
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2535,6 +2535,13 @@ again:

	local_irq_disable();

	if (need_resched()) {
		local_irq_enable();
		preempt_enable();
		r = 1;
		goto out;
	}

	if (signal_pending(current)) {
		local_irq_enable();
		preempt_enable();