]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Final fix for alignment issues with the page table first patched with
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>
Mon, 14 May 2018 04:00:52 +0000 (04:00 +0000)
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>
Mon, 14 May 2018 04:00:52 +0000 (04:00 +0000)
commitb00df92b1f395e41b2eac277a2b7096165c7be02
tree8b8611e4bd5c77c2b01af42d393642bed8e7627f
parent8fa7df36682f51fef0b1bf1248dff8d56a5dad27
Final fix for alignment issues with the page table first patched with
r333273 and partially reverted with r333594.

Older CPUs implement addition of offsets into the page table by a
bitwise OR rather than actual addition, which only works if the table is
aligned at a multiple of its own size (they also require it to be aligned
at a multiple of 256KB). Newer ones do not have that requirement, but it
hardly matters to enforce it anyway.

The original code was failing on newer systems with huge amounts of RAM
(> 512 GB), in which the page table was 4 GB in size. Because the
bootstrap memory allocator took its alignment parameter as an int, this
turned into a 0, removing any alignment constraint at all and making
the MMU fail. The first round of this patch (r333273) fixed this case by
aligning it at 256 KB, which broke older CPUs. Fix this instead by widening
the alignment parameter.
sys/powerpc/aim/mmu_oea64.c
sys/powerpc/aim/mmu_oea64.h
sys/powerpc/aim/moea64_native.c