diff options
author | Alexander Graf <agraf@suse.de> | 2012-08-12 12:42:30 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-10-05 23:38:45 +0200 |
commit | 24afa37b9c8f035d2fe2028e4824bc4e49bafe73 (patch) | |
tree | b295955b1b74bcdd404f8bb29d5a21d6ae708419 /arch/powerpc/kvm/book3s_pr.c | |
parent | 0652eaaebea0995b3236e51dec727d62264f4248 (diff) | |
download | linux-24afa37b9c8f035d2fe2028e4824bc4e49bafe73.tar.bz2 |
KVM: PPC: Consistentify vcpu exit path
When getting out of __vcpu_run, let's be consistent about the state we
return in. We want to always
* have IRQs enabled
* have called kvm_guest_exit before
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/book3s_pr.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_pr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index 9430a362e5a3..3dec346c4b93 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c @@ -868,12 +868,15 @@ program_interrupt: */ __hard_irq_disable(); if (kvmppc_prepare_to_enter(vcpu)) { + /* local_irq_enable(); */ run->exit_reason = KVM_EXIT_INTR; r = -EINTR; + } else { + /* Going back to guest */ + kvm_guest_enter(); } } - kvm_guest_enter(); trace_kvm_book3s_reenter(r, vcpu); return r; @@ -1123,7 +1126,8 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) ret = __kvmppc_vcpu_run(kvm_run, vcpu); - kvm_guest_exit(); + /* No need for kvm_guest_exit. It's done in handle_exit. + We also get here with interrupts enabled. */ current->thread.regs->msr = ext_msr; |