Author: alc
Date: Thu Dec 15 17:54:23 2011
New Revision: 228535
URL: http://svn.freebsd.org/changeset/base/228535

Log:
  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

Modified:
  head/sys/i386/i386/locore.s
  head/sys/i386/i386/mp_machdep.c

Modified: head/sys/i386/i386/locore.s
==============================================================================
--- head/sys/i386/i386/locore.s Thu Dec 15 16:39:48 2011        (r228534)
+++ head/sys/i386/i386/locore.s Thu Dec 15 17:54:23 2011        (r228535)
@@ -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

Modified: head/sys/i386/i386/mp_machdep.c
==============================================================================
--- head/sys/i386/i386/mp_machdep.c     Thu Dec 15 16:39:48 2011        
(r228534)
+++ head/sys/i386/i386/mp_machdep.c     Thu Dec 15 17:54:23 2011        
(r228535)
@@ -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 */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to