xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: julien.grall@citrix.com, xen-devel@lists.xensource.com,
	Ian.Campbell@citrix.com
Subject: Re: [PATCH v11 03/10] xen/arm: inflight irqs during migration
Date: Wed, 13 Aug 2014 16:35:25 +0100	[thread overview]
Message-ID: <53EB85BD.30909@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1408111613500.2293@kaball.uk.xensource.com>

Hi Stefano,

On 08/11/2014 04:23 PM, Stefano Stabellini wrote:
> On Fri, 8 Aug 2014, Julien Grall wrote:
>>> +void vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned int irq)
>>> +{
>>> +    unsigned long flags;
>>> +    struct pending_irq *p = irq_to_pending(old, irq);
>>> +
>>> +    /* nothing to do for virtual interrupts */
>>> +    if ( p->desc == NULL )
>>> +        return;
>>> +
>>> +    /* migration already in progress, no need to do anything */
>>> +    if ( test_bit(GIC_IRQ_GUEST_MIGRATING, &p->status) )
>>> +        return;
>>> +
>>> +    spin_lock_irqsave(&old->arch.vgic.lock, flags);
>>> +
>>> +    if ( list_empty(&p->inflight) )
>>> +    {
>>> +        spin_unlock_irqrestore(&old->arch.vgic.lock, flags);
>>> +        return;
>>> +    }
>>
>> NIT: I would create a label unlock below and jump to it. It would avoid
>> at least one of the 3 call to spin_unlock.
> 
> I would rather avoid making this kind of code style changes at this
> stage.

I'm fine with that.

>>> +    /* If the IRQ is still lr_pending, re-inject it to the new vcpu */
>>> +    if ( !list_empty(&p->lr_queue) )
>>> +    {
>>> +        list_del_init(&p->lr_queue);
>>> +        list_del_init(&p->inflight);
>>> +        spin_unlock_irqrestore(&old->arch.vgic.lock, flags);
>>> +        vgic_vcpu_inject_irq(new, irq);
>>
>> Shouldn't we also clear the p->status? At least for consistency?
> 
> We should probably clear GIC_IRQ_GUEST_QUEUED, but in practice it
> doesn't make any difference because vgic_vcpu_inject_irq immediately
> sets it again.
> 
> This is the updated patch with the GIC_IRQ_GUEST_QUEUED clear.

Thanks! I think we should take this one. It may avoid issue later if the
code is changing, such as checking GUEST_QUEUED in different place.

For the updated patch:

Acked-by: Julien Grall <julien.grall@linaro.org>

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-08-13 15:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08 17:12 [PATCH v11 00/10] gic and vgic fixes and improvements Stefano Stabellini
2014-08-08 17:13 ` [PATCH v11 01/10] xen/arm: observe itargets setting in vgic_enable_irqs and vgic_disable_irqs Stefano Stabellini
2014-08-08 17:13 ` [PATCH v11 02/10] xen/arm: move setting GIC_IRQ_GUEST_QUEUED earlier Stefano Stabellini
2014-08-08 17:13 ` [PATCH v11 03/10] xen/arm: inflight irqs during migration Stefano Stabellini
2014-08-08 17:28   ` Julien Grall
2014-08-11 15:23     ` Stefano Stabellini
2014-08-13 15:35       ` Julien Grall [this message]
2014-08-08 17:13 ` [PATCH v11 04/10] xen/arm: support irq delivery to vcpu > 0 Stefano Stabellini
2014-08-08 17:13 ` [PATCH v11 05/10] xen/arm: physical irq follow virtual irq Stefano Stabellini
2014-08-13 15:48   ` Julien Grall
2014-08-08 17:13 ` [PATCH v11 06/10] xen: introduce sched_move_irqs Stefano Stabellini
2014-08-08 17:13 ` [PATCH v11 07/10] xen: remove workaround to inject evtchn_irq on irq enable Stefano Stabellini
2014-08-08 17:13 ` [PATCH v11 08/10] xen/arm: take the rank lock before accessing ipriority Stefano Stabellini
2014-08-08 17:13 ` [PATCH v11 09/10] xen: introduce bit access macros for the IRQ line status flags Stefano Stabellini
2014-08-08 17:13 ` [PATCH v11 10/10] xen/arm: make accesses to desc->status flags atomic Stefano Stabellini

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=53EB85BD.30909@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).