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 v4 1/4] xen/arm: observe itargets setting in vgic_enable_irqs and vgic_disable_irqs
Date: Sat, 07 Jun 2014 15:33:55 +0100 [thread overview]
Message-ID: <539322D3.8040504@linaro.org> (raw)
In-Reply-To: <1402076908-26740-1-git-send-email-stefano.stabellini@eu.citrix.com>
Hi Stefano,
On 06/06/14 18:48, Stefano Stabellini wrote:
> return 0;
> }
>
> @@ -369,6 +377,22 @@ read_as_zero:
> return 1;
> }
>
> +struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int irq)
> +{
> + int target;
> + struct vgic_irq_rank *rank;
> + struct vcpu *v_target;
> +
> + rank = vgic_irq_rank(v, 1, irq/32);
> + vgic_lock_rank(v, rank);
> + target = byte_read(rank->itargets[(irq%32)/4], 0, irq % 4);
> + /* just return the first vcpu in the mask */
> + target = find_next_bit((const unsigned long *) &target, 8, 0);
int* and unsigned long* doesn't have the same alignment on aarch64. This
may end up to a data abort for Xen side.
IIRC, Ian has fixed a similar issue in commit 5224a733.
[..]
> }
> if ( p->desc != NULL )
> {
> @@ -502,6 +530,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
> int offset = (int)(info->gpa - v->domain->arch.vgic.dbase);
> int gicd_reg = REG(offset);
> uint32_t tr;
> + int i;
>
> switch ( gicd_reg )
> {
> @@ -585,6 +614,21 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
> rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ITARGETSR);
> if ( rank == NULL) goto write_ignore;
> vgic_lock_rank(v, rank);
> + tr = *r & ~(rank->itargets[REG_RANK_INDEX(8, gicd_reg - GICD_ITARGETSR)]);
Write in GICD_ITARGETSR can be either half-word or word. If I'm not
mistaken you sanity check only handle word access.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-06-07 14:33 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 17:47 [PATCH v4 0/4] vgic emulation and GICD_ITARGETSR Stefano Stabellini
2014-06-06 17:48 ` [PATCH v4 1/4] xen/arm: observe itargets setting in vgic_enable_irqs and vgic_disable_irqs Stefano Stabellini
2014-06-07 14:33 ` Julien Grall [this message]
2014-06-09 10:47 ` Stefano Stabellini
2014-06-09 11:37 ` Julien Grall
2014-06-09 12:04 ` Stefano Stabellini
2014-06-09 12:32 ` Julien Grall
2014-06-09 17:21 ` Stefano Stabellini
2014-06-10 11:44 ` Ian Campbell
2014-06-11 11:54 ` Stefano Stabellini
2014-06-06 17:48 ` [PATCH v4 2/4] xen/arm: inflight irqs during migration Stefano Stabellini
2014-06-10 12:12 ` Ian Campbell
2014-06-11 14:15 ` Stefano Stabellini
2014-06-11 14:28 ` Julien Grall
2014-06-11 14:49 ` Stefano Stabellini
2014-06-11 15:16 ` Julien Grall
2014-06-11 15:55 ` Stefano Stabellini
2014-06-06 17:48 ` [PATCH v4 3/4] xen/arm: support irq delivery to vcpu > 0 Stefano Stabellini
2014-06-10 12:16 ` Ian Campbell
2014-06-10 12:56 ` Julien Grall
2014-06-11 14:22 ` Stefano Stabellini
2014-06-06 17:48 ` [PATCH v4 4/4] xen/arm: physical irq follow virtual irq Stefano Stabellini
2014-06-10 12:27 ` Ian Campbell
2014-06-11 14:47 ` Stefano Stabellini
2014-06-11 15:14 ` 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=539322D3.8040504@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).