All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: julien.grall@citrix.com, xen-devel@lists.xensource.com,
	Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v9 04/12] xen/arm: support HW interrupts, do not request maintenance_interrupts
Date: Thu, 12 Jun 2014 16:57:35 +0100	[thread overview]
Message-ID: <alpine.DEB.2.02.1406121656010.13771@kaball.uk.xensource.com> (raw)
In-Reply-To: <53985C3F.4030307@linaro.org>

On Wed, 11 Jun 2014, Julien Grall wrote:
> Hi Stefano,
> 
> On 06/10/2014 03:07 PM, Stefano Stabellini wrote:
> > +static void gic_update_one_lr(struct vcpu *v, int i)
> > +{
> > +    struct pending_irq *p;
> > +    uint32_t lr;
> > +    int irq;
> > +
> > +    ASSERT(spin_is_locked(&v->arch.vgic.lock));
> > +
> > +    lr = GICH[GICH_LR + i];
> > +    if ( !(lr & (GICH_LR_PENDING|GICH_LR_ACTIVE)) )
> > +    {
> > +        GICH[GICH_LR + i] = 0;
> > +        clear_bit(i, &this_cpu(lr_mask));
> > +
> > +        irq = (lr >> GICH_LR_VIRTUAL_SHIFT) & GICH_LR_VIRTUAL_MASK;
> > +        p = irq_to_pending(v, irq);
> > +        if ( p->desc != NULL )
> > +            p->desc->status &= ~IRQ_INPROGRESS;
> 
> Reading again this patch... shouldn't we take the desc->lock here?
> 
> It's possible to receive the same interrupt while we update the LRs
> (depending how the IRQ has been physically route) so we may overwrite
> the IRQ_INPROGRESS bit.

It is not possible, because we have interrupts disabled at this point.
A later patch introduce

ASSERT(!local_irq_is_enabled());

at the beginning of gic_update_one_lr.

  reply	other threads:[~2014-06-12 15:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 14:06 [PATCH v9 0/12] remove maintenance interrupts Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 01/12] xen/arm: no need to set HCR_VI when using the vgic to inject irqs Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 02/12] xen/arm: remove unused virtual parameter from vgic_vcpu_inject_irq Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 03/12] xen/arm: set GICH_HCR_UIE if all the LRs are in use Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 04/12] xen/arm: support HW interrupts, do not request maintenance_interrupts Stefano Stabellini
2014-06-11 13:40   ` Julien Grall
2014-06-12 15:57     ` Stefano Stabellini [this message]
2014-06-12 21:59       ` Julien Grall
2014-06-13 10:20         ` Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 05/12] xen/arm: nr_lrs should be uint8_t Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 06/12] xen/arm: keep track of the GICH_LR used for the irq in struct pending_irq Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 07/12] xen/arm: s/gic_set_guest_irq/gic_raise_guest_irq Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 08/12] xen/arm: rename GIC_IRQ_GUEST_PENDING to GIC_IRQ_GUEST_QUEUED Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 09/12] xen/arm: second irq injection while the first irq is still inflight Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 10/12] xen/arm: don't protect GICH and lr_queue accesses with gic.lock Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 11/12] xen/arm: introduce GIC_PRI_TO_GUEST macro Stefano Stabellini
2014-06-10 14:07 ` [PATCH v9 12/12] xen/arm: gic_events_need_delivery and irq priorities Stefano Stabellini
2014-06-18 10:36   ` Ian Campbell
2014-06-18 11:47     ` Julien Grall
2014-06-18 12:51       ` Stefano Stabellini
2014-06-18 12:59         ` Julien Grall
2014-06-18 13:17         ` Ian Campbell
2014-06-18 10:37   ` Ian Campbell

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=alpine.DEB.2.02.1406121656010.13771@kaball.uk.xensource.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=julien.grall@linaro.org \
    --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.