Re: [PATCH RFC v2 00/10] EEH Support for VFIO PCI devices on PowerKVM guest

2014-05-09 Thread Gavin Shan
On Fri, May 09, 2014 at 05:49:32PM +1000, Gavin Shan wrote: Sorry for having missed cc'ing Alex Graf. Amending it. >The series of patches intends to support EEH for PCI devices, which are >passed through to PowerKVM based guest via VFIO. The implementation is >straightforward based on the issues

[PATCH 09/10] powerpc/powernv: Implement ppc_call_opal()

2014-05-09 Thread Gavin Shan
If we're running PowerNV platform, ppc_firmware() will be directed to ppc_call_opal() where we can call to OPAL API accordingly. In ppc_call_opal(), the input argument are parsed out and call to appropriate OPAL API to handle that. Each request passed to the function is identified with token. As we

[PATCH 04/10] powerpc/eeh: Search EEH PE by guest address

2014-05-09 Thread Gavin Shan
The patch introduces function eeh_vfio_pe_get() to search the EEH PE according to its guest address, which is made up of PHB ID and PE configuration address. The function will be useful in backends for EEH RTAS emulation. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/eeh.h | 1 + arch/

[PATCH 10/10] powerpc/powernv: Error injection infrastructure

2014-05-09 Thread Gavin Shan
The patch intends to implemdent the error injection infrastructure for PowerNV platform. The predetermined handlers will be called according to the type of injected error (e.g. OpalErrinjctTypeIoaBusError). For now, we just support PCI error injection. We need support injecting other types of error

[PATCH 07/10] powerpc/powernv: Sync OPAL header file with firmware

2014-05-09 Thread Gavin Shan
The patch synchronizes OPAL header file with firmware so that the host kernel can make OPAL call to do error injection. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/opal.h| 65 ++ arch/powerpc/platforms/powernv/opal-wrappers.S | 1 + 2 files cha

[PATCH 08/10] powerpc: Extend syscall ppc_rtas()

2014-05-09 Thread Gavin Shan
Originally, syscall ppc_rtas() can be used to invoke RTAS call from user space. Utility "errinjct" is using it to inject various errors to the system for testing purpose. The patch intends to extend the syscall to support both pSeries and PowerNV platform. With that, RTAS and OPAL call can be invok

[PATCH 06/10] powerpc/eeh: Avoid event on passed PE

2014-05-09 Thread Gavin Shan
If we detects frozen state on PE that has been passed to guest, we needn't handle it. Instead, we rely on the guest to detect and recover it. The patch avoid EEH event on the frozen passed PE so that the guest can have chance to handle that. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/eeh.

[PATCH 05/10] drivers/vfio: New IOCTL command VFIO_EEH_INFO

2014-05-09 Thread Gavin Shan
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. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/Makefile | 1 + arch/powerpc/platforms/powernv/eeh-vfio.c | 584

[PATCH 02/10] powerpc/eeh: Info to trace passed devices

2014-05-09 Thread Gavin Shan
The address of passed PCI devices (domain:bus:slot:func) might be quite different from the perspective of host and guest. We have to trace the address mapping so that we can emulate EEH RTAS requests from guest. The patch introduces additional fields to eeh_pe and eeh_dev for the purpose. Signed-o

[PATCH 01/10] drivers/vfio: Introduce CONFIG_VFIO_EEH

2014-05-09 Thread Gavin Shan
The patch introduces CONFIG_VFIO_EEH for more IOCTL commands on tce_iommu_driver_ops to support EEH funtionality for PCI devices that are passed through from host to guest. Signed-off-by: Gavin Shan --- drivers/vfio/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/vfio/K

[PATCH 03/10] powerpc/eeh: Search EEH device by guest address

2014-05-09 Thread Gavin Shan
The patch introduces function eeh_vfio_dev_get() to search the EEH device according to its guest address, which is made up of PHB BUID, bus, slot and function number. The function is useful in the backends for EEH RTAS emulation. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/eeh.h | 5

[PATCH RFC v2 00/10] EEH Support for VFIO PCI devices on PowerKVM guest

2014-05-09 Thread Gavin Shan
The series of patches intends to support EEH for PCI devices, which are passed through to PowerKVM based guest via VFIO. The implementation is straightforward based on the issues or problems we have to resolve to support EEH for PowerKVM based guest. - Emulation for EEH RTAS requests. All EEH RTAS