From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: julien.grall@citrix.com, andrii.tseglytskyi@globallogic.com,
xen-devel@lists.xensource.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v2 for-4.5] xen/arm: clear UIE on hypervisor entry
Date: Thu, 20 Nov 2014 15:17:11 -0500 [thread overview]
Message-ID: <20141120201710.GD31889@laptop.dumpdata.com> (raw)
In-Reply-To: <1416502062.20161.8.camel@citrix.com>
On Thu, Nov 20, 2014 at 04:47:42PM +0000, Ian Campbell wrote:
> On Thu, 2014-11-20 at 10:53 +0000, Stefano Stabellini wrote:
> > UIE being set can cause maintenance interrupts to occur when Xen writes
> > to one or more LR registers. The effect is a busy loop around the
> > interrupt handler in Xen
> > (http://marc.info/?l=xen-devel&m=141597517132682): everything gets stuck.
>
> I think it would be useful to explain somewhere why/how a spurious
> interrupt can occur, if not here then in the comment you've already
> added or in another one in gic_clear_lrs where you clear UIE.
>
> The bit about clearing the LRs on entry causing UIE to become deasserted
> before we get as far as reading the IAR is a bit subtle.
>
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > Reported-and-Tested-by: Andrii Tseglytskyi <andrii.tseglytskyi@globallogic.com>
> > CC: konrad.wilk@oracle.com
>
> With the expanded commentary:
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
> > ---
> >
> > Konrad, this fixes an actual bug, at least on OMAP5. It should have no
> > bad side effects on any other platforms as far as I can tell. It should
> > go in 4.5.
As long as the testing that Julian has asked for does not demonstrate
any issues with this patch I am OK with it going in Xen 4.5.
> >
> > Changes in v2:
> >
> > - add an in-code comment about maintenance_interrupt not being called.
> >
> > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> > index 70d10d6..c6c11d3 100644
> > --- a/xen/arch/arm/gic.c
> > +++ b/xen/arch/arm/gic.c
> > @@ -403,6 +403,8 @@ void gic_clear_lrs(struct vcpu *v)
> > if ( is_idle_vcpu(v) )
> > return;
> >
> > + gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 0);
> > +
> > spin_lock_irqsave(&v->arch.vgic.lock, flags);
> >
> > while ((i = find_next_bit((const unsigned long *) &this_cpu(lr_mask),
> > @@ -527,8 +529,6 @@ void gic_inject(void)
> >
> > if ( !list_empty(¤t->arch.vgic.lr_pending) && lr_all_full() )
> > gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 1);
> > - else
> > - gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 0);
> > }
> >
> > static void do_sgi(struct cpu_user_regs *regs, enum gic_sgi sgi)
> > @@ -598,6 +598,10 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
> > * Receiving the interrupt is going to cause gic_inject to be called
> > * on return to guest that is going to clear the old LRs and inject
> > * new interrupts.
> > + *
> > + * Do not add code here: maintenance interrupts caused by setting
> > + * GICH_HCR_UIE, might read as spurious interrupts (1023). As a
> > + * consequence sometimes this handler might not be called.
> > */
> > }
> >
>
>
prev parent reply other threads:[~2014-11-20 20:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-20 10:53 [PATCH v2 for-4.5] xen/arm: clear UIE on hypervisor entry Stefano Stabellini
2014-11-20 11:02 ` Julien Grall
2014-11-20 11:06 ` Julien Grall
2014-11-20 15:54 ` Stefano Stabellini
2014-11-20 16:46 ` Julien Grall
2014-11-21 14:13 ` Julien Grall
2014-11-20 11:08 ` Stefano Stabellini
2014-11-20 16:47 ` Ian Campbell
2014-11-20 20:17 ` Konrad Rzeszutek Wilk [this message]
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=20141120201710.GD31889@laptop.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=Ian.Campbell@citrix.com \
--cc=andrii.tseglytskyi@globallogic.com \
--cc=julien.grall@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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.