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)
Tue, Apr 23, 10:11 PM
Unknown Object (File)
Wed, Apr 10, 1:31 PM
Unknown Object (File)
Feb 1 2024, 8:17 AM
Unknown Object (File)
Jan 23 2024, 2:53 PM
Unknown Object (File)
Dec 20 2023, 6:33 AM
Unknown Object (File)
Nov 19 2023, 7:31 AM
Unknown Object (File)
Nov 11 2023, 12:28 AM
Unknown Object (File)
Nov 9 2023, 8:26 PM
Subscribers

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Jun 28 2019, 11:44 AM
arm64/arm64/pmap.c
4011

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

arm64/arm64/pmap.c
4011

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

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

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

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".