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
This commit is contained in:
Alan Cox 2011-12-15 17:54:23 +00:00
parent 338e7cf235
commit 725e839b9f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=228535
2 changed files with 2 additions and 10 deletions

View File

@ -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

View File

@ -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 */