From owner-svn-src-all@FreeBSD.ORG Wed Apr 14 01:29:31 2010 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 5A8BC106564A; Wed, 14 Apr 2010 01:29:31 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0BF8FC12; Wed, 14 Apr 2010 01:29:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3E1TVdG023941; Wed, 14 Apr 2010 01:29:31 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3E1TVY8023939; Wed, 14 Apr 2010 01:29:31 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201004140129.o3E1TVY8023939@svn.freebsd.org> From: Neel Natu Date: Wed, 14 Apr 2010 01:29:31 +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: r206582 - head/sys/mips/mips 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: Wed, 14 Apr 2010 01:29:31 -0000 Author: neel Date: Wed Apr 14 01:29:31 2010 New Revision: 206582 URL: http://svn.freebsd.org/changeset/base/206582 Log: Revert the vm_machdep.c part of r205072. This causes a panic in vm_thread_dispose() when it tries to add this kstack to the kstack cache. This happens only when 'td_kstack' is not (PAGE_SIZE * 2) bytes aligned and we have unmapped the page at that address in cpu_thread_alloc. Pointed out by: nwhitehorn@ Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Wed Apr 14 01:24:09 2010 (r206581) +++ head/sys/mips/mips/vm_machdep.c Wed Apr 14 01:29:31 2010 (r206582) @@ -214,16 +214,6 @@ cpu_thread_swapin(struct thread *td) { pt_entry_t *pte; int i; - vm_offset_t unused_kstack_page; - - /* - * Unmap the unused kstack page. - */ - unused_kstack_page = td->td_kstack; - if (td->td_md.md_realstack == td->td_kstack) - unused_kstack_page += (KSTACK_PAGES - 1) * PAGE_SIZE; - - pmap_kremove(unused_kstack_page); /* * The kstack may be at a different physical address now. @@ -249,19 +239,13 @@ cpu_thread_swapout(struct thread *td) void cpu_thread_alloc(struct thread *td) { - vm_offset_t unused_kstack_page; pt_entry_t *pte; int i; - if (td->td_kstack & (1 << PAGE_SHIFT)) { + if (td->td_kstack & (1 << PAGE_SHIFT)) td->td_md.md_realstack = td->td_kstack + PAGE_SIZE; - unused_kstack_page = td->td_kstack; - } else { + else td->td_md.md_realstack = td->td_kstack; - unused_kstack_page = td->td_kstack + - (KSTACK_PAGES - 1) * PAGE_SIZE; - } - pmap_kremove(unused_kstack_page); td->td_pcb = (struct pcb *)(td->td_md.md_realstack + (td->td_kstack_pages - 1) * PAGE_SIZE) - 1;