[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
This commit is contained in:
Brandon Bergren 2020-01-18 01:22:54 +00:00
parent eabe020579
commit 432ff6eead
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356857

View File

@ -4028,7 +4028,22 @@ tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_size_t size, int wimge)
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);