From: Alexander Graf Subject: [PATCH 1/4] KVM: PPC: BookE: Allow irq deliveries to inject requests Date: Sat, 5 Jan 2013 00:41:40 +0100 Message-ID: <1357342903-11585-2-git-send-email-agraf@suse.de> References: <1357342903-11585-1-git-send-email-agraf@suse.de> Cc: KVM list , Scott Wood , Mihai Caraman To: kvm-ppc@vger.kernel.org Return-path: In-Reply-To: <1357342903-11585-1-git-send-email-agraf@suse.de> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org From: Mihai Caraman When injecting an interrupt into guest context, we usually don't need to check for requests anymore. At least not until today. With the introduction of EPR, we will have to create a request when the guest has successfully accepted an external interrupt though. So we need to prepare the interrupt delivery to abort guest entry gracefully. Otherwise we'd delay the EPR request. Signed-off-by: Alexander Graf --- v1 -> v2: - do an explicit requests check rather than play with return values --- arch/powerpc/kvm/booke.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 69f1140..964f447 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -581,6 +581,11 @@ int kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu) kvmppc_core_check_exceptions(vcpu); + if (vcpu->requests) { + /* Exception delivery raised request; start over */ + return 1; + } + if (vcpu->arch.shared->msr & MSR_WE) { local_irq_enable(); kvm_vcpu_block(vcpu); -- 1.6.0.2