From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 18:19:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 873D856F; Sat, 26 Oct 2013 18:19:37 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A8282BC0; Sat, 26 Oct 2013 18:19:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QIJb1q076750; Sat, 26 Oct 2013 18:19:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QIJb1p076749; Sat, 26 Oct 2013 18:19:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261819.r9QIJb1p076749@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 18:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257180 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 26 Oct 2013 18:19:37 -0000 Author: nwhitehorn Date: Sat Oct 26 18:19:36 2013 New Revision: 257180 URL: http://svnweb.freebsd.org/changeset/base/257180 Log: Add some extra sanity checking and checks to printf format specifiers. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Oct 26 18:18:50 2013 (r257179) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Oct 26 18:19:36 2013 (r257180) @@ -498,15 +498,7 @@ moea64_add_ofw_mappings(mmu_t mmup, phan qsort(translations, sz, sizeof (*translations), om_cmp); for (i = 0; i < sz; i++) { - CTR3(KTR_PMAP, "translation: pa=%#x va=%#x len=%#x", - (uint32_t)(translations[i].om_pa_lo), translations[i].om_va, - translations[i].om_len); - - if (translations[i].om_pa_lo % PAGE_SIZE) - panic("OFW translation not page-aligned!"); - pa_base = translations[i].om_pa_lo; - #ifdef __powerpc64__ pa_base += (vm_offset_t)translations[i].om_pa_hi << 32; #else @@ -514,6 +506,14 @@ moea64_add_ofw_mappings(mmu_t mmup, phan panic("OFW translations above 32-bit boundary!"); #endif + if (pa_base % PAGE_SIZE) + panic("OFW translation not page-aligned (phys)!"); + if (translations[i].om_va % PAGE_SIZE) + panic("OFW translation not page-aligned (virt)!"); + + CTR3(KTR_PMAP, "translation: pa=%#zx va=%#x len=%#x", + pa_base, translations[i].om_va, translations[i].om_len); + /* Now enter the pages for this mapping */ DISABLE_TRANS(msr); @@ -690,9 +690,9 @@ moea64_early_bootstrap(mmu_t mmup, vm_of hwphyssz = 0; TUNABLE_ULONG_FETCH("hw.physmem", (u_long *) &hwphyssz); for (i = 0, j = 0; i < regions_sz; i++, j += 2) { - CTR3(KTR_PMAP, "region: %#x - %#x (%#x)", regions[i].mr_start, - regions[i].mr_start + regions[i].mr_size, - regions[i].mr_size); + CTR3(KTR_PMAP, "region: %#zx - %#zx (%#zx)", + regions[i].mr_start, regions[i].mr_start + + regions[i].mr_size, regions[i].mr_size); if (hwphyssz != 0 && (physsz + regions[i].mr_size) >= hwphyssz) { if (physsz < hwphyssz) {