diff options
author | peter <peter@FreeBSD.org> | 2001-03-15 05:10:06 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-03-15 05:10:06 +0000 |
commit | d7e8a2bd6694fef706e0403d2b689ee7fb515848 (patch) | |
tree | 50b7fdc1abf4df5cf78457432d520174c6857d93 /sys/kern/subr_smp.c | |
parent | 91396cbcebe98f331cbc81d48a85cb05209b5012 (diff) | |
download | FreeBSD-src-d7e8a2bd6694fef706e0403d2b689ee7fb515848.zip FreeBSD-src-d7e8a2bd6694fef706e0403d2b689ee7fb515848.tar.gz |
Kill the 4MB kernel limit dead. [I hope :-)].
For UP, we were using $tmp_stk as a stack from the data section. If the
kernel text section grew beyond ~3MB, the data section would be pushed
beyond the temporary 4MB P==V mapping. This would cause the trampoline
up to high memory to fault. The hack workaround I did was to use all of
the page table pages that we already have while preparing the initial
P==V mapping, instead of just the first one.
For SMP, the AP bootstrap process suffered the same sort of problem and
got the same treatment.
MFC candidate - this breaks on 4.x just the same..
Thanks to: Richard Todd <rmtodd@ichotolot.servalan.com>
Diffstat (limited to 'sys/kern/subr_smp.c')
-rw-r--r-- | sys/kern/subr_smp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index f6d23dd..9797905 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -1943,6 +1943,7 @@ start_all_aps(u_int boot_addr) u_long mpbioswarmvec; struct globaldata *gd; char *stack; + uintptr_t kptbase; POSTCODE(START_ALL_APS_POST); @@ -1964,8 +1965,12 @@ start_all_aps(u_int boot_addr) /* record BSP in CPU map */ all_cpus = 1; - /* set up 0 -> 4MB P==V mapping for AP boot */ - *(int *)PTD = PG_V | PG_RW | ((uintptr_t)(void *)KPTphys & PG_FRAME); + /* set up temporary P==V mapping for AP boot */ + /* XXX this is a hack, we should boot the AP on its own stack/PTD */ + kptbase = (uintptr_t)(void *)KPTphys; + for (x = 0; x < NKPT; x++) + PTD[x] = (pd_entry_t)(PG_V | PG_RW | + ((kptbase + x * PAGE_SIZE) & PG_FRAME)); invltlb(); /* start each AP */ @@ -2047,7 +2052,8 @@ start_all_aps(u_int boot_addr) SMPpt[1 + i] = (pt_entry_t) (PG_V | PG_RW | vtophys(PAGE_SIZE * i + stack)); - *(int *)PTD = 0; + for (x = 0; x < NKPT; x++) + PTD[x] = 0; pmap_set_opt(); /* number of APs actually started */ |