From owner-svn-src-all@FreeBSD.ORG Thu Dec 15 17:54:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A19101065672; Thu, 15 Dec 2011 17:54:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76D5A8FC12; Thu, 15 Dec 2011 17:54:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBFHsOl3060925; Thu, 15 Dec 2011 17:54:24 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBFHsOGL060922; Thu, 15 Dec 2011 17:54:24 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201112151754.pBFHsOGL060922@svn.freebsd.org> From: Alan Cox Date: Thu, 15 Dec 2011 17:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228535 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2011 17:54:24 -0000 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 */