From: Julien Grall <julien.grall@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org, ian.campbell@citrix.com
Subject: Re: [PATCH v5 3/6] xen/arm: vgic-v2: Don't ignore a write in ITARGETSR if one field is 0
Date: Fri, 13 Nov 2015 14:52:27 +0000 [thread overview]
Message-ID: <5645F92B.1000405@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1511131411060.2653@kaball.uk.xensource.com>
On 13/11/15 14:37, Stefano Stabellini wrote:
> On Mon, 9 Nov 2015, Julien Grall wrote:
>> +#define NR_TARGETS_PER_ITARGETSR 4U
>> +#define NR_BITS_PER_TARGET (32U / NR_TARGETS_PER_ITARGETSR)
>> +
>> +/*
>> + * Store an ITARGETSR register. This function only deals with ITARGETSR8
>> + * and onwards.
>> + *
>> + * Note the offset will be aligned to the appropriate boundary.
>> + */
>> +static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
>> + unsigned int offset, uint32_t itargetsr)
>> +{
>> + unsigned int i;
>> + unsigned int regidx = REG_RANK_INDEX(8, offset, DABT_WORD);
>> + unsigned int virq;
>> +
>> + ASSERT(spin_is_locked(&rank->lock));
>> +
>> + /*
>> + * The ITARGETSR0-7, used for SGIs/PPIs, are implemented RO in the
>> + * emulation and should never call this function.
>> + *
>> + * They all live in the first rank.
>> + */
>> + BUILD_BUG_ON(NR_INTERRUPT_PER_RANK != 32);
>> + ASSERT(rank->index >= 1);
>> +
>> + offset &= INTERRUPT_RANK_MASK;
>> + offset &= ~(NR_TARGETS_PER_ITARGETSR - 1);
>> +
>> + virq = rank->index * NR_INTERRUPT_PER_RANK + offset;
>
> The patch looks good, but these three lines I think could be replaced
> with:
>
> virq = offset & ~(NR_TARGETS_PER_ITARGETSR - 1);
>
> isn't it right?
[...]
>> + for ( i = 0; i < NR_TARGETS_PER_ITARGETSR; i++, offset++, virq++ )
>
> offset is not needed in the loop
offset is used in patch #4. Until v3, this patch was melted in patch #4
and by mistake I move the change here.
So all the changes, the 3 lines above + this one, are valid after the
patch #4.
Given that I don't expect much changes in this version, I won't bother
to rework it for this minor and harmless changes.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-11-13 14:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 15:49 [PATCH v5 0/6] xen/arm: vgic: Support 32-bit access for 64-bit register Julien Grall
2015-11-09 15:49 ` [PATCH v5 1/6] xen/arm: vgic-v2: Implement correctly ITARGETSR0 - ITARGETSR7 read-only Julien Grall
2015-11-13 11:18 ` Stefano Stabellini
2015-11-16 13:23 ` Ian Campbell
2015-11-18 16:20 ` Julien Grall
2015-11-09 15:49 ` [PATCH v5 2/6] xen/arm: vgic-v2: Handle correctly byte write in ITARGETSR Julien Grall
2015-11-13 12:08 ` Stefano Stabellini
2015-11-09 15:49 ` [PATCH v5 3/6] xen/arm: vgic-v2: Don't ignore a write in ITARGETSR if one field is 0 Julien Grall
2015-11-13 14:37 ` Stefano Stabellini
2015-11-13 14:52 ` Julien Grall [this message]
2015-11-13 15:05 ` Stefano Stabellini
2015-11-13 15:39 ` Julien Grall
2015-11-09 15:49 ` [PATCH v5 4/6] xen/arm: vgic: Optimize the way to store the target vCPU in the rank Julien Grall
2015-11-13 15:44 ` Stefano Stabellini
2015-11-13 15:49 ` Julien Grall
2015-11-09 15:49 ` [PATCH v5 5/6] xen/arm: vgic: Introduce helpers to extract/update/clear/set vGIC register Julien Grall
2015-11-11 16:09 ` Julien Grall
2015-11-16 13:14 ` Ian Campbell
2015-11-09 15:49 ` [PATCH v5 6/6] xen/arm: vgic-v3: Support 32-bit access for 64-bit registers Julien Grall
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=5645F92B.1000405@citrix.com \
--to=julien.grall@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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).