Page MenuHomeFreeBSD

Implement pmap_copy() for arm64
ClosedPublic

Authored by alc on Jun 28 2019, 7:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 11 2024, 6:30 AM
Unknown Object (File)
Nov 10 2024, 2:34 AM
Unknown Object (File)
Oct 29 2024, 12:05 PM
Unknown Object (File)
Oct 23 2024, 5:54 PM
Unknown Object (File)
Sep 24 2024, 8:55 AM
Unknown Object (File)
Sep 18 2024, 4:14 AM
Unknown Object (File)
Sep 9 2024, 11:49 AM
Unknown Object (File)
Sep 2 2024, 8:17 AM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jun 28 2019, 11:44 AM
arm64/arm64/pmap.c
4011 ↗(On Diff #59148)

Is it possible to have dstmpte->wire_count > srcmpte->wire_count here?

arm64/arm64/pmap.c
4011 ↗(On Diff #59148)

You'll find the same test in the x86 pmap implementations, and it has existed since the Dyson era. I believe that the motivation for it is related to the earlier test

if (pmap_load(dst_pte) == 0 &&

Both of these tests only matter if pmap_copy() is used in places other than the implementation of fork, where we are starting with an empty destination pmap.
In conclusion, I believe that the point of this test is to avoid iterations that will do nothing because of the pmap_load(dst_pte) == 0 test.

arm64/arm64/pmap.c
4008 ↗(On Diff #59148)

Once upon a time, specifically, r15809, this goto did not exist, and so the below wired count check was the only way to exit the loop early.

arm64/arm64/pmap.c
4011 ↗(On Diff #59148)

Here is the real reason for having the wire count test. Suppose that we are asked to pmap_copy the address range "[a, b)" *and* the only valid mapping within that range is at address "a". After copying the mapping at address "a", the wire counts will be equal and this test will allow us to avoid wasting time looking at subsequent mappings that must be invalid.

Sync with https://reviews.freebsd.org/D20812, which applies a bunch of style fixes and one micro-optimization to the amd64 pmap_copy().

This revision now requires review to proceed.Jun 30 2019, 10:57 PM

A kernel with this change has survived multiple, back-to-back "make -j8 buildworld"'s with no spurious bus errors.

This revision is now accepted and ready to land.Jul 2 2019, 1:55 PM
arm64/arm64/pmap.c
3879 ↗(On Diff #59229)

Before I commit this, I'm going to remove the "XXX" here. To be clear, I'm keeping the sentence that follows, just removing the "XXX".