All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: julien.grall@citrix.com, jtd@galois.com,
	xen-devel@lists.xensource.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v4 08/10] xen/arm: second irq injection while the first irq is still inflight
Date: Fri, 21 Mar 2014 16:46:23 +0000	[thread overview]
Message-ID: <alpine.DEB.2.02.1403211635540.8273@kaball.uk.xensource.com> (raw)
In-Reply-To: <1395408173.19839.65.camel@kazak.uk.xensource.com>

On Fri, 21 Mar 2014, Ian Campbell wrote:
> On Wed, 2014-03-19 at 12:32 +0000, Stefano Stabellini wrote:
> > Set GICH_LR_PENDING in the corresponding GICH_LR to inject a second irq
> > while the first one is still active.
> > If the first irq is already pending (not active), just clear
> > GIC_IRQ_GUEST_PENDING because the irq has already been injected and is
> > already visible by the guest.
> > If the irq has already been EOI'ed then just clear the GICH_LR right
> > away and move the interrupt to lr_pending so that it is going to be
> > reinjected by gic_restore_pending_irqs on return to guest.
> > 
> > If the target cpu is not the current cpu, then set GIC_IRQ_GUEST_PENDING
> > and send an SGI. The target cpu is going to be interrupted and call
> > gic_clear_lrs, that is going to take the same actions.
> > 
> > Unify the inflight and non-inflight code paths in vgic_vcpu_inject_irq.
> > 
> > Do not call vgic_vcpu_inject_irq from gic_inject if
> > evtchn_upcall_pending is set. If we remove that call, we don't need to
> > special case evtchn_irq in vgic_vcpu_inject_irq anymore.
> 
> That's the consequence of removing it, but what is the rationale for why
> it is OK?

Because with this patch we are able to inject a second interrupt while
the first one is still in progress.


> > We also need to force the first injection of evtchn_irq (call
> > gic_vcpu_inject_irq) from vgic_enable_irqs because evtchn_upcall_pending
> > is already set by common code on vcpu creation.
> 
> This is because the common code expects that the guest is moving from
> sharedinfo based vcpu info using VCPUOP_register_vcpu_info on x86, but
> on ARM we start off that way anyway.
> 
> I suppose it's a minor wrinkle, but I wonder if we can get rid of it...

Do you mean getting rid of evtchn_upcall_pending being set at vcpu
creation? Wouldn't that cause possible undesirable side effects to
guests that came to rely on it somehow? It would be an ABI change.


> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > ---
> > Changes in v3:
> > - do not use the PENDING and ACTIVE state for HW interrupts;
> > - unify the inflight and non-inflight code paths in
> > vgic_vcpu_inject_irq.
> > ---
> >  xen/arch/arm/gic.c  |   89 +++++++++++++++++++++++++++++----------------------
> >  xen/arch/arm/vgic.c |   33 ++++++++++---------
> >  2 files changed, 68 insertions(+), 54 deletions(-)
> > 
> > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> > index 3f061cf..128d071 100644
> > --- a/xen/arch/arm/gic.c
> > +++ b/xen/arch/arm/gic.c
> > @@ -67,6 +67,8 @@ static DEFINE_PER_CPU(u8, gic_cpu_id);
> >  /* Maximum cpu interface per GIC */
> >  #define NR_GIC_CPU_IF 8
> >  
> > +static void _gic_clear_lr(struct vcpu *v, int i);
> 
> Single underbar prefixes are reserved for the compiler.
> 
> gic_clear_one_lr would be an adequate name I think.

OK


> You could also have done this at the time you introduced gic_clear_lrs,
> which would save me now asking: is the split into _gic_clear_lr pure
> code motion or are there actual substantive changes in it?

