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

2014-05-20 Thread Gavin Shan
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

[PATCH 2/4] powerpc/eeh: Flags for passed device and PE

2014-05-20 Thread Gavin Shan
The patch introduces new flags for EEH device and PE to indicate that the device or PE has been passed through to guest. In turn, we will deliver EEH errors to guest for further handling, which will be done in subsequent patches. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com ---

[PATCH 1/4] drivers/vfio: Introduce CONFIG_VFIO_PCI_EEH

2014-05-20 Thread Gavin Shan
The patch introduces CONFIG_VFIO_PCI_EEH for more IOCTL commands on VFIO PCI device support EEH funtionality for PCI devices that are passed through from host to guest. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- drivers/vfio/pci/Kconfig | 6 ++ 1 file changed, 6 insertions(+)

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

2014-05-20 Thread Gavin Shan
The patch adds new IOCTL command VFIO_EEH_OP to VFIO PCI device to support EEH functionality for PCI devices, which have been passed from host to guest via VFIO. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/Makefile | 1 +

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

2014-05-20 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 gws...@linux.vnet.ibm.com ---

[PATCH RFCv4 0/4] EEH Support for VFIO PCI device

2014-05-20 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

Re: [PATCH 6/6] KVM: PPC: Book3S PR: Expose TM registers

2014-05-20 Thread Paul Mackerras
On Mon, May 19, 2014 at 03:09:07PM +0200, Alexander Graf wrote: On 17.05.14 08:20, Paul Mackerras wrote: On Tue, Apr 29, 2014 at 06:17:42PM +0200, Alexander Graf wrote: POWER8 introduces transactional memory which brings along a number of new registers and MSR bits. Implementing all of

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

2014-05-20 Thread Alexander Graf
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

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

2014-05-20 Thread Alexander Graf
On 20.05.14 10:30, Gavin Shan wrote: The patch adds new IOCTL command VFIO_EEH_OP to VFIO PCI device to support EEH functionality for PCI devices, which have been passed from host to guest via VFIO. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com ---

Re: [PATCH 4/4] powerpc/eeh: Avoid event on passed PE

2014-05-20 Thread Alexander Graf
On 20.05.14 10:30, Gavin Shan wrote: 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:

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

2014-05-20 Thread Gavin Shan
On Tue, May 20, 2014 at 01:28:40PM +0200, Alexander Graf wrote: On 20.05.14 13:21, Alexander Graf wrote: On 20.05.14 10:30, Gavin Shan wrote: The patch adds new IOCTL command VFIO_EEH_OP to VFIO PCI device to support EEH functionality for PCI devices, which have been passed from host to guest

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

2014-05-20 Thread Alexander Graf
On 20.05.14 13:40, Gavin Shan wrote: On Tue, May 20, 2014 at 01:28:40PM +0200, Alexander Graf wrote: On 20.05.14 13:21, Alexander Graf wrote: On 20.05.14 10:30, Gavin Shan wrote: The patch adds new IOCTL command VFIO_EEH_OP to VFIO PCI device to support EEH functionality for PCI devices,

Re: [PATCH 6/6] KVM: PPC: Book3S PR: Expose TM registers

2014-05-20 Thread Alexander Graf
On 20.05.2014, at 11:59, Paul Mackerras pau...@samba.org wrote: On Mon, May 19, 2014 at 03:09:07PM +0200, Alexander Graf wrote: On 17.05.14 08:20, Paul Mackerras wrote: On Tue, Apr 29, 2014 at 06:17:42PM +0200, Alexander Graf wrote: POWER8 introduces transactional memory which brings along

Re: [PATCH 4/4] powerpc/eeh: Avoid event on passed PE

2014-05-20 Thread Gavin Shan
On Tue, May 20, 2014 at 01:25:11PM +0200, Alexander Graf wrote: On 20.05.14 10:30, Gavin Shan wrote: 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

Re: [PATCH 4/4] powerpc/eeh: Avoid event on passed PE

2014-05-20 Thread Alexander Graf
On 20.05.14 13:56, Gavin Shan wrote: On Tue, May 20, 2014 at 01:25:11PM +0200, Alexander Graf wrote: On 20.05.14 10:30, Gavin Shan wrote: 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

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

2014-05-20 Thread Gavin Shan
On Tue, May 20, 2014 at 01:44:21PM +0200, Alexander Graf wrote: On 20.05.14 13:40, Gavin Shan wrote: On Tue, May 20, 2014 at 01:28:40PM +0200, Alexander Graf wrote: On 20.05.14 13:21, Alexander Graf wrote: On 20.05.14 10:30, Gavin Shan wrote: The patch adds new IOCTL command VFIO_EEH_OP to VFIO

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

2014-05-20 Thread Alexander Graf
On 20.05.14 14:21, Gavin Shan wrote: On Tue, May 20, 2014 at 01:44:21PM +0200, Alexander Graf wrote: On 20.05.14 13:40, Gavin Shan wrote: On Tue, May 20, 2014 at 01:28:40PM +0200, Alexander Graf wrote: On 20.05.14 13:21, Alexander Graf wrote: On 20.05.14 10:30, Gavin Shan wrote: The patch

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

2014-05-20 Thread Gavin Shan
On Tue, May 20, 2014 at 02:25:45PM +0200, Alexander Graf wrote: On 20.05.14 14:21, Gavin Shan wrote: On Tue, May 20, 2014 at 01:44:21PM +0200, Alexander Graf wrote: On 20.05.14 13:40, Gavin Shan wrote: On Tue, May 20, 2014 at 01:28:40PM +0200, Alexander Graf wrote: On 20.05.14 13:21, Alexander

