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)
Sun, Mar 31, 4:29 AM
Unknown Object (File)
Mar 7 2024, 4:09 PM
Unknown Object (File)
Feb 12 2024, 7:47 AM
Unknown Object (File)
Dec 30 2023, 6:25 AM
Unknown Object (File)
Dec 20 2023, 2:29 AM
Unknown Object (File)
Dec 12 2023, 11:31 PM
Unknown Object (File)
Nov 11 2023, 3:53 AM
Unknown Object (File)
Nov 7 2023, 9:16 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