aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2014-06-09 21:41:57 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-08-05 01:28:48 -0400
commit1b69be5e8afc634f39ad695a6ab6aad0cf0975c7 (patch)
treef87cc5eae17311b309c7498ce063eb33cc028fc3 /include/uapi/linux
parent212d16cdca2d0f7708c9c1d284a845c22bfc90c4 (diff)
drivers/vfio: EEH support for VFIO PCI device
The patch adds new IOCTL commands for sPAPR VFIO container device to support EEH functionality for PCI devices, which have been passed through from host to somebody else via VFIO. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Acked-by: Alexander Graf <agraf@suse.de> Acked-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/vfio.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index cb9023d4f063..6612974c64bf 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -30,6 +30,9 @@
30 */ 30 */
31#define VFIO_DMA_CC_IOMMU 4 31#define VFIO_DMA_CC_IOMMU 4
32 32
33/* Check if EEH is supported */
34#define VFIO_EEH 5
35
33/* 36/*
34 * The IOCTL interface is designed for extensibility by embedding the 37 * The IOCTL interface is designed for extensibility by embedding the
35 * structure length (argsz) and flags into structures passed between 38 * structure length (argsz) and flags into structures passed between
@@ -455,6 +458,37 @@ struct vfio_iommu_spapr_tce_info {
455 458
456#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) 459#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
457 460
461/*
462 * EEH PE operation struct provides ways to:
463 * - enable/disable EEH functionality;
464 * - unfreeze IO/DMA for frozen PE;
465 * - read PE state;
466 * - reset PE;
467 * - configure PE.
468 */
469struct vfio_eeh_pe_op {
470 __u32 argsz;
471 __u32 flags;
472 __u32 op;
473};
474
475#define VFIO_EEH_PE_DISABLE 0 /* Disable EEH functionality */
476#define VFIO_EEH_PE_ENABLE 1 /* Enable EEH functionality */
477#define VFIO_EEH_PE_UNFREEZE_IO 2 /* Enable IO for frozen PE */
478#define VFIO_EEH_PE_UNFREEZE_DMA 3 /* Enable DMA for frozen PE */
479#define VFIO_EEH_PE_GET_STATE 4 /* PE state retrieval */
480#define VFIO_EEH_PE_STATE_NORMAL 0 /* PE in functional state */
481#define VFIO_EEH_PE_STATE_RESET 1 /* PE reset in progress */
482#define VFIO_EEH_PE_STATE_STOPPED 2 /* Stopped DMA and IO */
483#define VFIO_EEH_PE_STATE_STOPPED_DMA 4 /* Stopped DMA only */
484#define VFIO_EEH_PE_STATE_UNAVAIL 5 /* State unavailable */
485#define VFIO_EEH_PE_RESET_DEACTIVATE 5 /* Deassert PE reset */
486#define VFIO_EEH_PE_RESET_HOT 6 /* Assert hot reset */
487#define VFIO_EEH_PE_RESET_FUNDAMENTAL 7 /* Assert fundamental reset */
488#define VFIO_EEH_PE_CONFIGURE 8 /* PE configuration */
489
490#define VFIO_EEH_PE_OP _IO(VFIO_TYPE, VFIO_BASE + 21)
491
458/* ***************************************************************** */ 492/* ***************************************************************** */
459 493
460#endif /* _UAPIVFIO_H */ 494#endif /* _UAPIVFIO_H */