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 v6 1/5] xen/arm: observe itargets setting in vgic_enable_irqs and vgic_disable_irqs
Date: Mon, 23 Jun 2014 18:41:32 +0100 [thread overview]
Message-ID: <53A866CC.5030201@linaro.org> (raw)
In-Reply-To: <1403541463-23734-1-git-send-email-stefano.stabellini@eu.citrix.com>
Hi Stefano,
On 06/23/2014 05:37 PM, Stefano Stabellini wrote:
> +/* the rank lock is already taken */
> +static struct vcpu *_vgic_get_target_vcpu(struct vcpu *v, unsigned int irq)
> +{
> + unsigned long target;
> + struct vcpu *v_target;
> + struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
> + ASSERT(spin_is_locked(&rank->lock));
> +
> + target = byte_read(rank->itargets[(irq%32)/4], 0, irq % 4);
> + /* 1-N SPI should be delivered as pending to all the vcpus in the
> + * mask, but here we just return the first vcpu for simplicity and
> + * because it would be too slow to do otherwise. */
> + target = find_first_bit(&target, 8);
I'm tempted to ask you adding an ASSERT here. Just for catching coding
error.
[..]
> @@ -536,8 +575,8 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
> vgic_lock_rank(v, rank);
> tr = rank->ienable;
> rank->ienable |= *r;
> - vgic_unlock_rank(v, rank);
> vgic_enable_irqs(v, (*r) & (~tr), gicd_reg - GICD_ISENABLER);
> + vgic_unlock_rank(v, rank);
> return 1;
>
> case GICD_ICENABLER ... GICD_ICENABLERN:
> @@ -547,8 +586,8 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
> vgic_lock_rank(v, rank);
> tr = rank->ienable;
> rank->ienable &= ~*r;
> - vgic_unlock_rank(v, rank);
> vgic_disable_irqs(v, (*r) & tr, gicd_reg - GICD_ICENABLER);
> + vgic_unlock_rank(v, rank);
> return 1;
Sorry for not having catch this earlier. I don't really like the idea to
extend the rank lock to vgic_{enable/disable}_irqs. The 2 functions
can be long to execute as it may touch the GIC distributor.
In another way, the rank lock is only taken in the distributor emulation.
Assuming we consider that distributor access may be slow:
Acked-by: Julien Grall <julien.grall@linaro.org>
Aside that, that made me think about two possible issue (not related to
this patch series) in vgic_inject_irq:
- We don't take the rank lock to read the priority, even tho it's only
a byte access.
- If the an interrupt is injected while it's already active, we don't
update the priority of this interrupt.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-06-23 17:41 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-23 16:36 [PATCH v6 0/5] vgic emulation and GICD_ITARGETSR Stefano Stabellini
2014-06-23 16:37 ` [PATCH v6 1/5] xen/arm: observe itargets setting in vgic_enable_irqs and vgic_disable_irqs Stefano Stabellini
2014-06-23 17:41 ` Julien Grall [this message]
2014-06-24 11:38 ` Stefano Stabellini
2014-06-24 12:07 ` Julien Grall
2014-06-24 18:04 ` Stefano Stabellini
2014-06-24 18:20 ` Julien Grall
2014-06-24 18:29 ` Stefano Stabellini
2014-06-27 15:17 ` Ian Campbell
2014-07-02 15:39 ` Stefano Stabellini
2014-07-02 15:58 ` Ian Campbell
2014-07-02 18:05 ` Stefano Stabellini
2014-06-23 16:37 ` [PATCH v6 2/5] xen/arm: inflight irqs during migration Stefano Stabellini
2014-06-23 20:14 ` Julien Grall
2014-06-24 11:57 ` Stefano Stabellini
2014-06-24 12:17 ` Julien Grall
2014-07-02 22:27 ` Stefano Stabellini
2014-06-27 15:37 ` Ian Campbell
2014-07-02 18:22 ` Stefano Stabellini
2014-06-27 15:40 ` Ian Campbell
2014-07-02 18:33 ` Stefano Stabellini
2014-07-03 9:29 ` Ian Campbell
2014-07-03 14:43 ` Stefano Stabellini
2014-06-23 16:37 ` [PATCH v6 3/5] xen/arm: support irq delivery to vcpu > 0 Stefano Stabellini
2014-06-24 13:33 ` Julien Grall
2014-06-27 15:42 ` Ian Campbell
2014-07-02 15:52 ` Stefano Stabellini
2014-06-23 16:37 ` [PATCH v6 4/5] xen/arm: physical irq follow virtual irq Stefano Stabellini
2014-06-24 13:43 ` Julien Grall
2014-07-02 18:14 ` Stefano Stabellini
2014-06-23 16:37 ` [PATCH v6 5/5] xen: introduce sched_move_irqs Stefano Stabellini
2014-06-24 6:38 ` Jan Beulich
2014-06-24 12:02 ` George Dunlap
2014-06-27 15:46 ` 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=53A866CC.5030201@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.