]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: PPC: Add return value to core_check_requests
authorAlexander Graf <agraf@suse.de>
Mon, 13 Aug 2012 10:50:35 +0000 (12:50 +0200)
committerAlexander Graf <agraf@suse.de>
Tue, 14 Aug 2012 22:29:21 +0000 (00:29 +0200)
Requests may want to tell us that we need to go back into host state,
so add a return value for the checks.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kvm/book3s_pr.c
arch/powerpc/kvm/booke.c
arch/powerpc/kvm/powerpc.c

index 545936428bf692c26a4ba5fd43aa7b6a75801a54..3dfc437fb9d9623da01aec95422d279aba4cfc28 100644 (file)
@@ -112,7 +112,7 @@ extern int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn,
                                     ulong val);
 extern int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn,
                                     ulong *val);
-extern void kvmppc_core_check_requests(struct kvm_vcpu *vcpu);
+extern int kvmppc_core_check_requests(struct kvm_vcpu *vcpu);
 
 extern int kvmppc_booke_init(void);
 extern void kvmppc_booke_exit(void);
index 71fa0f1873b3c1c6a19dab11bcfc9e5e513d0edb..b3c584f94cb33860d90150c6ec0da3b2ebf8bd50 100644 (file)
@@ -86,12 +86,16 @@ void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu)
        kvmppc_giveup_ext(vcpu, MSR_VSX);
 }
 
-void kvmppc_core_check_requests(struct kvm_vcpu *vcpu)
+int kvmppc_core_check_requests(struct kvm_vcpu *vcpu)
 {
+       int r = 1; /* Indicate we want to get back into the guest */
+
        /* We misuse TLB_FLUSH to indicate that we want to clear
           all shadow cache entries */
        if (kvm_check_request(KVM_REQ_TLB_FLUSH, vcpu))
                kvmppc_mmu_pte_flush(vcpu, 0, 0);
+
+       return r;
 }
 
 /************* MMU Notifiers *************/
index 1917802463f5a765afaa74e79eb9914dac542f79..c36493087dbf896b6672ea4016431dfe6593a972 100644 (file)
@@ -455,14 +455,18 @@ int kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu)
        return r;
 }
 
-void kvmppc_core_check_requests(struct kvm_vcpu *vcpu)
+int kvmppc_core_check_requests(struct kvm_vcpu *vcpu)
 {
+       int r = 1; /* Indicate we want to get back into the guest */
+
        if (kvm_check_request(KVM_REQ_PENDING_TIMER, vcpu))
                update_timer_ints(vcpu);
 #if defined(CONFIG_KVM_E500V2) || defined(CONFIG_KVM_E500MC)
        if (kvm_check_request(KVM_REQ_TLB_FLUSH, vcpu))
                kvmppc_core_flush_tlb(vcpu);
 #endif
+
+       return r;
 }
 
 int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
index 07e86f806e15c8f740b2c24dbb4704bc382e5ab4..da98b414c2a231d3dc5b160d4e397fa8c3fe462a 100644 (file)
@@ -83,9 +83,11 @@ int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu)
                        /* Make sure we process requests preemptable */
                        local_irq_enable();
                        trace_kvm_check_requests(vcpu);
-                       kvmppc_core_check_requests(vcpu);
+                       r = kvmppc_core_check_requests(vcpu);
                        local_irq_disable();
-                       continue;
+                       if (r > 0)
+                               continue;
+                       break;
                }
 
                if (kvmppc_core_prepare_to_enter(vcpu)) {