summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/powerpc.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2012-08-13 12:44:41 +0200
committerAlexander Graf <agraf@suse.de>2012-10-05 23:38:46 +0200
commit7ee788556bf395a8ef413bea33494df29a3409e0 (patch)
treedfc85c7287cb634cb0c6d3e367c8139fef01cf78 /arch/powerpc/kvm/powerpc.c
parentKVM: PPC: Ignore EXITING_GUEST_MODE mode (diff)
downloadlinux-7ee788556bf395a8ef413bea33494df29a3409e0.tar.xz
linux-7ee788556bf395a8ef413bea33494df29a3409e0.zip
KVM: PPC: Add return value in prepare_to_enter
Our prepare_to_enter helper wants to be able to return in more circumstances to the host than only when an interrupt is pending. Broaden the interface a bit and move even more generic code to the generic helper. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to '')
-rw-r--r--arch/powerpc/kvm/powerpc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index dc86371b9953..0e2a98ab6a77 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -53,11 +53,14 @@ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
* Common checks before entering the guest world. Call with interrupts
* disabled.
*
- * returns !0 if a signal is pending and check_signal is true
+ * returns:
+ *
+ * == 1 if we're ready to go into guest state
+ * <= 0 if we need to go back to the host with return value
*/
int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu)
{
- int r = 0;
+ int r = 1;
WARN_ON_ONCE(!irqs_disabled());
while (true) {
@@ -69,7 +72,9 @@ int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu)
}
if (signal_pending(current)) {
- r = 1;
+ kvmppc_account_exit(vcpu, SIGNAL_EXITS);
+ vcpu->run->exit_reason = KVM_EXIT_INTR;
+ r = -EINTR;
break;
}