Page MenuHomeFreeBSD

powerpc_mmu_radix: add leaf page for wired mappings when pmap_enter(psind=1)
ClosedPublic

Authored by rew on Jan 5 2024, 10:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 5:46 PM
Unknown Object (File)
Mon, Oct 28, 9:41 PM
Unknown Object (File)
Oct 4 2024, 6:18 AM
Unknown Object (File)
Oct 3 2024, 3:02 PM
Unknown Object (File)
Oct 2 2024, 6:29 AM
Unknown Object (File)
Sep 29 2024, 6:25 PM
Unknown Object (File)
Sep 19 2024, 11:59 PM
Unknown Object (File)
Sep 18 2024, 1:06 AM
Subscribers

Details

Summary

This applies the fix to powerpc's pmap as was done in commit aa3bcaad51076ceb
and d0941ed9b5c39d92 for amd64 and riscv pmaps, respectively.

Reported by: Jenkins
Fixes: e4078494f344bcba8709216bd601efa3dd05f6b3

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 55267
Build 52156: arc lint + arc unit

Event Timeline

rew requested review of this revision.Jan 5 2024, 10:49 PM

Thank you! I didn't know that this pmap implemented support for pmap_enter(psind=1).

sys/powerpc/aim/mmu_radix.c
4970

Is this part of the change intentional? I don't think it's right. This pmap doesn't use the valid field to store state; its use in other pmaps is a relatively new change.

Aside from the issue @markj pointed out, LGTM.

This revision is now accepted and ready to land.Jan 6 2024, 4:33 PM
sys/powerpc/aim/mmu_radix.c
4970

It was - after reading through the code and git log a bit more, I can see that it is wrong.

The issue I ran into was initializing the ref_count with the correct value when the leaf page is added. Setting the ref_count to 1 would fix the reported panic but would hit a KASSERT() in a different test when trying to unmap a superpage with ref_count == 1.

The two ideas I thought of was to relax the KASSERT() for ref_count == 1 or set ref_count = NPTEPG and the fill the leaf page with mappings when the page is allocated. I'll update this revision to illustrate the latter.

  • drop vm_page_all_valid() change
  • fill added leaf page with mappings
This revision now requires review to proceed.Jan 8 2024, 9:58 AM
markj added inline comments.
sys/powerpc/aim/mmu_radix.c
3258

I think this line is too long.

4970

I see now, thank you. I think your approach is ok. During demotion, we'll update the attributes in the cached page table page if necessary.

This revision is now accepted and ready to land.Jan 8 2024, 5:46 PM