| Design document | |
|---|---|
| Revision | v1 |
| Status | proposed |
PCI passthrough support
Introduction
GPU passthrough is already available in XAPI, this document proposes to also offer passthrough for all PCI devices through XAPI.
Design proposal
New methods for PCI object:
PCI.enable_dom0_accessPCI.disable_dom0_accessPCI.get_dom0_access_status: compares the outputs of/opt/xensource/libexec/xen-cmdlineand/proc/cmdlineto produce one of the four values that can be currently contained in thePGPU.dom0_accessfield:- disabled
- disabled_on_reboot
- enabled
- enabled_on_reboot
How do determine the expected dom0 access state: If the device id is present in both
pciback.hideof/proc/cmdlineandxen-cmdline:enabledIf the device id is present not in bothpciback.hideof/proc/cmdlineandxen-cmdline:disabledIf the device id is present in thepciback.hideof/proc/cmdlinebut not in the one ofxen-cmdline:disabled_on_rebootIf the device id is not present in thepciback.hideof/proc/cmdlinebut is in the one ofxen-cmdline:enabled_on_rebootA function rather than a field makes the data always accurate and even accounts for changes made by users outside XAPI, directly through
/opt/xensource/libexec/xen-cmdline
With these generic methods available, the following field and methods will be deprecated:
PGPU.enable_dom0_accessPGPU.disable_dom0_accessPGPU.dom0_access(DB field)
They would still be usable and up to date with the same info as for the PCI methods.
Test cases
hide a PCI:
- call
PCI.disable_dom0_accesson anenabledPCI - check the PCI goes in state
disabled_on_reboot - reboot the host
- check the PCI goes in state
disabled
- call
unhide a PCI:
- call
PCI.enable_dom0_accesson andisabledPCI - check the PCI goes in state
enabled_on_reboot - reboot the host
- check the PCI goes in state
enabled
- call
get a PCI dom0 access state:
- on a
enabledPCI, make sure theget_dom0_access_statusreturnsenabled - hide the PCI
- make sure the
get_dom0_access_statusreturnsdisabled_on_reboot - reboot
- make sure the
get_dom0_access_statusreturnsdisabled - unhide the PCI
- make sure the
get_dom0_access_statusreturnsenabled_on_reboot - reboot
- make sure the
get_dom0_access_statusreturnsenabled
- on a
Check PCI/PGPU dom0 access coherence:
- hide a PCI belonging to a PGPU and make sure both states remains coherent at every step
- unhide a PCI belonging to a PGPU and make sure both states remains coherent at every step
- hide a PGPU and make sure its and its PCI’s states remains coherent at every step
- unhide a PGPU and make sure its and its PCI’s states remains coherent at every step