From owner-svn-src-stable@FreeBSD.ORG Sat Nov 28 18:36:58 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0C09106566C; Sat, 28 Nov 2009 18:36:58 +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 B498E8FC16; Sat, 28 Nov 2009 18:36:58 +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 nASIawIB063770; Sat, 28 Nov 2009 18:36:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nASIawIM063767; Sat, 28 Nov 2009 18:36:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911281836.nASIawIM063767@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 28 Nov 2009 18:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199890 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2009 18:36:59 -0000 Author: nwhitehorn Date: Sat Nov 28 18:36:58 2009 New Revision: 199890 URL: http://svn.freebsd.org/changeset/base/199890 Log: MFC r198400: Do not map the trap vectors into the kernel's address space. They are only used in real mode and keeping them mapped only serves to make NULL a valid address, which results in silent NULL pointer deferences. Suggested by: Patrick Kerharo Obtained from: projects/ppc64 Modified: stable/8/sys/powerpc/aim/mmu_oea64.c stable/8/sys/powerpc/aim/trap_subr.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea64.c Sat Nov 28 18:34:35 2009 (r199889) +++ stable/8/sys/powerpc/aim/mmu_oea64.c Sat Nov 28 18:36:58 2009 (r199890) @@ -869,15 +869,17 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o ENABLE_TRANS(msr); /* - * Map certain important things, like ourselves and the exception - * vectors + * Map certain important things, like ourselves. + * + * NOTE: We do not map the exception vector space. That code is + * used only in real mode, and leaving it unmapped allows us to + * catch NULL pointer deferences, instead of making NULL a valid + * address. */ DISABLE_TRANS(msr); for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; pa += PAGE_SIZE) moea64_kenter(mmup, pa, pa); - for (pa = EXC_RSVD; pa < EXC_LAST; pa += PAGE_SIZE) - moea64_kenter(mmup, pa, pa); ENABLE_TRANS(msr); if (!ofw_real_mode) { Modified: stable/8/sys/powerpc/aim/trap_subr.S ============================================================================== --- stable/8/sys/powerpc/aim/trap_subr.S Sat Nov 28 18:34:35 2009 (r199889) +++ stable/8/sys/powerpc/aim/trap_subr.S Sat Nov 28 18:36:58 2009 (r199890) @@ -275,10 +275,16 @@ CNAME(restorebridgesize) = .-CNAME(resto /* * Processor reset exception handler. These are typically * the first instructions the processor executes after a - * software reset. + * software reset. We do this in two bits so that we are + * not still hanging around in the trap handling region + * once the MMU is turned on. */ .globl CNAME(rstcode), CNAME(rstsize) CNAME(rstcode): + ba cpu_reset +CNAME(rstsize) = . - CNAME(rstcode) + +cpu_reset: bl 1f .space 124 @@ -296,7 +302,6 @@ CNAME(rstcode): /* Should not be reached */ 9: b 9b -CNAME(rstsize) = . - CNAME(rstcode) #endif /*