Page MenuHomeFreeBSD

Leave ppt devices in the host domain when they are not attached to a VM.
ClosedPublic

Authored by jhb on Aug 26 2016, 9:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 9, 12:42 PM
Unknown Object (File)
Thu, Oct 2, 8:14 PM
Unknown Object (File)
Tue, Sep 30, 5:12 AM
Unknown Object (File)
Sep 12 2025, 4:21 AM
Unknown Object (File)
Aug 15 2025, 9:49 AM
Unknown Object (File)
Aug 8 2025, 9:08 AM
Unknown Object (File)
Aug 5 2025, 10:41 PM
Unknown Object (File)
Aug 4 2025, 6:21 PM
Subscribers

Details

Summary

Leave ppt devices in the host domain when they are not attached to a VM.

This allows a pass through device to be reset to a normal device driver
on the host and reused on the host. ppt devices are now always active in
some I/O MMU domain when the I/O MMU is active, either the host domain
or the domain of a VM they are attached to.

Test Plan
  • start a VM using device pass through and verify via dmardump that the device moves back to domain 1 after the VM shuts down. (Previously it just disappeared from the dump since the entry was disabled.)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb retitled this revision from to Move ppt devices back to the host domain when a VM shuts down..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: grehan.

FYI, I have moved this out to the ppt driver due to other changes I have in flight. Will update once I have tested the new version, but you can ignore this for now until I upload the next version.

  • Place all PCI devices in the host domain during initialization.
  • Change ppt to move devices into the host domain instead of removing them.
  • Remove device before adding it to the host domain.
  • Remove device from host domain before adding it to the VM domain.
jhb retitled this revision from Move ppt devices back to the host domain when a VM shuts down. to Leave ppt devices in the host domain when they are not attached to a VM..Aug 27 2016, 12:41 AM
jhb updated this object.

Another approach perhaps would be to fix iommu_add_device() to permit "moving" a device between domains. I think this mostly just means removing the explicit panic from vtd_add_device() (though perhaps there are other gotchas there I am not aware of?). If we go that route, I would remove the calls to iommu_remove_device() from ppt.c.

This revision was automatically updated to reflect the committed changes.