From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 14:51:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 696FD106564A; Thu, 25 Feb 2010 14:51:07 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5848E8FC1B; Thu, 25 Feb 2010 14:51:07 +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 o1PEp7fr042501; Thu, 25 Feb 2010 14:51:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PEp6iE042500; Thu, 25 Feb 2010 14:51:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002251451.o1PEp6iE042500@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 25 Feb 2010 14:51:06 +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: r204312 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 14:51:07 -0000 Author: nwhitehorn Date: Thu Feb 25 14:51:06 2010 New Revision: 204312 URL: http://svn.freebsd.org/changeset/base/204312 Log: Fix another bug involving /dev/mem and the OEA64 scratchpage. When the scratchpage is updated, the PVO's physical address is updated as well. This makes pmap_extract() begin returning non-zero values again, causing the panic partially fixed in r204297. Fix this by excluding addresses beyond virtual_end from consideration as KVA addresses, instead of allowing addresses up to VM_MAX_KERNEL_ADDRESS. Modified: head/sys/powerpc/powerpc/mem.c Modified: head/sys/powerpc/powerpc/mem.c ============================================================================== --- head/sys/powerpc/powerpc/mem.c Thu Feb 25 14:42:26 2010 (r204311) +++ head/sys/powerpc/powerpc/mem.c Thu Feb 25 14:51:06 2010 (r204312) @@ -121,8 +121,7 @@ kmem_direct_mapped: v = uio->uio_offset; else if (dev2unit(dev) == CDEV_MINOR_KMEM) { va = uio->uio_offset; - if ((va < VM_MIN_KERNEL_ADDRESS) - || (va > VM_MAX_KERNEL_ADDRESS)) + if ((va < VM_MIN_KERNEL_ADDRESS) || (va > virtual_end)) goto kmem_direct_mapped; va = trunc_page(uio->uio_offset); @@ -135,8 +134,7 @@ kmem_direct_mapped: v = uio->uio_offset; */ for (; va < eva; va += PAGE_SIZE) - if (pmap_extract(kernel_pmap, va) - == 0) + if (pmap_extract(kernel_pmap, va) == 0) return (EFAULT); prot = (uio->uio_rw == UIO_READ)