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)
Mon, Apr 22, 12:50 PM
Unknown Object (File)
Mon, Apr 22, 12:49 PM
Unknown Object (File)
Sat, Mar 30, 1:35 PM
Unknown Object (File)
Mar 16 2024, 3:48 PM
Unknown Object (File)
Mar 16 2024, 3:48 PM
Unknown Object (File)
Mar 16 2024, 3:48 PM
Unknown Object (File)
Mar 15 2024, 2:37 PM
Unknown Object (File)
Mar 15 2024, 2:37 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.