All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 1/5] KVM: PPC: booke: Fix int_pending calculation for
Date: Fri, 02 Sep 2011 13:53:22 +0000	[thread overview]
Message-ID: <4E60DFD2.5040809@suse.de> (raw)
In-Reply-To: <20110826233139.GA30607@schlenkerla.am.freescale.net>

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<scottwood@freescale.com>
> ---
>   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)


  reply	other threads:[~2011-09-02 13:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26 23:31 [PATCH 1/5] KVM: PPC: booke: Fix int_pending calculation for MSR[EE] Scott Wood
2011-09-02 13:53 ` Alexander Graf [this message]
2011-09-02 18:17 ` [PATCH 1/5] KVM: PPC: booke: Fix int_pending calculation for Scott Wood
2011-09-02 19:25 ` [PATCH 1/5] KVM: PPC: booke: Fix int_pending calculation for MSR[EE] paravirt Alexander Graf
2011-09-02 19:36 ` [PATCH 1/5] KVM: PPC: booke: Fix int_pending calculation for Scott Wood
2011-09-02 21:28 ` Scott Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E60DFD2.5040809@suse.de \
    --to=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.