From owner-p4-projects@FreeBSD.ORG Mon Jan 21 23:29:12 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5E74916A419; Mon, 21 Jan 2008 23:29:12 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FA9F16A420 for ; Mon, 21 Jan 2008 23:29:11 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1424913C46B for ; Mon, 21 Jan 2008 23:29:11 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0LNTAw4024682 for ; Mon, 21 Jan 2008 23:29:10 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0LNTAAU024679 for perforce@freebsd.org; Mon, 21 Jan 2008 23:29:10 GMT (envelope-from gonzo@FreeBSD.org) Date: Mon, 21 Jan 2008 23:29:10 GMT Message-Id: <200801212329.m0LNTAAU024679@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 133827 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2008 23:29:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=133827 Change 133827 by gonzo@gonzo_jeeves on 2008/01/21 23:29:06 o Back out a bit hackerish solution for kstack0 located in KSEG0 while cpu_thread_alloc expects to get it in KSEG2 presented by changesets 133821 and 133822. Affected files ... .. //depot/projects/mips2-jnpr/src/sys/mips/mips/vm_machdep.c#10 edit Differences ... ==== //depot/projects/mips2-jnpr/src/sys/mips/mips/vm_machdep.c#10 (text+ko) ==== @@ -140,22 +140,13 @@ td2->td_frame->v1 = 1; td2->td_frame->a3 = 0; - /* - * thread 0 has its stack in KSEG0 space. In that case, there's - * nothing to do since we're not going to change the physical address - * of where we're swapped in at... - */ - pte = pmap_segmap(kernel_pmap, (vm_offset_t)td2->td_kstack); - if (pte == NULL) { - if ((vm_offset_t)td2->td_kstack < MIPS_KSEG0_START && - (vm_offset_t)td2->td_kstack > MIPS_KSEG0_END) - panic("cpu_fork: invalid segmap"); - } else { - pte += ((vm_offset_t)td2->td_kstack >> PGSHIFT) & (NPTEPG - 1); - for (i = 0; i < KSTACK_PAGES; i++) { - td2->td_md.md_upte[i] = *pte & ~(PG_RO|PG_WIRED); - pte++; - } + if (!(pte = pmap_segmap(kernel_pmap, (vm_offset_t)td2->td_kstack))) + panic("cpu_fork: invalid segmap"); + pte += ((vm_offset_t)td2->td_kstack >> PGSHIFT) & (NPTEPG - 1); + + for (i = 0; i < KSTACK_PAGES; i++) { + td2->td_md.md_upte[i] = *pte & ~(PG_RO|PG_WIRED); + pte++; } if (td1 == PCPU_GET(fpcurthread)) @@ -258,15 +249,6 @@ td->td_kstack_pages * PAGE_SIZE) - 1; td->td_frame = &td->td_pcb->pcb_regs; - /* - * thread 0 has its stack in KSEG0 space. In that case, there's - * nothing to do since we're not going to change the physical address - * of where we're swapped in at... - */ - if ((vm_offset_t)td->td_kstack > MIPS_KSEG0_START && - (vm_offset_t)td->td_kstack < MIPS_KSEG0_END) - return; - if (!(pte = pmap_segmap(kernel_pmap, (vm_offset_t)td->td_kstack))) panic("cpu_thread_alloc: invalid segmap"); pte += ((vm_offset_t)td->td_kstack >> PGSHIFT) & (NPTEPG - 1);