diff options
author | Alexander Graf <agraf@suse.de> | 2012-08-13 06:44:41 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-10-05 17:38:46 -0400 |
commit | 7ee788556bf395a8ef413bea33494df29a3409e0 (patch) | |
tree | dfc85c7287cb634cb0c6d3e367c8139fef01cf78 /arch/powerpc/kvm/powerpc.c | |
parent | 206c2ed7f1ea55222bde2954ee3d65c2e9cfb750 (diff) |
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 'arch/powerpc/kvm/powerpc.c')
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 11 |
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) | |||
53 | * Common checks before entering the guest world. Call with interrupts | 53 | * Common checks before entering the guest world. Call with interrupts |
54 | * disabled. | 54 | * disabled. |
55 | * | 55 | * |
56 | * returns !0 if a signal is pending and check_signal is true | 56 | * returns: |
57 | * | ||
58 | * == 1 if we're ready to go into guest state | ||
59 | * <= 0 if we need to go back to the host with return value | ||
57 | */ | 60 | */ |
58 | int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu) | 61 | int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu) |
59 | { | 62 | { |
60 | int r = 0; | 63 | int r = 1; |
61 | 64 | ||
62 | WARN_ON_ONCE(!irqs_disabled()); | 65 | WARN_ON_ONCE(!irqs_disabled()); |
63 | while (true) { | 66 | while (true) { |
@@ -69,7 +72,9 @@ int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu) | |||
69 | } | 72 | } |
70 | 73 | ||
71 | if (signal_pending(current)) { | 74 | if (signal_pending(current)) { |
72 | r = 1; | 75 | kvmppc_account_exit(vcpu, SIGNAL_EXITS); |
76 | vcpu->run->exit_reason = KVM_EXIT_INTR; | ||
77 | r = -EINTR; | ||
73 | break; | 78 | break; |
74 | } | 79 | } |
75 | 80 | ||