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_access
PCI.disable_dom0_access
PCI.get_dom0_access_status
: compares the outputs of/opt/xensource/libexec/xen-cmdline
and/proc/cmdline
to produce one of the four values that can be currently contained in thePGPU.dom0_access
field:- 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.hide
of/proc/cmdline
andxen-cmdline
:enabled
If the device id is present not in bothpciback.hide
of/proc/cmdline
andxen-cmdline
:disabled
If the device id is present in thepciback.hide
of/proc/cmdline
but not in the one ofxen-cmdline
:disabled_on_reboot
If the device id is not present in thepciback.hide
of/proc/cmdline
but is in the one ofxen-cmdline
:enabled_on_reboot
A 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_access
PGPU.disable_dom0_access
PGPU.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_access
on anenabled
PCI - 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_access
on andisabled
PCI - 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
enabled
PCI, make sure theget_dom0_access_status
returnsenabled
- hide the PCI
- make sure the
get_dom0_access_status
returnsdisabled_on_reboot
- reboot
- make sure the
get_dom0_access_status
returnsdisabled
- unhide the PCI
- make sure the
get_dom0_access_status
returnsenabled_on_reboot
- reboot
- make sure the
get_dom0_access_status
returnsenabled
- 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