Skip to content

Commit

Permalink
KVM: PPC: Book3S: PR: Fix preemption
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Alexander Graf authored and Paul Mackerras committed Apr 3, 2012
1 parent e1f8acf commit 592f5d8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/powerpc/kvm/book3s_pr.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
}
}

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
Expand All @@ -798,8 +799,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
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! */
Expand Down

0 comments on commit 592f5d8

Please sign in to comment.