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
F105832402: D7666.diff
Sat, Dec 21, 10:01 AM
Unknown Object (File)
Thu, Dec 12, 3:56 AM
Unknown Object (File)
Sun, Dec 1, 10:13 PM
Unknown Object (File)
Nov 1 2024, 12:59 PM
Unknown Object (File)
Oct 31 2024, 12:33 PM
Unknown Object (File)
Oct 17 2024, 11:17 AM
Unknown Object (File)
Oct 14 2024, 3:32 PM
Unknown Object (File)
Oct 5 2024, 8:48 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 Passed
Unit
No Test Coverage
Build Status
Buildable 5002
Build 5069: arc lint + arc unit

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.