[PATCH 3/8] drivers/vfio: New IOCTL command VFIO_EEH_INFO

Gavin Shan gwshan at linux.vnet.ibm.com
Tue May 20 20:23:20 EST 2014


On Tue, May 20, 2014 at 12:02:22PM +0200, Alexander Graf wrote:
>
>On 20.05.14 10:28, Gavin Shan wrote:
>>On Mon, May 19, 2014 at 06:37:24PM -0600, Alex Williamson wrote:
>>>On Tue, 2014-05-20 at 10:22 +1000, Gavin Shan wrote:
>>>>On Mon, May 19, 2014 at 04:33:10PM -0600, Alex Williamson wrote:
>>>>>On Wed, 2014-05-14 at 14:11 +1000, Gavin Shan wrote:
>>>>>>The patch adds new IOCTL command VFIO_EEH_INFO to VFIO container
>>>>>>to support EEH functionality for PCI devices, which have been
>>>>>>passed from host to guest via VFIO.
>
>[...]
>
>>>>diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
>>>>index cb9023d..1fd1bfb 100644
>>>>--- a/include/uapi/linux/vfio.h
>>>>+++ b/include/uapi/linux/vfio.h
>>>>@@ -455,6 +455,63 @@ struct vfio_iommu_spapr_tce_info {
>>>>  #define VFIO_IOMMU_SPAPR_TCE_GET_INFO	_IO(VFIO_TYPE, VFIO_BASE + 12)
>>>>+/*
>>>>+ * The VFIO EEH info struct provides way to support EEH functionality
>>>>+ * for PCI device that is passed from host to guest via VFIO.
>>>>+ */
>>>>+#define VFIO_EEH_OP_MAP		0
>>>>+#define VFIO_EEH_OP_UNMAP	1
>>>>+#define VFIO_EEH_OP_SET_OPTION	2
>>>>+#define VFIO_EEH_OP_GET_ADDR	3
>>>>+#define VFIO_EEH_OP_GET_STATE	4
>>>>+#define VFIO_EEH_OP_PE_RESET	5
>>>>+#define VFIO_EEH_OP_PE_CONFIG	6
>>>>>Is this really an "info" ioctl?
>>>>>
>>>>Yeah, "VFIO_EEH_INFO" isn't a good name. How about to have "VFIO_EEH_HANDLER" ?
>>>VFIO_EEH_OP perhaps.  Thanks,
>>>
>>Ok. Will rename it to VFIO_EEH_OP in next revision.
>
>Is there any benefit of a multiplexing EEH ioctl over just 7
>individual ioctls?
>

One benefit is pass one data struct to the real handler implemented
in arch/powerpc/platforms/powernv/eeh-vfio.c. With 7 commands, we
either passing "void *arg" + "command" to the handler, or export
7 functions with EXPORT_SYMBOL_GPL().

I just send RFCv4 out. VFIO_EEH_OP_{MAP, UNMAP} is removed there.

Thanks,
Gavin



More information about the Linuxppc-dev mailing list