summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2011-12-15 17:54:23 +0000
committeralc <alc@FreeBSD.org>2011-12-15 17:54:23 +0000
commit7538d819fc6d6789835d8e24e4573eb1a35658d4 (patch)
tree5c928acfbcaf6022d69949114d9bbdfde6efb479
parent6d2ab3b363df57acc7b6336674b764a27fee78a3 (diff)
downloadFreeBSD-src-7538d819fc6d6789835d8e24e4573eb1a35658d4.zip
FreeBSD-src-7538d819fc6d6789835d8e24e4573eb1a35658d4.tar.gz
Simplify the implementation of the identity mapping in start_all_aps().
Since mpboot.s enables processor support for PG_PS before enabling paging, there is no reason that the identity must use 4 KB page mappings. Discussed with: jhb
-rw-r--r--sys/i386/i386/locore.s3
-rw-r--r--sys/i386/i386/mp_machdep.c9
2 files changed, 2 insertions, 10 deletions
diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s
index 107cbcf..68cb430 100644
--- a/sys/i386/i386/locore.s
+++ b/sys/i386/i386/locore.s
@@ -775,8 +775,7 @@ no_kernend:
* if we've enabled PSE above, we'll just switch the corresponding kernel
* PDEs before we turn on paging.
*
- * XXX: We waste some pages here in the PSE case! DON'T BLINDLY REMOVE
- * THIS! SMP needs the page table to be there to map the kernel P==V.
+ * XXX: We waste some pages here in the PSE case!
*/
xorl %eax, %eax
movl R(KERNend),%ecx
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 11d23ba..b67a39f 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -145,9 +145,6 @@ static int bootAP;
void *bootstacks[MAXCPU];
static void *dpcpu;
-/* Hotwire a 0->4MB V==P mapping */
-extern pt_entry_t *KPTphys;
-
struct pcb stoppcbs[MAXCPU];
/* Variables needed for SMP tlb shootdown. */
@@ -931,7 +928,6 @@ start_all_aps(void)
#ifndef PC98
u_char mpbiosreason;
#endif
- uintptr_t kptbase;
u_int32_t mpbioswarmvec;
int apic_id, cpu, i;
@@ -949,11 +945,8 @@ start_all_aps(void)
/* 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 (i = TMPMAP_START; i < NKPT; i++)
- PTD[i] = (pd_entry_t)(PG_V | PG_RW |
- ((kptbase + i * PAGE_SIZE) & PG_FRAME));
+ PTD[i] = PTD[KPTDI + i];
invltlb();
/* start each AP */
OpenPOWER on IntegriCloud