All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@citrix.com>, xen-devel@lists.xenproject.org
Cc: stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH v4 3/5] xen/arm: vgic: Optimize the way to store the target vCPU in the rank
Date: Fri, 23 Oct 2015 11:14:29 +0100	[thread overview]
Message-ID: <1445595269.2374.106.camel@citrix.com> (raw)
In-Reply-To: <562A0572.1090701@citrix.com>

On Fri, 2015-10-23 at 11:01 +0100, Julien Grall wrote:
> On 23/10/15 10:34, Ian Campbell wrote:
> > On Thu, 2015-10-22 at 18:15 +0100, Julien Grall wrote:
> > > Hi Ian,
> > > 
> > > On 22/10/15 17:17, Ian Campbell wrote:
> > > > On Mon, 2015-10-12 at 15:22 +0100, Julien Grall wrote:
> > > > > [...]
> > > > >          /* Only migrate the vIRQ if the target vCPU has changed
> > > > > */
> > > > >          if ( new_target != old_target )
> > > > >          {
> > > > > +            unsigned int virq = rank->index *
> > > > > NR_INTERRUPT_PER_RANK
> > > > > + offset;
> > > > 
> > > > FWIW this was the value of offset before it was shifted + masked, I
> > > > think.
> > > > Could you not just save it up top and remember it?
> > > 
> > > In fact, the virq is already correctly set before the loop (see patch
> > > #2):
> > > 
> > > virq = rank->index * NR_INTERRUPT_PER_RANK + offset;
> > > 
> > > The variable is incremented in the for loop. So I just forgot to drop
> > > this line when I did the split.
> > > 
> > > Not that it's not possible to use directly offset because for byte
> > > access it will point to the byte modified and not the base address of
> > > the register.
> > > 
> > > Though, I could use a mask, but I find this solution clearer.
> > 
> > But per the above what is actually going to happen is you drop this
> > change?
> 
> As said, the introduction of virq within this patch is a mistake.
> Patch #2 already set virq before the loop:

I thought that was what you said, but then your final line seemed to
contradict that by implying that you wanted to keep virq here (the implicat
ion of saying it is clearer to you).

> offset &= INTERRUPT_RANK_MASK;
> offset &= ~(NR_TARGET_PER_REG - 1);
> 
> virq = rank->index * NR_INTERRUPT_PER_RANK + offset;
> 
> for ( i = 0; i < NR_TARGET_PER_REG; i++, offset++, virq++ )
> 
> 

  reply	other threads:[~2015-10-23 10:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 14:22 [PATCH v4 0/5] xen/arm: vgic: Support 32-bit access for 64-bit register Julien Grall
2015-10-12 14:22 ` [PATCH v4 1/5] xen/arm: vgic-v2: Handle correctly byte write in ITARGETSR Julien Grall
2015-10-22 15:53   ` Ian Campbell
2015-10-22 16:36     ` Julien Grall
2015-10-23  9:33       ` Ian Campbell
2015-10-23  9:58         ` Julien Grall
2015-10-23 10:12           ` Ian Campbell
2015-10-12 14:22 ` [PATCH v4 2/5] xen/arm: vgic-v2: Don't ignore a write in ITARGETSR if one field is 0 Julien Grall
2015-10-22 16:07   ` Ian Campbell
2015-10-22 16:51     ` Julien Grall
2015-10-23  9:30       ` Ian Campbell
2015-10-23  9:37         ` Julien Grall
2015-10-23  9:53           ` Ian Campbell
2015-10-12 14:22 ` [PATCH v4 3/5] xen/arm: vgic: Optimize the way to store the target vCPU in the rank Julien Grall
2015-10-22 16:17   ` Ian Campbell
2015-10-22 17:15     ` Julien Grall
2015-10-23  9:34       ` Ian Campbell
2015-10-23 10:01         ` Julien Grall
2015-10-23 10:14           ` Ian Campbell [this message]
2015-10-23 10:15             ` Julien Grall
2015-10-12 14:22 ` [PATCH v4 4/5] xen/arm: vgic: Introduce helpers to extract/update/clear/set vGIC register Julien Grall
2015-10-12 14:22 ` [PATCH v4 5/5] 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=1445595269.2374.106.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=julien.grall@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 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.