* [PATCH 5/19] powerpc: add IRQ remapping hook
@ 2006-12-14 2:27 Ishizaki Kou
2006-12-14 4:58 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 4+ messages in thread
From: Ishizaki Kou @ 2006-12-14 2:27 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
This patch adds irq remapping hook. On interrupt mechanism on Beat,
when an irq outlet who has an id which is formerly used is created,
remapping the irq is required.
Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Index: linux-powerpc-git/include/asm-powerpc/irq.h
diff -u linux-powerpc-git/include/asm-powerpc/irq.h:1.1.1.1 linux-powerpc-git/include/asm-powerpc/irq.h:1.2
--- linux-powerpc-git/include/asm-powerpc/irq.h:1.1.1.1 Wed Dec 6 08:24:04 2006
+++ linux-powerpc-git/include/asm-powerpc/irq.h Wed Dec 6 08:43:16 2006
@@ -89,6 +89,9 @@
/* Dispose of such a mapping */
void (*unmap)(struct irq_host *h, unsigned int virq);
+ /* Update of such a mapping */
+ void (*remap)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw);
+
/* Translate device-tree interrupt specifier from raw format coming
* from the firmware to a irq_hw_number_t (interrupt line number) and
* type (sense) that can be passed to set_irq_type(). In the absence
Index: linux-powerpc-git/arch/powerpc/kernel/irq.c
diff -u linux-powerpc-git/arch/powerpc/kernel/irq.c:1.1.1.1 linux-powerpc-git/arch/powerpc/kernel/irq.c:1.2
--- linux-powerpc-git/arch/powerpc/kernel/irq.c:1.1.1.1 Wed Dec 6 08:25:43 2006
+++ linux-powerpc-git/arch/powerpc/kernel/irq.c Wed Dec 6 08:43:14 2006
@@ -604,6 +604,8 @@
*/
virq = irq_find_mapping(host, hwirq);
if (virq != IRQ_NONE) {
+ if (host->ops->remap)
+ host->ops->remap(host, virq, hwirq);
pr_debug("irq: -> existing mapping on virq %d\n", virq);
return virq;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 5/19] powerpc: add IRQ remapping hook
2006-12-14 2:27 [PATCH 5/19] powerpc: add IRQ remapping hook Ishizaki Kou
@ 2006-12-14 4:58 ` Benjamin Herrenschmidt
2006-12-15 4:59 ` Akira Iguchi
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2006-12-14 4:58 UTC (permalink / raw)
To: Ishizaki Kou; +Cc: linuxppc-dev, paulus
On Thu, 2006-12-14 at 11:27 +0900, Ishizaki Kou wrote:
> This patch adds irq remapping hook. On interrupt mechanism on Beat,
> when an irq outlet who has an id which is formerly used is created,
> remapping the irq is required.
Today paulus asked me what that was for and I must admit that despite
your earlier explanations, I was a bit at a loss justifying it.
Can you explain us again the exact cicrumstances in which this is
necessary ? It seems to us that if an interrupt outlet<->plug linkage is
removed in the hypervisor itself, it should be also removed in linux
using irq_dispose_mapping().
What are the cases where the HV might require a linkage to be
re-established by that remap function that the kernel couldn't have done
the cleanup itself beforehand ?
Regards,
Ben.
> Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> Index: linux-powerpc-git/include/asm-powerpc/irq.h
> diff -u linux-powerpc-git/include/asm-powerpc/irq.h:1.1.1.1 linux-powerpc-git/include/asm-powerpc/irq.h:1.2
> --- linux-powerpc-git/include/asm-powerpc/irq.h:1.1.1.1 Wed Dec 6 08:24:04 2006
> +++ linux-powerpc-git/include/asm-powerpc/irq.h Wed Dec 6 08:43:16 2006
> @@ -89,6 +89,9 @@
> /* Dispose of such a mapping */
> void (*unmap)(struct irq_host *h, unsigned int virq);
>
> + /* Update of such a mapping */
> + void (*remap)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw);
> +
> /* Translate device-tree interrupt specifier from raw format coming
> * from the firmware to a irq_hw_number_t (interrupt line number) and
> * type (sense) that can be passed to set_irq_type(). In the absence
> Index: linux-powerpc-git/arch/powerpc/kernel/irq.c
> diff -u linux-powerpc-git/arch/powerpc/kernel/irq.c:1.1.1.1 linux-powerpc-git/arch/powerpc/kernel/irq.c:1.2
> --- linux-powerpc-git/arch/powerpc/kernel/irq.c:1.1.1.1 Wed Dec 6 08:25:43 2006
> +++ linux-powerpc-git/arch/powerpc/kernel/irq.c Wed Dec 6 08:43:14 2006
> @@ -604,6 +604,8 @@
> */
> virq = irq_find_mapping(host, hwirq);
> if (virq != IRQ_NONE) {
> + if (host->ops->remap)
> + host->ops->remap(host, virq, hwirq);
> pr_debug("irq: -> existing mapping on virq %d\n", virq);
> return virq;
> }
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 5/19] powerpc: add IRQ remapping hook
2006-12-14 4:58 ` Benjamin Herrenschmidt
@ 2006-12-15 4:59 ` Akira Iguchi
0 siblings, 0 replies; 4+ messages in thread
From: Akira Iguchi @ 2006-12-15 4:59 UTC (permalink / raw)
To: paulus, benh; +Cc: linuxppc-dev
Paul-san, Ben-san,
> On Thu, 2006-12-14 at 11:27 +0900, Ishizaki Kou wrote:
> > This patch adds irq remapping hook. On interrupt mechanism on Beat,
> > when an irq outlet who has an id which is formerly used is created,
> > remapping the irq is required.
>
> Today paulus asked me what that was for and I must admit that despite
> your earlier explanations, I was a bit at a loss justifying it.
>
> Can you explain us again the exact cicrumstances in which this is
> necessary ? It seems to us that if an interrupt outlet<->plug linkage is
> removed in the hypervisor itself, it should be also removed in linux
> using irq_dispose_mapping().
>
> What are the cases where the HV might require a linkage to be
> re-established by that remap function that the kernel couldn't have done
> the cleanup itself beforehand ?
Okay, I'll try to explain.
Beat has two IDs to handle interrupts and events. IRQ outlets represent
interrupt sources, and IRQ plugs bind IRQ outlet to Guest OS.
So you have to "bind" IRQ plugs and IRQ outlets to receive interrupts.
Because of our design, you can assign and deassign any IRQ outlet to
a Guest OS even if the Guest OS uses the IRQ outlet without any notice
to the Guest OS. If the IRQ outlet is deassigned, bound IRQ plugs will
be also destroyed.
So, following scenario will be occur:
1. Construct an IRQ outlet.
2. Map it into IRQ plug by calling irq_create_mapping()
3. Destruct the IRQ outlet.
4. Forget to call irq_displose_mapping() because GuestOS is not
notified.
5. Reconstruct an IRQ outlet.
6. If port number got at 1. and 5. are same, irq_create_mapping()
(withour remapping patch) will reject binding between VIRQ and
IRQ outlet, so IRQ plug is not constructed and connected to the
IRQ outlet.
It can be occured with event receive port (sort of IRQ outlet).
Because I have no confidence that the "event receive port" users call
surely irq_dispose_mapping() whenever they destruct any event
receive port, I think interrupt-handling subsystem should overcome
this troublesome situation.
Best regards,
Akira Iguchi
Toshiba
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 5/19] powerpc: add IRQ remapping hook
@ 2007-01-12 0:58 Ishizaki Kou
0 siblings, 0 replies; 4+ messages in thread
From: Ishizaki Kou @ 2007-01-12 0:58 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
This patch adds irq remapping hook. On interrupt mechanism on Beat,
when an irq outlet who has an id which is formerly used is created,
remapping the irq is required.
Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Index: linux-powerpc-git/include/asm-powerpc/irq.h
diff -u linux-powerpc-git/include/asm-powerpc/irq.h:1.1.1.1 linux-powerpc-git/include/asm-powerpc/irq.h:1.2
--- linux-powerpc-git/include/asm-powerpc/irq.h:1.1.1.1 Wed Dec 6 08:24:04 2006
+++ linux-powerpc-git/include/asm-powerpc/irq.h Wed Dec 6 08:43:16 2006
@@ -89,6 +89,9 @@
/* Dispose of such a mapping */
void (*unmap)(struct irq_host *h, unsigned int virq);
+ /* Update of such a mapping */
+ void (*remap)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw);
+
/* Translate device-tree interrupt specifier from raw format coming
* from the firmware to a irq_hw_number_t (interrupt line number) and
* type (sense) that can be passed to set_irq_type(). In the absence
Index: linux-powerpc-git/arch/powerpc/kernel/irq.c
diff -u linux-powerpc-git/arch/powerpc/kernel/irq.c:1.1.1.1 linux-powerpc-git/arch/powerpc/kernel/irq.c:1.2
--- linux-powerpc-git/arch/powerpc/kernel/irq.c:1.1.1.1 Wed Dec 6 08:25:43 2006
+++ linux-powerpc-git/arch/powerpc/kernel/irq.c Wed Dec 6 08:43:14 2006
@@ -604,6 +604,8 @@
*/
virq = irq_find_mapping(host, hwirq);
if (virq != IRQ_NONE) {
+ if (host->ops->remap)
+ host->ops->remap(host, virq, hwirq);
pr_debug("irq: -> existing mapping on virq %d\n", virq);
return virq;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-01-12 0:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-14 2:27 [PATCH 5/19] powerpc: add IRQ remapping hook Ishizaki Kou
2006-12-14 4:58 ` Benjamin Herrenschmidt
2006-12-15 4:59 ` Akira Iguchi
-- strict thread matches above, loose matches on Subject: below --
2007-01-12 0:58 Ishizaki Kou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox