From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, apatel@apm.com,
Ian.Campbell@citrix.com, psawargaonkar@apm.com
Subject: Re: [PATCH] xen/arm: introduce platform_need_explicit_eoi
Date: Fri, 20 Jun 2014 15:47:06 +0100 [thread overview]
Message-ID: <53A4496A.4080009@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1406201523380.19982@kaball.uk.xensource.com>
On 20/06/14 15:27, Stefano Stabellini wrote:
> On Fri, 20 Jun 2014, Julien Grall wrote:
>> Hi Stefano,
>>
>> On 20/06/14 14:35, Stefano Stabellini wrote:
>>> GICH_LR_HW doesn't work as expected on X-Gene: request maintenance
>>> interrupts and perform EOIs in the hypervisor as a workaround.
>>> Trigger this behaviour with a per platform option.
>>>
>>> No need to find the pcpu that needs to write to GICC_DIR, because after
>>> "physical irq follow virtual irq" we always inject the virtual irq on
>>> the vcpu that is running on the pcpu that received the interrupt.
>>
>> Even without the patch "physical irq follow virtual irq" we can EOI an SPIs on
>> any physical CPUs.
>
> Can you point me to the paragraph of the GIC spec that says that?
While it's clearly specified in the spec that the GICC_EOIR must be done
in the same physical CPU. Nothing has been specified for GICC_DIR.
I'm assuming this is the case, because even with the HW bit the physical
interrupt may be EOIed on a different CPU. Think about the VCPU has been
migrated when the guest is still handling the interrupt...
Your patch "physical irq follow virtual irq" won't even solve this
problem if the maintenance interrupt is request to EOI the IRQ.
>
>> Otherwise, even with this patch, you will have to find pcpu when the VCPU has
>> been migrated by EOI the IRQ :).
>> I would rework this last paragraph to explain this is how the GIC behave.
>>
>>> static void gic_update_one_lr(struct vcpu *v, int i)
>>> {
>>> struct pending_irq *p;
>>> @@ -692,7 +699,11 @@ static void gic_update_one_lr(struct vcpu *v, int i)
>>> clear_bit(i, &this_cpu(lr_mask));
>>>
>>> if ( p->desc != NULL )
>>> + {
>>> p->desc->status &= ~IRQ_INPROGRESS;
>>> + if ( platform_has_quirk(PLATFORM_QUIRK_NEED_EOI) )
>>> + gic_irq_eoi(p->irq);
>>> + }
>>> clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
>>> clear_bit(GIC_IRQ_GUEST_ACTIVE, &p->status);
>>> p->lr = GIC_INVALID_LR;
>>
>> With this change, shouldn't we clear the bit and the LR before EOI the IRQ?
>
> Conceptually you might be right but it is all happening with the vgic
> lock taken, so it shouldn't make any difference.
The VGIC lock is per-vcpu.
If this is happening while we migrate, nothing protect p->lr and the
different bit anymore.
Indeed, the vgic_inject_irq will use the new VCPU. This can happen as
soon as we EOI the IRQ.
I'm not sure why you didn't decide to have a dist lock for SPIs. It
would have make interrupt handling easier.
--
Julien Grall
next prev parent reply other threads:[~2014-06-20 14:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-20 13:35 [PATCH] xen/arm: introduce platform_need_explicit_eoi Stefano Stabellini
2014-06-20 14:11 ` Julien Grall
2014-06-20 14:27 ` Stefano Stabellini
2014-06-20 14:47 ` Julien Grall [this message]
2014-06-20 16:48 ` Stefano Stabellini
2014-06-20 16:59 ` Julien Grall
2014-06-20 17:40 ` Stefano Stabellini
2014-06-20 18:33 ` Julien Grall
2014-06-21 14:43 ` Stefano Stabellini
2014-06-21 14:59 ` Julien Grall
2014-06-21 15:26 ` Stefano Stabellini
2014-06-21 15:59 ` Julien Grall
2014-06-23 10:43 ` Stefano Stabellini
2014-06-27 15:51 ` Ian Campbell
2014-06-30 10:01 ` Julien Grall
2014-07-02 15:31 ` Stefano Stabellini
2014-07-02 15:34 ` Stefano Stabellini
2014-07-02 14:49 ` Julien Grall
2014-07-02 15:31 ` 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=53A4496A.4080009@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=apatel@apm.com \
--cc=psawargaonkar@apm.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.