All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: julien.grall@linaro.org, tim@xen.org, xen-devel@lists.xen.org
Subject: Re: [PATCH RFC] xen: arm: context switch vtimer PPI state.
Date: Tue, 3 Mar 2015 11:51:00 +0000	[thread overview]
Message-ID: <1425383460.24959.122.camel@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1503031126090.23507@kaball.uk.xensource.com>

On Tue, 2015-03-03 at 11:38 +0000, Stefano Stabellini wrote:
> >      gic_set_irq_properties(desc, cpumask_of(smp_processor_id()), GIC_PRI_IRQ);
> >  
> > -    /* Use vcpu0 to retrieve the pending_irq struct. Given that we only
> > -     * route SPIs to guests, it doesn't make any difference. */
> > -    p = irq_to_pending(d->vcpu[0], desc->irq);
> > -    p->desc = desc;
> > +    if ( d )
> > +    {
> > +        struct pending_irq *p;
> > +
> > +        /* Use vcpu0 to retrieve the pending_irq struct. Given that we only
> > +         * route SPIs to guests, it doesn't make any difference. */
> > +        p = irq_to_pending(d->vcpu[0], desc->irq);
> > +        p->desc = desc;
> > +    }
> 
> I think you need to assign p->desc = desc in this case too, otherwise
> p->desc == NULL checks in gic.c and related code will succeed (and we
> want them to fail as this is an hardware interrupt). We should be able
> to use GICH_V2_LR_HW for it, right?
> 
> If you don't set p->desc, it is going to be treated as a virtual irq
> with no corresponding physical irq.

How can we lookup p without a d?

> In fact I am not sure how the code can work as is given that
> desc->handler is set to gic_hw_ops->gic_guest_irq_type but desc = NULL:
> who is doing the EOI of the physical interrupt? Who is calling
> gicv2_dir_irq?

p->desc is set in gicv2_restore_hwppi for interrupts such as these, so
that it always correctly points to the running domain.

Ian.

  reply	other threads:[~2015-03-03 11:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26 15:55 [PATCH RFC] xen: arm: context switch vtimer PPI state Ian Campbell
2015-01-27 13:16 ` Julien Grall
2015-01-27 13:34   ` Ian Campbell
2015-01-27 13:47     ` Julien Grall
2015-02-10  2:59 ` Ian Campbell
2015-03-02 18:42   ` Stefano Stabellini
2015-03-03 11:56     ` Ian Campbell
2015-03-03 12:00       ` Stefano Stabellini
2015-03-03 12:18         ` Ian Campbell
2015-03-03 12:26           ` Ian Campbell
2015-03-09 17:48           ` Stefano Stabellini
2015-03-03 11:38 ` Stefano Stabellini
2015-03-03 11:51   ` Ian Campbell [this message]
2015-03-03 11:55     ` 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=1425383460.24959.122.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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.