Re: [PATCH 4/4] powerpc/eeh: Avoid event on passed PE

2014-05-20 Thread Gavin Shan
On Tue, May 20, 2014 at 02:14:56PM +0200, Alexander Graf wrote: On 20.05.14 13:56, Gavin Shan wrote: On Tue, May 20, 2014 at 01:25:11PM +0200, Alexander Graf wrote: On 20.05.14 10:30, Gavin Shan wrote: If we detects frozen state on PE that has been passed to guest, we needn't handle it. Instead,

Re: [PATCH 4/4] powerpc/eeh: Avoid event on passed PE

2014-05-20 Thread Alexander Graf
On 20.05.14 14:45, Gavin Shan wrote: On Tue, May 20, 2014 at 02:14:56PM +0200, Alexander Graf wrote: On 20.05.14 13:56, Gavin Shan wrote: On Tue, May 20, 2014 at 01:25:11PM +0200, Alexander Graf wrote: On 20.05.14 10:30, Gavin Shan wrote: If we detects frozen state on PE that has been

Re: [PATCH 4/4] powerpc/eeh: Avoid event on passed PE

2014-05-20 Thread Benjamin Herrenschmidt
On Tue, 2014-05-20 at 21:56 +1000, Gavin Shan wrote: .../... I think what you want is an irqfd that the in-kernel eeh code notifies when it sees a failure. When such an fd exists, the kernel skips its own error handling. Yeah, it's a good idea and something for me to improve in phase

Re: [PATCH 4/4] powerpc/eeh: Avoid event on passed PE

2014-05-20 Thread Benjamin Herrenschmidt
On Tue, 2014-05-20 at 15:49 +0200, Alexander Graf wrote: Instead of if (passed_flag) return; you would do if (trigger_irqfd) { trigger_irqfd(); return; } which would be a much nicer, generic interface. But that's not how PAPR works. Cheers, Ben. -- To

Re: [PATCH 4/4] powerpc/eeh: Avoid event on passed PE

2014-05-20 Thread Benjamin Herrenschmidt
On Tue, 2014-05-20 at 15:49 +0200, Alexander Graf wrote: So how about we just implement this whole thing properly as irqfd? Whether QEMU can actually do anything with the interrupt is a different question - we can leave it be for now. But we could model all the code with the assumption that

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

2014-05-20 Thread Benjamin Herrenschmidt
On Tue, 2014-05-20 at 14:25 +0200, Alexander Graf wrote: - Move eeh-vfio.c to drivers/vfio/pci/ - From eeh-vfio.c, dereference arch/powerpc/kernel/eeh.c::eeh_ops, which is arch/powerpc/plaforms/powernv/eeh-powernv.c::powernv_eeh_ops. Call Hrm, I think it'd be nicer to just export

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

2014-05-20 Thread Benjamin Herrenschmidt
On Tue, 2014-05-20 at 22:39 +1000, Gavin Shan wrote: Yeah. How about this? :-) - Move eeh-vfio.c to drivers/vfio/pci/ - From eeh-vfio.c, dereference arch/powerpc/kernel/eeh.c::eeh_ops, which is arch/powerpc/plaforms/powernv/eeh-powernv.c::powernv_eeh_ops. Call Hrm, I think it'd be

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

2014-05-20 Thread Gavin Shan
On Wed, May 21, 2014 at 10:23:52AM +1000, Benjamin Herrenschmidt wrote: On Tue, 2014-05-20 at 22:39 +1000, Gavin Shan wrote: Yeah. How about this? :-) - Move eeh-vfio.c to drivers/vfio/pci/ - From eeh-vfio.c, dereference arch/powerpc/kernel/eeh.c::eeh_ops, which is

Re: [PATCH 4/4] powerpc/eeh: Avoid event on passed PE

2014-05-20 Thread Gavin Shan
On Wed, May 21, 2014 at 10:12:11AM +1000, Benjamin Herrenschmidt wrote: On Tue, 2014-05-20 at 21:56 +1000, Gavin Shan wrote: .../... I think what you want is an irqfd that the in-kernel eeh code notifies when it sees a failure. When such an fd exists, the kernel skips its own error handling.

[PATCH v5 0/4] EEH Support for VFIO PCI device

2014-05-20 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

[PATCH v5 3/4] drivers/vfio: EEH support for VFIO PCI device

2014-05-20 Thread Gavin Shan
The patch adds new IOCTL command VFIO_EEH_OP to VFIO PCI device to support EEH functionality for PCI devices, which have been passed from host to guest via VFIO. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- Documentation/vfio.txt | 6 +- arch/powerpc/include/asm/eeh.h | 10

[PATCH v5 2/4] powerpc/eeh: Flags for passed device and PE

2014-05-20 Thread Gavin Shan
The patch introduces new flags for EEH device and PE to indicate that the device or PE has been passed through to guest. In turn, we will deliver EEH errors to guest for further handling, which will be done in subsequent patches. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com ---

[PATCH v5 1/4] drivers/vfio: Introduce CONFIG_VFIO_PCI_EEH

2014-05-20 Thread Gavin Shan
The patch introduces CONFIG_VFIO_PCI_EEH for more IOCTL commands on VFIO PCI device support EEH funtionality for PCI devices that are passed through from host to guest. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- drivers/vfio/pci/Kconfig | 6 ++ 1 file changed, 6 insertions(+)