Patchwork KVM: PPC: Book3S: PR: Fix preemption

login
register
mail settings
Submitter Alexander Graf
Date March 14, 2012, 4:28 p.m.
Message ID <1331742496-10377-1-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/146673/
State New
Headers show

Comments

Alexander Graf - March 14, 2012, 4:28 p.m.
We were leaking preemption counters. Fix the code to always toggle
between preempt and non-preempt properly.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/book3s_pr.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch

diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 62d93b0..457ba68 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -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! */