aboutsummaryrefslogtreecommitdiff
path: root/sys/i386
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2015-08-04 13:50:52 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2015-08-04 13:50:52 +0000
commit3208d3ff4695a322ed9ab7bbd38445a5fc7efd51 (patch)
tree0f76a7fe7438dae633286557783c41cea5b288ad /sys/i386
parent1da17fb7be15ddef4be7defb7a2b845ce3e40355 (diff)
downloadsrc-3208d3ff4695a322ed9ab7bbd38445a5fc7efd51.tar.gz
src-3208d3ff4695a322ed9ab7bbd38445a5fc7efd51.zip
Give large kernel stack to the initial thread . Otherwise, ZFS
overflows the stack during root mount in some configurations. Tested by: Fabian Keil <freebsd-listen@fabiankeil.de> (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=286288
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/genassym.c1
-rw-r--r--sys/i386/i386/locore.s4
-rw-r--r--sys/i386/i386/machdep.c2
-rw-r--r--sys/i386/include/param.h5
4 files changed, 9 insertions, 3 deletions
diff --git a/sys/i386/i386/genassym.c b/sys/i386/i386/genassym.c
index 7a00740a998c..6a00d2361539 100644
--- a/sys/i386/i386/genassym.c
+++ b/sys/i386/i386/genassym.c
@@ -103,6 +103,7 @@ ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall));
ASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
/* ASSYM(UPAGES, UPAGES);*/
ASSYM(KSTACK_PAGES, KSTACK_PAGES);
+ASSYM(TD0_KSTACK_PAGES, TD0_KSTACK_PAGES);
ASSYM(PAGE_SIZE, PAGE_SIZE);
ASSYM(NPTEPG, NPTEPG);
ASSYM(NPDEPG, NPDEPG);
diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s
index 5bf7944568e9..4d8e22fc3002 100644
--- a/sys/i386/i386/locore.s
+++ b/sys/i386/i386/locore.s
@@ -731,7 +731,7 @@ no_kernend:
movl %esi,R(IdlePTD)
/* Allocate KSTACK */
- ALLOCPAGES(KSTACK_PAGES)
+ ALLOCPAGES(TD0_KSTACK_PAGES)
movl %esi,R(p0kpa)
addl $KERNBASE, %esi
movl %esi, R(proc0kstack)
@@ -800,7 +800,7 @@ no_kernend:
/* Map proc0's KSTACK in the physical way ... */
movl R(p0kpa), %eax
- movl $(KSTACK_PAGES), %ecx
+ movl $(TD0_KSTACK_PAGES), %ecx
fillkptphys($PG_RW)
/* Map ISA hole */
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 2be5dbc5070e..76790f0d5c31 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -2445,7 +2445,7 @@ init386(first)
#endif
thread0.td_kstack = proc0kstack;
- thread0.td_kstack_pages = KSTACK_PAGES;
+ thread0.td_kstack_pages = TD0_KSTACK_PAGES;
/*
* This may be done better later if it gets more high level
diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h
index b3fd85f45344..f7968f830800 100644
--- a/sys/i386/include/param.h
+++ b/sys/i386/include/param.h
@@ -114,6 +114,11 @@
#define KSTACK_PAGES 2 /* Includes pcb! */
#endif
#define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */
+#if KSTACK_PAGES < 4
+#define TD0_KSTACK_PAGES 4
+#else
+#define TD0_KSTACK_PAGES KSTACK_PAGES
+#endif
/*
* Ceiling on amount of swblock kva space, can be changed via