Page MenuHomeFreeBSD

Fix MIPS pmap_align_superpage() function to use superpage rather than segment alignment
AcceptedPublic

Authored by rwatson on Mar 12 2016, 8:35 PM.

Details

Reviewers
adrian
sson
Group Reviewers
MIPS
Summary

When attempting to satisfy mmap() requests for superpage alignment on 64-bit MIPS, use superpage rather than physical-segment constants, or we may improperly fail to apply suitable alignment -- yet still allow mmap() to appear to succeed.

Test Plan

Tested on 64-bit MIPS BERI, but not on 32-bit MIPS. This patch includes the change required for the new 64-bit MIPS pmap, but if committed now would be applied only to the current pmap.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

rwatson updated this revision to Diff 14285.Mar 12 2016, 8:35 PM
rwatson retitled this revision from to Fix MIPS pmap_align_superpage() function to use superpage rather than segment alignment.
rwatson updated this object.
rwatson edited the test plan for this revision. (Show Details)
rwatson added reviewers: MIPS, sson.
rwatson set the repository for this revision to rS FreeBSD src repository.
rwatson added a project: MIPS.
sson edited edge metadata.Mar 13 2016, 6:05 PM

Yes, the superpage size should be 2M (PDRSIZE) for mips64. This looks correct. I am not sure it matters for mips32 given there is no superpage support for it yet. The way it is done for mips64 (see https://reviews.freebsd.org/D2535 ) may not work for mips32 given the limited number of available PTE bits. Of course, the mips64 superpage implementation was designed to support multiple superpage sizes (more than just 2M) although only one superpage size is currently implemented. I imagine with mips32 only one superpage size would be supported.

adrian accepted this revision.Sep 20 2016, 4:12 PM
adrian added a reviewer: adrian.
adrian added a subscriber: adrian.

looks good then!

This revision is now accepted and ready to land.Sep 20 2016, 4:12 PM