Skip to contentSkip to conversation

KVM: PPC: Book3S: PR: Fix preemption

PATCH New Alexander Graf 1 participant 1 message Mar 14, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: PPC: Book3S: PR: Fix preemption

We were leaking preemption counters. Fix the code to always toggle between preempt and non-preempt properly.

---
 arch/powerpc/kvm/book3s_pr.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/powerpc/kvm/book3s_pr.c +1 -2
index 62d93b0..457ba68 100644
@@ -781,6 +781,7 @@ program_interrupt:
 	}
 	}
 
+	preempt_disable();
 	if (!(r & RESUME_HOST)) {
 		/* To avoid clobbering exit_reason, only check for signals if
 		 * we aren't already exiting to userspace for some other
@@ -802,8 +803,6 @@ program_interrupt:
 			run->exit_reason = KVM_EXIT_INTR;
 			r = -EINTR;
 		} else {
-			preempt_disable();
-
 			/* In case an interrupt came in that was triggered
 			 * from userspace (like DEC), we need to check what
 			 * to inject now! */
Signature · 1 line
1.6.0.2