From owner-p4-projects@FreeBSD.ORG Tue Sep 30 15:52:23 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9303816A4E7; Tue, 30 Sep 2003 15:52:23 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5164C16A4DF for ; Tue, 30 Sep 2003 15:52:23 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3569C43FE3 for ; Tue, 30 Sep 2003 15:52:22 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id h8UMqLXJ029444 for ; Tue, 30 Sep 2003 15:52:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id h8UMqL41029438 for perforce@freebsd.org; Tue, 30 Sep 2003 15:52:21 -0700 (PDT) (envelope-from peter@freebsd.org) Date: Tue, 30 Sep 2003 15:52:21 -0700 (PDT) Message-Id: <200309302252.h8UMqL41029438@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 38929 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 22:52:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=38929 Change 38929 by peter@peter_hammer on 2003/09/30 15:51:24 I'm not going to do a P==V hack for amd64, I'll use a custom page table tree for boot and reclaim the pages. Start killing the vile SMPpt[] and SMP_prvspace nastiness. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#11 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#11 (text+ko) ==== @@ -435,14 +435,6 @@ outb(CMOS_REG, BIOS_RESET); mpbiosreason = inb(CMOS_DATA); - /* 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 = 0; i < NKPT; i++) - PTD[i] = (pd_entry_t)(PG_V | PG_RW | - ((kptbase + i * PAGE_SIZE) & PG_FRAME)); - invltlb(); - /* start each AP */ for (cpu = 0, apic_id = 0; apic_id < MAXCPU; apic_id++) { if (!cpu_info[apic_id].cpu_present || @@ -450,20 +442,11 @@ continue; cpu++; - /* first page of AP's private space */ - pg = cpu * amd64_btop(sizeof(struct privatespace)); - /* allocate a new private data page */ pc = (struct pcpu *)kmem_alloc(kernel_map, PAGE_SIZE); - /* wire it into the private page table page */ - SMPpt[pg] = (pt_entry_t)(PG_V | PG_RW | vtophys(pc)); - /* allocate and set up an idle stack data page */ - stack = (char *)kmem_alloc(kernel_map, KSTACK_PAGES * PAGE_SIZE); /* XXXKSE */ - for (i = 0; i < KSTACK_PAGES; i++) - SMPpt[pg + 1 + i] = (pt_entry_t) - (PG_V | PG_RW | vtophys(PAGE_SIZE * i + stack)); + stack = (char *)kmem_alloc(kernel_map, KSTACK_PAGES * PAGE_SIZE); /* prime data page for it to use */ pcpu_init(pc, cpu, sizeof(struct pcpu)); @@ -831,9 +814,6 @@ while (!aps_ready) ia32_pause(); - /* BSP may have changed PTD while we were waiting */ - invltlb(); - /* set up CPU registers and state */ cpu_setregs();