From owner-p4-projects@FreeBSD.ORG Tue Dec 16 17:18:48 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BCBEA1065675; Tue, 16 Dec 2008 17:18:48 +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 810461065670 for ; Tue, 16 Dec 2008 17:18:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE178FC20 for ; Tue, 16 Dec 2008 17:18:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBGHImfZ099892 for ; Tue, 16 Dec 2008 17:18:48 GMT (envelope-from nwhitehorn@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBGHImfO099890 for perforce@freebsd.org; Tue, 16 Dec 2008 17:18:48 GMT (envelope-from nwhitehorn@freebsd.org) Date: Tue, 16 Dec 2008 17:18:48 GMT Message-Id: <200812161718.mBGHImfO099890@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to nwhitehorn@freebsd.org using -f From: Nathan Whitehorn To: Perforce Change Reviews Cc: Subject: PERFORCE change 154804 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: Tue, 16 Dec 2008 17:18:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=154804 Change 154804 by nwhitehorn@nwhitehorn_trantor on 2008/12/16 17:17:59 Drop the static buffer. We can get away without it, using pmap_kextract(), on the assumption that memory in this critical time will still have a physical address in the 32-bit range. This issue should be revisited in future. Affected files ... .. //depot/projects/ppc-g5/sys/powerpc/ofw/ofw_real.c#5 edit Differences ... ==== //depot/projects/ppc-g5/sys/powerpc/ofw/ofw_real.c#5 (text+ko) ==== @@ -157,14 +157,8 @@ static struct mtx of_bounce_mtx; /* - * We need a statically allocated bounce buffer to handle the case when - * there are Open Firmware calls after the MMU has been enabled but before - * the VM has been initialized to the point that we can allocate memory. - * Make it 256 bytes and 8 byte aligned and hope for the best. - * - * After the VM is up, allocate more memory. + * After the VM is up, allocate a wired, low memory bounce page. */ -static uint64_t of_static_bounce_buffer[32]; static void ofw_real_bounce_alloc(void *); @@ -220,10 +214,14 @@ if (!pmap_bootstrapped) return (cell_t)buf; - of_bounce_virt = (caddr_t)of_static_bounce_buffer; - of_bounce_size = sizeof(of_static_bounce_buffer); - - of_bounce_phys = vtophys(of_static_bounce_buffer); + /* + * XXX: It is possible for us to get called before the VM has + * come online, but after the MMU is up. We don't have the + * bounce buffer yet, but can no longer presume a 1:1 mapping. + * Grab the physical address of the buffer, and hope it is + * in range if this happens. + */ + return (cell_t)vtophys(buf); } /*