Patchwork [1/4] PPC: KVM: introduce helper to check RESUME_GUEST and related

mail settings
Submitter Greg Kurz
Date Feb. 6, 2014, 4:36 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/317496/
State New
Headers show


Greg Kurz - Feb. 6, 2014, 4:36 p.m.
There are some locations where we check if the return value of a service
indicates that we should resume the guest. This patch introduces a helper
to handle the two possible values we currently have:

Since it only affects Book3S HV for now, the helper is added to
the kvm_book3s.h header file.

Signed-off-by: Greg Kurz <>
 arch/powerpc/include/asm/kvm_book3s.h |    5 +++++
 1 file changed, 5 insertions(+)

To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to
More majordomo info at


diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h
index 83851aa..bb1e38a 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -304,6 +304,11 @@  static inline ulong kvmppc_get_fault_dar(struct kvm_vcpu *vcpu)
 	return vcpu->arch.fault_dar;
+static inline bool is_kvmppc_resume_guest(int r)
+	return (r == RESUME_GUEST || r == RESUME_GUEST_NV);
 /* Magic register values loaded into r3 and r4 before the 'sc' assembly
  * instruction for the OSI hypercalls */
 #define OSI_SC_MAGIC_R3			0x113724FA