* [Adeos-main] [RFC][PATCH] x86-64: catch too large NR_CPUS
@ 2007-12-20 11:31 Jan Kiszka
2007-12-20 11:37 ` Jan Kiszka
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2007-12-20 11:31 UTC (permalink / raw)
To: adeos-main
[-- Attachment #1: Type: text/plain, Size: 703 bytes --]
Hi,
building Xenomai for an 8-way box and deriving its setup from an
existing .config, I fortunately noticed some warning in ipipe.c. It
pointed out an overflow in IPIPE_IRQMASK_VIRT when NR_CPUS gets too
large. This causes NR_IRQS to explode, which then lets the virtual IRQ
mask overflow.
I bet no one currently wants to run Xenomai on such large systems, but
the problem is that the dependency above may nevertheless slip through
some setups unnoticed. Therefore, the attached patch catches this
invalid setup and bails out at compile time (does anyone have a nicer
idea for a config-time safety bag?).
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
[-- Attachment #2: catch-too-many-cpus.patch --]
[-- Type: text/x-patch, Size: 728 bytes --]
---
arch/x86_64/kernel/ipipe.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: linux-2.6.23.12-xeno/arch/x86_64/kernel/ipipe.c
===================================================================
--- linux-2.6.23.12-xeno.orig/arch/x86_64/kernel/ipipe.c
+++ linux-2.6.23.12-xeno/arch/x86_64/kernel/ipipe.c
@@ -44,6 +44,12 @@
#include <asm/ipi.h>
#include <asm/mach_apic.h>
+/* Sanity check: IPIPE_VIRQ_BASE depends on CONFIG_NR_CPUS, and if this
+ gets too large, we run into troubles with the ipipe IRQ log. */
+#if IPIPE_VIRQ_BASE / BITS_PER_LONG > BITS_PER_LONG
+# error CONFIG_NR_CPUS is too large, please lower it.
+#endif
+
asmlinkage void preempt_schedule_irq(void);
int __ipipe_tick_irq; /* =0: 8254 */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Adeos-main] [RFC][PATCH] x86-64: catch too large NR_CPUS
2007-12-20 11:31 [Adeos-main] [RFC][PATCH] x86-64: catch too large NR_CPUS Jan Kiszka
@ 2007-12-20 11:37 ` Jan Kiszka
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2007-12-20 11:37 UTC (permalink / raw)
To: adeos-main
Jan Kiszka wrote:
> Hi,
>
> building Xenomai for an 8-way box and deriving its setup from an
> existing .config, I fortunately noticed some warning in ipipe.c. It
> pointed out an overflow in IPIPE_IRQMASK_VIRT when NR_CPUS gets too
> large. This causes NR_IRQS to explode, which then lets the virtual IRQ
> mask overflow.
More concrete: Too large meant CONFIG_NR_CPUS=128. You can still get
away with 64 - or just select what is physically there...
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-20 11:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-20 11:31 [Adeos-main] [RFC][PATCH] x86-64: catch too large NR_CPUS Jan Kiszka
2007-12-20 11:37 ` Jan Kiszka
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.