KVM: PPC: Move kvm_guest_enter call into generic code
authorAlexander Graf <agraf@suse.de>
Sun, 12 Aug 2012 23:24:01 +0000 (01:24 +0200)
committerAlexander Graf <agraf@suse.de>
Fri, 5 Oct 2012 21:38:45 +0000 (23:38 +0200)
We need to call kvm_guest_enter in booke and book3s, so move its
call to generic code.

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

index e737db8a5ca78f7d62fd687be7b02f180fa0d76e..1ff0d6ccc5897856d83a1d728d1d513213e4da32 100644 (file)
@@ -867,8 +867,6 @@ program_interrupt:
                        run->exit_reason = KVM_EXIT_INTR;
                        r = -EINTR;
                } else {
-                       /* Going back to guest */
-                       kvm_guest_enter();
                        kvmppc_lazy_ee_enable();
                }
        }
index 2bd190c488eff61d979a6833af1428de8219fbf9..5e8dc19091304b9424981b1280f206e7da2fe25c 100644 (file)
@@ -954,8 +954,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
                        r = (-EINTR << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
                        kvmppc_account_exit(vcpu, SIGNAL_EXITS);
                } else {
-                       /* Going back to guest */
-                       kvm_guest_enter();
                        kvmppc_lazy_ee_enable();
                }
        }
index 266549979e9f69861f1990115834946eeaa6b75c..6646574bf9302730ba5ec146ad7283fb687eac9a 100644 (file)
@@ -101,12 +101,15 @@ int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu)
                        /* Got an interrupt in between, try again */
                        local_irq_enable();
                        local_irq_disable();
+                       kvm_guest_exit();
                        continue;
                }
 
                trace_hardirqs_on();
 #endif
 
+               kvm_guest_enter();
+
                /* Going into guest context! Yay! */
                vcpu->mode = IN_GUEST_MODE;
                smp_wmb();