From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: patches@linaro.org, ian.campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH 1/5] xen/arm: Physical IRQ is not always equal to virtual IRQ
Date: Tue, 25 Jun 2013 16:21:58 +0100 [thread overview]
Message-ID: <51C9B596.5050705@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1306251414030.4782@kaball.uk.xensource.com>
On 06/25/2013 02:16 PM, Stefano Stabellini wrote:
> On Tue, 25 Jun 2013, Julien Grall wrote:
>> From: Julien Grall <julien.grall@linaro.org>
>>
>> When Xen needs to EOI a physical IRQ, we must use the IRQ number
>> in irq_desc instead of the virtual IRQ.
>>
>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>> ---
>> xen/arch/arm/gic.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
>> index 177560e..0fee3f2 100644
>> --- a/xen/arch/arm/gic.c
>> +++ b/xen/arch/arm/gic.c
>> @@ -810,7 +810,7 @@ static void gic_irq_eoi(void *info)
>>
>> static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
>> {
>> - int i = 0, virq;
>> + int i = 0, virq, pirq;
>> uint32_t lr;
>> struct vcpu *v = current;
>> uint64_t eisr = GICH[GICH_EISR0] | (((uint64_t) GICH[GICH_EISR1]) << 32);
>> @@ -846,6 +846,7 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
>> /* Assume only one pcpu needs to EOI the irq */
>> cpu = p->desc->arch.eoi_cpu;
>> eoi = 1;
>> + pirq = p->desc->irq;
>> }
>> list_del_init(&p->inflight);
>> spin_unlock_irq(&v->arch.vgic.lock);
>> @@ -854,10 +855,10 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
>> /* this is not racy because we can't receive another irq of the
>> * same type until we EOI it. */
>> if ( cpu == smp_processor_id() )
>> - gic_irq_eoi((void*)(uintptr_t)virq);
>> + gic_irq_eoi((void*)(uintptr_t)pirq);
>> else
>> on_selected_cpus(cpumask_of(cpu),
>> - gic_irq_eoi, (void*)(uintptr_t)virq, 0);
>> + gic_irq_eoi, (void*)(uintptr_t)pirq, 0);
>> }
>
> I think that virq and pirq are guaranteed to always be the same, at
> least at the moment. Look at vgic_vcpu_inject_irq: it takes just one irq
> parameter, that is both the physical and the virtual irq number.
> Unless we change the vgic_vcpu_inject_irq interface to allow virq !=
> pirq, I don't think this patch makes much sense.
Right. I wrote this patch because it easier to forget to modify some
part when non-1:1 IRQ mappings will be created :).
--
Julien
next prev parent reply other threads:[~2013-06-25 15:21 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 23:04 [PATCH 0/5] Fix multiple issues with the interrupts on ARM Julien Grall
2013-06-24 23:04 ` [PATCH 1/5] xen/arm: Physical IRQ is not always equal to virtual IRQ Julien Grall
2013-06-25 13:16 ` Stefano Stabellini
2013-06-25 15:21 ` Julien Grall [this message]
2013-06-25 16:06 ` Ian Campbell
2013-06-24 23:04 ` [PATCH 2/5] xen/arm: Keep count of inflight interrupts Julien Grall
2013-06-25 16:12 ` Ian Campbell
2013-06-25 16:58 ` Stefano Stabellini
2013-06-25 17:46 ` Julien Grall
2013-06-25 18:38 ` Stefano Stabellini
2013-06-26 10:59 ` Ian Campbell
2013-06-26 11:10 ` Stefano Stabellini
2013-06-26 11:16 ` Ian Campbell
2013-06-26 10:58 ` Ian Campbell
2013-06-26 11:08 ` Stefano Stabellini
2013-06-26 11:15 ` Ian Campbell
2013-06-26 11:23 ` Stefano Stabellini
2013-06-26 11:41 ` Ian Campbell
2013-06-26 11:50 ` Stefano Stabellini
2013-06-26 11:57 ` Ian Campbell
2013-06-26 14:02 ` Stefano Stabellini
2013-06-24 23:04 ` [PATCH 3/5] xen/arm: Don't reinject the IRQ if it's already in LRs Julien Grall
2013-06-25 13:24 ` Stefano Stabellini
2013-06-25 13:55 ` Julien Grall
2013-06-25 16:36 ` Stefano Stabellini
2013-06-25 16:46 ` Ian Campbell
2013-06-25 17:05 ` Stefano Stabellini
2013-06-26 10:53 ` Ian Campbell
2013-06-26 11:19 ` Stefano Stabellini
2013-06-25 16:48 ` Julien Grall
2013-06-25 16:59 ` Stefano Stabellini
2013-06-25 16:14 ` Ian Campbell
2013-06-24 23:04 ` [PATCH 4/5] xen/arm: Rename gic_irq_{startup, shutdown} to gic_irq_{mask, unmask} Julien Grall
2013-06-24 23:04 ` [PATCH 5/5] xen/arm: Only enable physical IRQs when the guest asks Julien Grall
2013-06-25 16:19 ` Stefano Stabellini
2013-06-25 16:55 ` Julien Grall
2013-06-25 17:07 ` Stefano Stabellini
2013-12-02 17:26 ` Ian Campbell
2013-12-02 17:37 ` Stefano Stabellini
2013-06-25 16:28 ` Ian Campbell
2013-06-25 17:38 ` Julien Grall
2013-06-25 18:27 ` Stefano Stabellini
2013-06-26 10:55 ` Ian Campbell
2013-06-26 13:03 ` Julien Grall
2013-07-31 13:08 ` [PATCH 0/5] Fix multiple issues with the interrupts on ARM Andrii Anisov
2013-07-31 14:00 ` 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=51C9B596.5050705@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=patches@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--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.