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 v5 3/6] xen/arm: observe itargets setting in vgic_enable_irqs and vgic_disable_irqs
Date: Thu, 12 Jun 2014 10:45:52 +0100	[thread overview]
Message-ID: <539976D0.4050305@linaro.org> (raw)
In-Reply-To: <1402504032-13267-3-git-send-email-stefano.stabellini@eu.citrix.com>

Hi Stefano,

On 11/06/14 17:27, Stefano Stabellini wrote:
> +static struct vcpu *_vgic_get_target_vcpu(struct vcpu *v, unsigned int irq)

[..]

> +struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int irq)

Can you add comment explaining what are the differences between these 2 
functions?

AFAIU, the first one is assuming the rank lock is taken. If so, I would 
add an ASSERT in it. I would avoid people misuse the 2 functions.

>       case GICD_ISPENDR ... GICD_ISPENDRN:
> @@ -589,12 +625,23 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
>           if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
>           rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR);
>           if ( rank == NULL) goto write_ignore;
> +        /* 8-bit vcpu mask for this domain */

BUG_ON(v->domain->max_vcpus > 8)? Just for enforcement.

> +        tr = (1 << v->domain->max_vcpus) - 1;
> +        tr = tr | (tr << 8) | (tr << 16) | (tr << 24);
> +        tr &= *r;
> +        /* ignore zero writes */
> +        if ( !tr )
> +            goto write_ignore;
> +        if ( dabt.size == 2 &&
> +            !((tr & 0xff) && (tr & (0xff << 8)) &&
> +             (tr & (0xff << 16)) && (tr & (0xff << 24))))
> +            goto write_ignore;

I quite difficult to understand this check. Does this check is only for 
word-access?

AFAIU, with byte-access it's possible to write 0 in itargets. For this 
case, the register may contain some 1 out of the byte offset.

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-06-12  9:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 16:25 [PATCH v5 0/6] vgic emulation and GICD_ITARGETSR Stefano Stabellini
2014-06-11 16:27 ` [PATCH v5 1/6] xen/arm: rename vgic_irq_rank to vgic_rank_offset Stefano Stabellini
2014-06-12  9:15   ` Julien Grall
2014-06-18 10:35   ` Ian Campbell
2014-06-11 16:27 ` [PATCH v5 2/6] xen/arm: introduce vgic_rank_irq Stefano Stabellini
2014-06-12  9:16   ` Julien Grall
2014-06-18 10:36   ` Ian Campbell
2014-06-11 16:27 ` [PATCH v5 3/6] xen/arm: observe itargets setting in vgic_enable_irqs and vgic_disable_irqs Stefano Stabellini
2014-06-12  9:45   ` Julien Grall [this message]
2014-06-12 14:42     ` Stefano Stabellini
2014-06-15 15:57       ` Julien Grall
2014-06-18 10:48   ` Ian Campbell
2014-06-19 18:07     ` Stefano Stabellini
2014-06-21 16:19       ` Stefano Stabellini
2014-06-11 16:27 ` [PATCH v5 4/6] xen/arm: inflight irqs during migration Stefano Stabellini
2014-06-18 11:04   ` Ian Campbell
2014-06-19 18:32     ` Stefano Stabellini
2014-06-11 16:27 ` [PATCH v5 5/6] xen/arm: support irq delivery to vcpu > 0 Stefano Stabellini
2014-06-18 11:08   ` Ian Campbell
2014-06-20 12:32     ` Stefano Stabellini
2014-06-11 16:27 ` [PATCH v5 6/6] xen/arm: physical irq follow virtual irq Stefano Stabellini
2014-06-12  9:11   ` Jan Beulich
2014-06-18 11:15   ` Ian Campbell
2014-06-20 12:39     ` Stefano Stabellini
2014-06-18 16:03 ` [PATCH v5 0/6] vgic emulation and GICD_ITARGETSR 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=539976D0.4050305@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.