Page MenuHomeFreeBSD

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

Authored by markj on Fri, Jun 4, 6:20 PM.



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

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

R10 FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markj requested review of this revision.Fri, Jun 4, 6:20 PM
This revision is now accepted and ready to land.Fri, Jun 4, 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.Sun, Jun 6, 4:24 PM
This revision is now accepted and ready to land.Sun, Jun 6, 6:15 PM