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)
Mar 9 2024, 12:58 AM
Unknown Object (File)
Feb 10 2024, 10:47 AM
Unknown Object (File)
Jan 31 2024, 12:45 PM
Unknown Object (File)
Jan 31 2024, 12:45 PM
Unknown Object (File)
Jan 14 2024, 7:07 AM
Unknown Object (File)
Dec 25 2023, 6:23 PM
Unknown Object (File)
Dec 22 2023, 9:05 PM
Unknown Object (File)
Dec 22 2023, 2:05 AM

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