Page MenuHomeFreeBSD

arm64 pmap: do not panic on inability to insert ptp into trie
ClosedPublic

Authored by alc on Jul 9 2025, 7:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 1:20 AM
Unknown Object (File)
Sun, Oct 12, 1:20 AM
Unknown Object (File)
Sat, Oct 11, 3:50 PM
Unknown Object (File)
Sat, Oct 11, 3:50 PM
Unknown Object (File)
Sat, Oct 11, 3:50 PM
Unknown Object (File)
Sat, Oct 11, 3:50 PM
Unknown Object (File)
Sat, Oct 11, 3:50 PM
Unknown Object (File)
Sat, Oct 11, 7:20 AM
Subscribers

Diff Detail

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

Event Timeline

alc requested review of this revision.Jul 9 2025, 7:38 AM
sys/arm64/arm64/pmap.c
5772–5775

There is no need for

if (l2pg != NULL)
        l2pg->ref_count--;

here because this is the kernel pmap. A similar if statement could be eliminated from the amd64 version.

5775–5776

I could eliminate these two lines because !remove_pt does not (temporarily) map the page table page.

Rename remove_pt to demote_kl2e to better reflect what it controls.

Convert a panic to a KASSERT.

Deindent some code.

Do you have some local modifications to test the ADDR_IS_KERNEL(va) code path in pmap_enter_l2()?

sys/arm64/arm64/pmap.c
5777

Maybe, "kernel L3 page table page" to be a bit more precise?

This revision is now accepted and ready to land.Jul 11 2025, 1:06 PM
alc marked an inline comment as done.Jul 12 2025, 5:41 PM

I think a more elaborate commit message would be helpful.

See inline comment for an explanation.

This revision now requires review to proceed.Jul 12 2025, 9:27 PM

Do you have some local modifications to test the ADDR_IS_KERNEL(va) code path in pmap_enter_l2()?

Yes, I have a debug sysctl procedure that tests this code path.

sys/arm64/arm64/pmap.c
5790–5791

While these operations are no longer needed when we perform pmap_remove_l2(), they are still needed after pmap_remove_l3_range() because it doesn't unmap the L3 PTP.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 13 2025, 5:09 PM
This revision was automatically updated to reflect the committed changes.