It is not pure code motion, the changes are listed in the first
paragraph of the commit message.

  reply	other threads:[~2014-03-21 16:46 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 12:31 [PATCH v4 0/10] remove maintenance interrupts Stefano Stabellini
2014-03-19 12:31 ` [PATCH v4 01/10] xen/arm: no need to set HCR_VI when using the vgic to inject irqs Stefano Stabellini
2014-03-19 13:33   ` Julien Grall
2014-03-21 14:06   ` Ian Campbell
2014-03-19 12:31 ` [PATCH v4 02/10] xen/arm: remove unused virtual parameter from vgic_vcpu_inject_irq Stefano Stabellini
2014-03-19 12:31 ` [PATCH v4 03/10] xen/arm: support HW interrupts, do not request maintenance_interrupts Stefano Stabellini
2014-03-19 13:42   ` Julien Grall
2014-03-19 14:43     ` Stefano Stabellini
2014-03-19 15:11       ` Julien Grall
2014-03-19 15:53         ` Stefano Stabellini
2014-03-19 16:10           ` Julien Grall
2014-03-21 13:04   ` Ian Campbell
2014-03-21 15:55     ` Stefano Stabellini
2014-03-21 16:16       ` Ian Campbell
2014-03-24 12:11         ` Stefano Stabellini
2014-03-24 12:15           ` Ian Campbell
2014-03-19 12:31 ` [PATCH v4 04/10] xen/arm: set GICH_HCR_UIE if all the LRs are in use Stefano Stabellini
2014-03-19 13:49   ` Julien Grall
2014-03-21 13:06   ` Ian Campbell
2014-03-21 16:03     ` Stefano Stabellini
2014-03-21 13:07   ` Ian Campbell
2014-03-21 16:05     ` Stefano Stabellini
2014-03-19 12:32 ` [PATCH v4 05/10] xen/arm: keep track of the GICH_LR used for the irq in struct pending_irq Stefano Stabellini
2014-03-19 13:52   ` Julien Grall
2014-03-19 14:45     ` Stefano Stabellini
2014-03-21 13:11   ` Ian Campbell
2014-03-21 16:19     ` Stefano Stabellini
2014-03-21 16:25       ` Ian Campbell
2014-03-24 12:12         ` Stefano Stabellini
2014-03-19 12:32 ` [PATCH v4 06/10] xen/arm: s/gic_set_guest_irq/gic_raise_guest_irq Stefano Stabellini
2014-03-19 13:53   ` Julien Grall
2014-03-21 13:12   ` Ian Campbell
2014-03-21 16:20     ` Stefano Stabellini
2014-03-21 16:26       ` Ian Campbell
2014-03-19 12:32 ` [PATCH v4 07/10] xen/arm: call gic_clear_lrs on entry to the hypervisor Stefano Stabellini
2014-03-19 13:56   ` Julien Grall
2014-03-21 13:14   ` Ian Campbell
2014-03-21 16:34     ` Stefano Stabellini
2014-03-21 16:39       ` Ian Campbell
2014-03-24 12:24         ` Stefano Stabellini
2014-03-19 12:32 ` [PATCH v4 08/10] xen/arm: second irq injection while the first irq is still inflight Stefano Stabellini
2014-03-21 13:22   ` Ian Campbell
2014-03-21 16:46     ` Stefano Stabellini [this message]
2014-03-21 17:04       ` Ian Campbell
2014-03-24 12:54         ` Stefano Stabellini
2014-03-24 12:57           ` Ian Campbell
2014-03-24 16:41             ` Stefano Stabellini
2014-03-25 10:09               ` Ian Campbell
2014-03-19 12:32 ` [PATCH v4 09/10] xen/arm: don't protect GICH and lr_queue accesses with gic.lock Stefano Stabellini
2014-03-21 13:31   ` Ian Campbell
2014-03-21 17:07     ` Stefano Stabellini
2014-03-19 12:32 ` [PATCH v4 10/10] xen/arm: gic_events_need_delivery and irq priorities Stefano Stabellini
2014-03-19 14:00   ` Julien Grall
2014-03-20 11:03     ` Ian Campbell
2014-03-20 15:10       ` Julien Grall
2014-03-20 15:14         ` Ian Campbell
2014-03-21 13:42   ` Ian Campbell
2014-03-24 12:00     ` Stefano Stabellini
2014-03-24 12:05       ` Ian Campbell
2014-03-24 13:06         ` Stefano Stabellini
2014-03-24 16:06           ` Stefano Stabellini

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=alpine.DEB.2.02.1403211635540.8273@kaball.uk.xensource.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=jtd@galois.com \
    --cc=julien.grall@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.