KVM: PPC: Ignore unhalt request from kvm_vcpu_block
authorAlexander Graf <agraf@suse.de>
Wed, 14 Mar 2012 15:55:08 +0000 (16:55 +0100)
committerAvi Kivity <avi@redhat.com>
Sun, 8 Apr 2012 11:02:38 +0000 (14:02 +0300)
When running kvm_vcpu_block and it realizes that the CPU is actually good
to run, we get a request bit set for KVM_REQ_UNHALT. Right now, there's
nothing we can do with that bit, so let's unset it right after the call
again so we don't get confused in our later checks for pending work.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/kvm/book3s_pr.c
arch/powerpc/kvm/book3s_pr_papr.c
arch/powerpc/kvm/booke.c

index a7f031b6fc98f55aa8a6d5d8cab8bd59dc27c32d..912e10fbf6ef83b312b6769428305a3121f00e41 100644 (file)
@@ -120,6 +120,7 @@ void kvmppc_set_msr(struct kvm_vcpu *vcpu, u64 msr)
        if (msr & MSR_POW) {
                if (!vcpu->arch.pending_exceptions) {
                        kvm_vcpu_block(vcpu);
+                       clear_bit(KVM_REQ_UNHALT, &vcpu->requests);
                        vcpu->stat.halt_wakeup++;
 
                        /* Unset POW bit after we woke up */
index 6d1bfe246f0a5c7ac94cef8e3cc2effca24ef44e..60ac0e79347612a45bd544485edbe12fd4e85e07 100644 (file)
@@ -224,6 +224,7 @@ int kvmppc_h_pr(struct kvm_vcpu *vcpu, unsigned long cmd)
                return kvmppc_h_pr_bulk_remove(vcpu);
        case H_CEDE:
                kvm_vcpu_block(vcpu);
+               clear_bit(KVM_REQ_UNHALT, &vcpu->requests);
                vcpu->stat.halt_wakeup++;
                return EMULATE_DONE;
        }
index 2675dcb40a7f4cc0acedf857a586e96804b1bc9c..72f13f4a06e0d0bb16e442b9840f87c9c8b1339b 100644 (file)
@@ -449,6 +449,7 @@ int kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu)
        if (vcpu->arch.shared->msr & MSR_WE) {
                local_irq_enable();
                kvm_vcpu_block(vcpu);
+               clear_bit(KVM_REQ_UNHALT, &vcpu->requests);
                local_irq_disable();
 
                kvmppc_set_exit_type(vcpu, EMULATED_MTMSRWE_EXITS);
This page took 0.046341 seconds and 5 git commands to generate.