Page MenuHomeFreeBSD

vmm iommu: stop transiently wiring already wired pages
ClosedPublic

Authored by kib on Dec 21 2023, 12:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 6:06 PM
Unknown Object (File)
Oct 7 2024, 10:44 AM
Unknown Object (File)
Sep 26 2024, 11:24 PM
Unknown Object (File)
Sep 26 2024, 11:23 PM
Unknown Object (File)
Sep 25 2024, 9:57 AM
Unknown Object (File)
Sep 25 2024, 5:03 AM
Unknown Object (File)
Sep 24 2024, 7:12 PM
Unknown Object (File)
Sep 24 2024, 6:18 PM

Details

Summary
vmm_iommu_modify(): split vm_iommu_map()/unmap() into separate functions
vm_iommu_map()/unmap(): stop transiently wiring already wired pages

Namely, switch from vm_fault_quick_hold() to pmap_extract() KPI to
translate gpa to hpa. Assert that the looked up hpa belongs to the wired
page, as it should be for the VM which is configured for pass-throu
(this is theoretically a restriction that could be removed on newer
DMARs).

Diff Detail

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

Event Timeline

kib requested review of this revision.Dec 21 2023, 12:20 AM

There are rare cases where a wired map entry might not be resident in the pmap, e.g., if someone applied mprotect(PROT_NONE) to the mapping. Here the guest vmspace is managed by vmm so we are unlikely to hit such edge cases, but it might be worth explaining in a comment why exactly we expect pmap_extract() to succeed.

This revision is now accepted and ready to land.Dec 21 2023, 4:19 PM
This revision now requires review to proceed.Dec 21 2023, 4:39 PM
This revision is now accepted and ready to land.Dec 21 2023, 4:41 PM
jhb added inline comments.
sys/amd64/vmm/vmm.c
1107

This is only used for the KASSERT AFAICT?

Eliminate the hpa variable in vm_iommu_unmap()

This revision now requires review to proceed.Dec 21 2023, 6:41 PM
This revision is now accepted and ready to land.Dec 21 2023, 6:54 PM