Page MenuHomeFreeBSD

Refine the fix from r312954; add a PG_PROMOTED flag for marking promoted PDEs
ClosedPublic

Authored by alc on Feb 18 2017, 7:39 PM.

Details

Summary

Mark promoted PDEs with the new PG_PROMOTED flag so that the amd64 pmap knows whether lingering 4K page mappings need to be flushed on a PDE change that restricts or destroys the mapping. This allows the amd64 pmap to avoid unnecessary and costly range invalidations.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alc updated this revision to Diff 25361.Feb 18 2017, 7:39 PM
alc retitled this revision from to Refine the fix from r312954; add a PG_PROMOTED flag for marking promoted PDEs.
alc updated this object.
alc edited the test plan for this revision. (Show Details)
alc added reviewers: kib, markj.
kib accepted this revision.Feb 18 2017, 9:03 PM
kib edited edge metadata.
This revision is now accepted and ready to land.Feb 18 2017, 9:03 PM
markj accepted this revision.Feb 18 2017, 10:42 PM
markj edited edge metadata.
markj added inline comments.
amd64/amd64/pmap.c
1858 ↗(On Diff #25361)

Is it worth asserting !workaround_erratum383 if PG_PROMOTED is set?

alc added inline comments.Feb 18 2017, 11:26 PM
amd64/amd64/pmap.c
1858 ↗(On Diff #25361)

There are 2M page mappings that are not the result of promotion, e.g., pmap_enter_pde() and an upcoming patch that adds support for "psind == 1" to pmap_enter(). That said, the bug fixed by r312954 involved PG_G mappings and currently pmap_enter_pde() never creates PG_G mappings, so we would not yet call this function on anything but a promoted mapping. However, that is going to change before too long.

alc updated this revision to Diff 25393.Feb 19 2017, 8:14 PM
alc edited edge metadata.

Apply similar changes to the i386 pmap. There PG_AVAIL3 is unused, and we don't support EPT, so there is no potential conflict from using PG_AVAIL3.

Tweak the "spelling" in some comments for consistency with other parts of the amd64/i386 pmap.

This revision now requires review to proceed.Feb 19 2017, 8:14 PM
kib accepted this revision.Feb 19 2017, 8:31 PM
kib edited edge metadata.
This revision is now accepted and ready to land.Feb 19 2017, 8:31 PM
markj accepted this revision.Feb 19 2017, 11:20 PM
markj edited edge metadata.
alc added a comment.Feb 19 2017, 11:50 PM

I'm going to add the comment "PDE only" where I define PG_PROMOTED in pmap.h.

This revision was automatically updated to reflect the committed changes.