All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	xen-devel@lists.xensource.com
Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH v7 5/6] xen/arm: physical irq follow virtual irq
Date: Fri, 04 Jul 2014 11:51:02 +0100	[thread overview]
Message-ID: <53B68716.2020800@linaro.org> (raw)
In-Reply-To: <1404406394-18231-5-git-send-email-stefano.stabellini@eu.citrix.com>

On 07/03/2014 05:53 PM, Stefano Stabellini wrote:
> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
> index 695c232..c3d2853 100644
> --- a/xen/arch/arm/gic-v2.c
> +++ b/xen/arch/arm/gic-v2.c
> @@ -532,9 +532,22 @@ static void gicv2_guest_irq_end(struct irq_desc *desc)
>      /* Deactivation happens in maintenance interrupt / via GICV */
>  }
>  
> -static void gicv2_irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
> +static void gicv2_irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
>  {
> -    BUG();
> +    volatile unsigned char *bytereg;
> +    unsigned int mask;
> +
> +    ASSERT(!cpumask_empty(cpu_mask));
> +
> +    spin_lock(&gicv2.lock);
> +
> +    mask = gicv2_cpu_mask(cpu_mask);
> +
> +    /* Set target CPU mask (RAZ/WI on uniprocessor) */
> +    bytereg = (unsigned char *) (GICD + GICD_ITARGETSR);
> +    bytereg[desc->irq] = mask;

The new implemenation of GICv2 is using {read,write}* helpers. Can you
use writeb_relaxed here, please?

[..]

> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> index b4493a3..69d3040 100644
> --- a/xen/arch/arm/vgic.c
> +++ b/xen/arch/arm/vgic.c
> @@ -399,6 +399,7 @@ static void vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned int ir
>  
>      if ( list_empty(&p->inflight) )
>      {
> +        irq_set_affinity(p->desc, cpumask_of(new->processor));
>          spin_unlock_irqrestore(&old->arch.vgic.lock, flags);
>          return;
>      }
> @@ -407,6 +408,7 @@ static void vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned int ir
>      {
>          list_del_init(&p->lr_queue);
>          list_del_init(&p->inflight);
> +        irq_set_affinity(p->desc, cpumask_of(new->processor));

I think this irq_set_affinity is misplaced. You forgot to handle the
case where the IRQ has been EOIed, and no IRQ has been queued.

Also, it looks like this is done a bit late. the IRQ may fire on the
previous physical CPU again at least once.

This will happen the X-Gene quirk.

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-07-04 10:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03 16:52 [PATCH v7 0/6] vgic emulation and GICD_ITARGETSR Stefano Stabellini
2014-07-03 16:53 ` [PATCH v7 1/6] xen/arm: observe itargets setting in vgic_enable_irqs and vgic_disable_irqs Stefano Stabellini
2014-07-03 16:53 ` [PATCH v7 2/6] xen/arm: move setting GIC_IRQ_GUEST_QUEUED earlier Stefano Stabellini
2014-07-04 10:23   ` Julien Grall
2014-07-09 15:38   ` Ian Campbell
2014-07-03 16:53 ` [PATCH v7 3/6] xen/arm: inflight irqs during migration Stefano Stabellini
2014-07-04 10:26   ` Julien Grall
2014-07-03 16:53 ` [PATCH v7 4/6] xen/arm: support irq delivery to vcpu > 0 Stefano Stabellini
2014-07-04 10:28   ` Julien Grall
2014-07-09 15:41   ` Ian Campbell
2014-07-03 16:53 ` [PATCH v7 5/6] xen/arm: physical irq follow virtual irq Stefano Stabellini
2014-07-04 10:51   ` Julien Grall [this message]
2014-07-10 15:59     ` Ian Campbell
2014-07-10 17:47     ` Stefano Stabellini
2014-07-03 16:53 ` [PATCH v7 6/6] xen: introduce sched_move_irqs 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=53B68716.2020800@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 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.