[PATCH 54/56] KVM: PPC: Book3S: PR: Fix preemption

Alexander Graf
2012-03-15T12:11:23Z

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(-)

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! */
--
1.6.0.2