Commit 592f5d87 authored by Alexander Graf's avatar Alexander Graf Committed by Paul Mackerras

KVM: PPC: Book3S: PR: Fix preemption

We were leaking preemption counters. Fix the code to always toggle
between preempt and non-preempt properly.
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e1f8acf8
...@@ -777,6 +777,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, ...@@ -777,6 +777,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
} }
} }
preempt_disable();
if (!(r & RESUME_HOST)) { if (!(r & RESUME_HOST)) {
/* To avoid clobbering exit_reason, only check for signals if /* To avoid clobbering exit_reason, only check for signals if
* we aren't already exiting to userspace for some other * we aren't already exiting to userspace for some other
...@@ -798,8 +799,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, ...@@ -798,8 +799,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
run->exit_reason = KVM_EXIT_INTR; run->exit_reason = KVM_EXIT_INTR;
r = -EINTR; r = -EINTR;
} else { } else {
preempt_disable();
/* In case an interrupt came in that was triggered /* In case an interrupt came in that was triggered
* from userspace (like DEC), we need to check what * from userspace (like DEC), we need to check what
* to inject now! */ * to inject now! */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment