svn commit: r291122 - head/sys/powerpc/booke

Justin Hibbits jhibbits at FreeBSD.org
Sat Nov 21 06:03:48 UTC 2015


Author: jhibbits
Date: Sat Nov 21 06:03:46 2015
New Revision: 291122
URL: https://svnweb.freebsd.org/changeset/base/291122

Log:
  trunc_page() goes through unsigned long, which is too short.
  
  sizeof(unsigned long) < sizeof(vm_paddr_t) on Book-E, which uses 36-bit
  addressing.  With this, a CCSR with a physical address above 4GB successfully
  maps.
  
  Sponsored by:	Alex Perez/Inertial Computing

Modified:
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/pmap.c
==============================================================================
--- head/sys/powerpc/booke/pmap.c	Sat Nov 21 02:49:33 2015	(r291121)
+++ head/sys/powerpc/booke/pmap.c	Sat Nov 21 06:03:46 2015	(r291122)
@@ -3298,7 +3298,7 @@ pmap_early_io_map(vm_paddr_t pa, vm_size
 			return (tlb1[i].virt + (pa - tlb1[i].phys));
 	}
 
-	pa_base = trunc_page(pa);
+	pa_base = rounddown(pa, PAGE_SIZE);
 	size = roundup(size + (pa - pa_base), PAGE_SIZE);
 	tlb1_map_base = roundup2(tlb1_map_base, 1 << (ilog2(size) & ~1));
 	va = tlb1_map_base + (pa - pa_base);


More information about the svn-src-head mailing list