Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Jan 2020 01:22:55 +0000 (UTC)
From:      Brandon Bergren <bdragon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r356857 - head/sys/powerpc/booke
Message-ID:  <202001180122.00I1MtF9059964@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdragon
Date: Sat Jan 18 01:22:54 2020
New Revision: 356857
URL: https://svnweb.freebsd.org/changeset/base/356857

Log:
  [PowerPC] Fix Book-E direct map for >=16G ram on e5500
  
  It turns out the maximum TLB1 page size on e5500 is 4G, despite the format
  being defined for up to 1TB.
  
  So, we need to clamp the DMAP TLB1 entries to not attempt to create 16G or
  larger entries.
  
  Fixes boot on my X5000 in which I just installed 16G of RAM.
  
  Reviewed by:	jhibbits
  Sponsored by:	Tag1 Consulting, Inc.
  Differential Revision:	https://reviews.freebsd.org/D23244

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

Modified: head/sys/powerpc/booke/pmap.c
==============================================================================
--- head/sys/powerpc/booke/pmap.c	Fri Jan 17 23:41:35 2020	(r356856)
+++ head/sys/powerpc/booke/pmap.c	Sat Jan 18 01:22:54 2020	(r356857)
@@ -4028,7 +4028,22 @@ tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_si
 				sz >>= 2;
 			} while (va % sz != 0);
 		}
-		/* Now align from there to VA */
+#ifdef __powerpc64__
+		/*
+		 * Clamp TLB1 entries to 4G.
+		 *
+		 * While the e6500 supports up to 1TB mappings, the e5500
+		 * only supports up to 4G mappings. (0b1011)
+		 *
+		 * If any e6500 machines capable of supporting a very
+		 * large amount of memory appear in the future, we can
+		 * revisit this.
+		 *
+		 * For now, though, since we have plenty of space in TLB1,
+		 * always avoid creating entries larger than 4GB.
+		 */
+		sz = MIN(sz, 1UL << 32);
+#endif
 		if (bootverbose)
 			printf("Wiring VA=%p to PA=%jx (size=%lx)\n",
 			    (void *)va, (uintmax_t)pa, (long)sz);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001180122.00I1MtF9059964>