On 08/27/2011 01:31 AM, Scott Wood wrote:
int_pending was only being lowered if a bit in pending_exceptions
was cleared during exception delivery -- but for interrupts, we clear
it during IACK/TSR emulation.  This caused paravirt for enabling
MSR[EE] to be ineffective.

But that means that int_pending can still be 1 even though there is none pending as we don't get the call to deliver_interrupts when it gets lowered. Please create a common function to remove a bit from pending_exceptions and do the check there.


Alex

Signed-off-by: Scott Wood<[email protected]>
---
  arch/powerpc/kvm/booke.c |    6 +-----
  1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index d967faf..aeb69b2 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -292,7 +292,6 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu 
*vcpu,
  void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu)
  {
        unsigned long *pending =&vcpu->arch.pending_exceptions;
-       unsigned long old_pending = vcpu->arch.pending_exceptions;
        unsigned int priority;

        priority = __ffs(*pending);
@@ -306,10 +305,7 @@ void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu)
        }

        /* Tell the guest about our interrupt status */
-       if (*pending)
-               vcpu->arch.shared->int_pending = 1;
-       else if (old_pending)
-               vcpu->arch.shared->int_pending = 0;
+       vcpu->arch.shared->int_pending = !!*pending;
  }

  int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to