Module Name:    src
Committed By:   pooka
Date:           Tue Sep  7 18:25:38 UTC 2010

Modified Files:
        src/sys/rump/librump/rumpkern: intr.c rump.c rump_private.h

Log Message:
Allocate softint vectors for the final number of CPUs, not the
number currently attached.  Deals with a SNAFU in my commit earlier
today which would cause softints established early to lack a
softint context on non-bootstrap CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/rump/librump/rumpkern/intr.c
cvs rdiff -u -r1.186 -r1.187 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.56 -r1.57 src/sys/rump/librump/rumpkern/rump_private.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/librump/rumpkern/intr.c
diff -u src/sys/rump/librump/rumpkern/intr.c:1.33 src/sys/rump/librump/rumpkern/intr.c:1.34
--- src/sys/rump/librump/rumpkern/intr.c:1.33	Tue Sep  7 17:49:23 2010
+++ src/sys/rump/librump/rumpkern/intr.c	Tue Sep  7 18:25:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.33 2010/09/07 17:49:23 pooka Exp $	*/
+/*	$NetBSD: intr.c,v 1.34 2010/09/07 18:25:38 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.33 2010/09/07 17:49:23 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.34 2010/09/07 18:25:38 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -74,6 +74,7 @@
 kcondvar_t lbolt; /* Oh Kath Ra */
 
 static u_int ticks;
+static int ncpu_final;
 
 static u_int
 rumptc_get(struct timecounter *tc)
@@ -198,10 +199,11 @@
 }
 
 void
-rump_intr_init()
+rump_intr_init(int numcpu)
 {
 
 	cv_init(&lbolt, "oh kath ra");
+	ncpu_final = numcpu;
 }
 
 void
@@ -256,9 +258,9 @@
 	si->si_flags = flags & SOFTINT_MPSAFE ? SI_MPSAFE : 0;
 	si->si_level = flags & SOFTINT_LVLMASK;
 	KASSERT(si->si_level < SOFTINT_COUNT);
-	si->si_entry = malloc(sizeof(*si->si_entry) * ncpu,
+	si->si_entry = malloc(sizeof(*si->si_entry) * ncpu_final,
 	    M_TEMP, M_WAITOK | M_ZERO);
-	for (i = 0; i < ncpu; i++) {
+	for (i = 0; i < ncpu_final; i++) {
 		sip = &si->si_entry[i];
 		sip->sip_parent = si;
 	}
@@ -299,7 +301,7 @@
 	struct softint *si = cook;
 	int i;
 
-	for (i = 0; i < ncpu; i++) {
+	for (i = 0; i < ncpu_final; i++) {
 		struct softint_percpu *sip;
 
 		sip = &si->si_entry[i];

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.186 src/sys/rump/librump/rumpkern/rump.c:1.187
--- src/sys/rump/librump/rumpkern/rump.c:1.186	Tue Sep  7 07:59:48 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Tue Sep  7 18:25:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.186 2010/09/07 07:59:48 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.187 2010/09/07 18:25:38 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.186 2010/09/07 07:59:48 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.187 2010/09/07 18:25:38 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -269,7 +269,7 @@
 	}
 	rumpuser_thrinit(rump_user_schedule, rump_user_unschedule,
 	    rump_threads);
-	rump_intr_init();
+	rump_intr_init(numcpu);
 	rump_tsleep_init();
 
 	/* init minimal lwp/cpu context */

Index: src/sys/rump/librump/rumpkern/rump_private.h
diff -u src/sys/rump/librump/rumpkern/rump_private.h:1.56 src/sys/rump/librump/rumpkern/rump_private.h:1.57
--- src/sys/rump/librump/rumpkern/rump_private.h:1.56	Tue Sep  7 07:59:48 2010
+++ src/sys/rump/librump/rumpkern/rump_private.h	Tue Sep  7 18:25:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_private.h,v 1.56 2010/09/07 07:59:48 pooka Exp $	*/
+/*	$NetBSD: rump_private.h,v 1.57 2010/09/07 18:25:38 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -135,7 +135,7 @@
 
 void	rump_tsleep_init(void);
 
-void	rump_intr_init(void);
+void	rump_intr_init(int);
 void	rump_softint_run(struct cpu_info *);
 
 void	*rump_hypermalloc(size_t, int, bool, const char *);

Reply via email to