Page MenuHomeFreeBSD

arm64: Use the right PTE when downgrading perms in pmap_promote_l2()
ClosedPublic

Authored by markj on Jun 4 2021, 6:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 14 2024, 5:37 PM
Unknown Object (File)
Oct 4 2024, 2:58 PM
Unknown Object (File)
Oct 4 2024, 12:20 PM
Unknown Object (File)
Oct 3 2024, 9:44 PM
Unknown Object (File)
Oct 1 2024, 11:21 PM
Unknown Object (File)
Sep 30 2024, 12:06 AM
Unknown Object (File)
Sep 29 2024, 3:57 PM
Unknown Object (File)
Sep 28 2024, 1:30 PM
Subscribers

Details

Summary

When promoting a run of small mappings to a superpage, we have to
downgrade clean, writable mappings to read-only, to handle the
possibility that the MMU will concurrently mark one of the mappings as
dirty.

The code which performed this operation for the first PTE in the run
used the wrong PTE pointer. As a result, the comparison would always
fail, aborting the promotion. This only occurs when promoting writable,
clean mappings.

Fixes: ca2cae0b4dd
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Jun 4 2021, 6:20 PM
This revision is now accepted and ready to land.Jun 4 2021, 7:07 PM

BTW, I did some buildkernel tests on a graviton instance and found no change in the number of promotions during a buildkernel. I can't think of any non-synthetic workloads that are likely to be affected in light of the fact that arm64 implements pmap_enter(psind=1), so faults on a shared mapping skip the promotion step, assuming that some entity triggered the initial promotion through writes.

As an aside, I would probably replicate the amd64 comments that we do not need to perform a TLB invalidation in this case.

Add comments to pmap_promote_l2() noting that we do not invalidate the TLB.

This revision now requires review to proceed.Jun 6 2021, 4:24 PM
This revision is now accepted and ready to land.Jun 6 2021, 6:15 PM