* [RFC][patch 3/10] Multiple vector domain support - introduce gsv
@ 2005-07-14 9:24 Kenji Kaneshige
2005-07-14 17:50 ` Ashok Raj
2005-07-16 1:07 ` [RFC][patch 3/10] Multiple vector domain support - introduce Kenji Kaneshige
0 siblings, 2 replies; 3+ messages in thread
From: Kenji Kaneshige @ 2005-07-14 9:24 UTC (permalink / raw)
To: linux-ia64
This patch adds "Global System Vector" to make it easier to handle
vectors and domains. The concept of GSV is sililar to globbal system
interrupt (GSI). Suppose that there are two domains, domain 0 and
domain 1, and suppose that each of them have 256 interrupt vectors. In
this case, GSV 10 would be corresponding to vector 10 in domain 0, and
GSV 266 would be corresponding to vector 10 in domain 1.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
---
linux-2.6.13-rc1-kanesige/arch/ia64/kernel/irq_ia64.c | 17 ++++
linux-2.6.13-rc1-kanesige/include/asm-ia64/hw_irq.h | 66 +++++++++++++++++-
linux-2.6.13-rc1-kanesige/include/asm-ia64/irq.h | 2
3 files changed, 84 insertions(+), 1 deletion(-)
diff -puN arch/ia64/kernel/irq_ia64.c~vector-domain-ia64-handle-gsv arch/ia64/kernel/irq_ia64.c
--- linux-2.6.13-rc1/arch/ia64/kernel/irq_ia64.c~vector-domain-ia64-handle-gsv 2005-07-13 14:51:41.000000000 +0900
+++ linux-2.6.13-rc1-kanesige/arch/ia64/kernel/irq_ia64.c 2005-07-13 14:51:41.000000000 +0900
@@ -60,6 +60,9 @@ __u8 isa_irq_to_vector_map[16] = {
};
EXPORT_SYMBOL(isa_irq_to_vector_map);
+int ia64_irq_to_gsv_map[NR_IRQS] = { [0 ... NR_IRQS-1] = -1 };
+int ia64_gsv_to_irq_map[NR_GSVS] = { [0 ... NR_GSVS-1] = -1 };
+
static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_NUM_DEVICE_VECTORS)];
int
@@ -290,8 +293,22 @@ ia64_send_ipi (int cpu, int vector, int
void __init
ia64_vector_domain_init (void)
{
+ int domain, vec, gsv;
+
/* Attach BSP to domain #0 */
ia64_attach_cpu_to_domain(0);
+
+ /*
+ * Make special mapping between per CPU IRQs and GSVs
+ */
+ for (gsv = 0; gsv < NR_GSVS; gsv++) {
+ vec = gsv_to_vector(gsv);
+ if (vec < IA64_FIRST_DEVICE_VECTOR ||
+ vec > IA64_LAST_DEVICE_VECTOR) {
+ ia64_gsv_to_irq_map[gsv] = vec;
+ ia64_irq_to_gsv_map[vec] = vec;
+ }
+ }
}
#ifdef CONFIG_VECTOR_DOMAIN
diff -puN include/asm-ia64/hw_irq.h~vector-domain-ia64-handle-gsv include/asm-ia64/hw_irq.h
--- linux-2.6.13-rc1/include/asm-ia64/hw_irq.h~vector-domain-ia64-handle-gsv 2005-07-13 14:51:41.000000000 +0900
+++ linux-2.6.13-rc1-kanesige/include/asm-ia64/hw_irq.h 2005-07-13 14:51:41.000000000 +0900
@@ -107,6 +107,71 @@ hw_resend_irq (struct hw_interrupt_type
}
/*
+ * Global System Vector
+ * --------------------
+ * Global System Vector (GSV) is introduced to make it easier to
+ * handle vectors and domains. The concept of GSV is sililar to
+ * globbal system interrupt (GSI). Suppose that there are two domains,
+ * domain 0 and domain 1, and suppose that each of them have 256
+ * interrupt vectors. In this case, GSV 10 would be corresponding to
+ * vector 10 in domain 0, and GSV 266 would be corresponding to vector
+ * 10 in domain 1.
+ */
+
+extern int ia64_irq_to_gsv_map[NR_IRQS];
+extern int ia64_gsv_to_irq_map[NR_GSVS];
+
+/*
+ * Convert global system vector to the corresponding IRQ.
+ */
+static inline int
+gsv_to_irq (unsigned int gsv)
+{
+ if (gsv > NR_GSVS)
+ return -1;
+ return ia64_gsv_to_irq_map[gsv];
+}
+
+/*
+ * Convert global system vector to the corresponding vector number.
+ */
+static inline int
+gsv_to_vector (unsigned int gsv)
+{
+ return (gsv & 0xff);
+}
+
+/*
+ * Convert global system vector to the corresponding domain number.
+ */
+static inline int
+gsv_to_domain (unsigned int gsv)
+{
+ return (gsv >> 8);
+}
+
+/*
+ * Convert IRQ to the corresponding global system vector.
+ */
+static inline int
+irq_to_gsv (unsigned int irq)
+{
+ if (irq > NR_IRQS)
+ return -1;
+ return ia64_irq_to_gsv_map[irq];
+}
+
+/*
+ * Convert vector and domain number to the corresponding global system
+ * vector number.
+ */
+static inline int
+domain_vector_to_gsv (unsigned int domain, unsigned int vector)
+{
+ return ((domain << 8) | vector);
+}
+
+/*
* Default implementations for the irq-descriptor API:
*/
@@ -154,5 +219,4 @@ local_vector_to_irq (ia64_vector vec)
{
return platform_local_vector_to_irq(vec);
}
-
#endif /* _ASM_IA64_HW_IRQ_H */
diff -puN include/asm-ia64/irq.h~vector-domain-ia64-handle-gsv include/asm-ia64/irq.h
--- linux-2.6.13-rc1/include/asm-ia64/irq.h~vector-domain-ia64-handle-gsv 2005-07-13 14:51:41.000000000 +0900
+++ linux-2.6.13-rc1-kanesige/include/asm-ia64/irq.h 2005-07-13 14:51:41.000000000 +0900
@@ -20,6 +20,8 @@
#define NR_IRQS (256 * NR_VECTOR_DOMAINS)
#define NR_IRQ_VECTORS NR_IRQS
+#define NR_GSVS (IA64_NUM_VECTORS * NR_VECTOR_DOMAINS)
+
static __inline__ int
irq_canonicalize (int irq)
{
_
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [RFC][patch 3/10] Multiple vector domain support - introduce gsv
2005-07-14 9:24 [RFC][patch 3/10] Multiple vector domain support - introduce gsv Kenji Kaneshige
@ 2005-07-14 17:50 ` Ashok Raj
2005-07-16 1:07 ` [RFC][patch 3/10] Multiple vector domain support - introduce Kenji Kaneshige
1 sibling, 0 replies; 3+ messages in thread
From: Ashok Raj @ 2005-07-14 17:50 UTC (permalink / raw)
To: linux-ia64
On Thu, Jul 14, 2005 at 06:24:14PM +0900, Kenji Kaneshige wrote:
Hi Kaneshige,
Iam in the process of reviewing in detail, but here are a few that
came by,
> int
> @@ -290,8 +293,22 @@ ia64_send_ipi (int cpu, int vector, int
> void __init
> ia64_vector_domain_init (void)
> {
> + int domain, vec, gsv;
> +
> /* Attach BSP to domain #0 */
> ia64_attach_cpu_to_domain(0);
> +
> + /*
> + * Make special mapping between per CPU IRQs and GSVs
> + */
> + for (gsv = 0; gsv < NR_GSVS; gsv++) {
> + vec = gsv_to_vector(gsv);
> + if (vec < IA64_FIRST_DEVICE_VECTOR ||
> + vec > IA64_LAST_DEVICE_VECTOR) {
> + ia64_gsv_to_irq_map[gsv] = vec;
> + ia64_irq_to_gsv_map[vec] = vec;
Should the above be = gsv instead of vec?
> + ia64_irq_to_gsv_map[vec] = vec;
---------------------------------------------------^^^^
> +
> +/*
> + * Convert global system vector to the corresponding IRQ.
> + */
> +static inline int
> +gsv_to_irq (unsigned int gsv)
> +{
> + if (gsv > NR_GSVS)
Should the above be (gsv >= NR_GSVS)??
> + return -1;
> + return ia64_gsv_to_irq_map[gsv];
> +}
> +
--
Cheers,
Ashok Raj
- Open Source Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [RFC][patch 3/10] Multiple vector domain support - introduce
2005-07-14 9:24 [RFC][patch 3/10] Multiple vector domain support - introduce gsv Kenji Kaneshige
2005-07-14 17:50 ` Ashok Raj
@ 2005-07-16 1:07 ` Kenji Kaneshige
1 sibling, 0 replies; 3+ messages in thread
From: Kenji Kaneshige @ 2005-07-16 1:07 UTC (permalink / raw)
To: linux-ia64
Hi Ashok,
Thank you for comments.
>>+
>>+ /*
>>+ * Make special mapping between per CPU IRQs and GSVs
>>+ */
>>+ for (gsv = 0; gsv < NR_GSVS; gsv++) {
>>+ vec = gsv_to_vector(gsv);
>>+ if (vec < IA64_FIRST_DEVICE_VECTOR ||
>>+ vec > IA64_LAST_DEVICE_VECTOR) {
>>+ ia64_gsv_to_irq_map[gsv] = vec;
>>+ ia64_irq_to_gsv_map[vec] = vec;
>
>
> Should the above be = gsv instead of vec?
>
>>+ ia64_irq_to_gsv_map[vec] = vec;
>
> ---------------------------------------------------^^^^
I did this by intent, but we can also use "= gsv" instead
of "= vec".
In my patch, all per CPU interrupts are mapped to the same
IRQ regardless of what domain the cpu belongs to. So multiple
gsvs are mappied to one IRQ for per CPU interrupts.
>>+/*
>>+ * Convert global system vector to the corresponding IRQ.
>>+ */
>>+static inline int
>>+gsv_to_irq (unsigned int gsv)
>>+{
>>+ if (gsv > NR_GSVS)
>
>
> Should the above be (gsv >= NR_GSVS)??
>
Yes, it's a bug.
Thank you for finding this out.
Thanks,
Kenji Kaneshige
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-07-16 1:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-14 9:24 [RFC][patch 3/10] Multiple vector domain support - introduce gsv Kenji Kaneshige
2005-07-14 17:50 ` Ashok Raj
2005-07-16 1:07 ` [RFC][patch 3/10] Multiple vector domain support - introduce Kenji Kaneshige
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox