Re: [PATCH 0/2] VFIO: Accept IOMMU group (PE) ID

2015-09-22 Thread Gavin Shan
On Mon, Sep 21, 2015 at 11:42:28AM +1000, David Gibson wrote: >On Sat, Sep 19, 2015 at 04:22:47PM +1000, David Gibson wrote: >> On Fri, Sep 18, 2015 at 09:47:32AM -0600, Alex Williamson wrote: >> > On Fri, 2015-09-18 at 16:24 +1000, Gavin Shan wrote: >> > > This al

Re: [PATCH 0/2] VFIO: Accept IOMMU group (PE) ID

2015-09-21 Thread Gavin Shan
On Mon, Sep 21, 2015 at 11:42:28AM +1000, David Gibson wrote: >On Sat, Sep 19, 2015 at 04:22:47PM +1000, David Gibson wrote: >> On Fri, Sep 18, 2015 at 09:47:32AM -0600, Alex Williamson wrote: >> > On Fri, 2015-09-18 at 16:24 +1000, Gavin Shan wrote: >> > > This al

[PATCH 1/2] drivers/vfio: Support EEH API revision

2015-09-18 Thread Gavin Shan
This extends the return value from container's IOCTL command (VFIO_CHECK_EXTENSION + VFIO_EEH) to EEH API revision. Also, extra check is applied to return -ENOTTY if EEH functionality is disabled in vfio_spapr_iommu_eeh_ioctl(). Signed-off-by: Gavin Shan <gws...@linux.vnet.ibm.com> --- d

[PATCH 2/2] drivers/vfio: Support IOMMU group for EEH operations

2015-09-18 Thread Gavin Shan
cify IOMMU group (PE) ID when requesting EEH operation. Signed-off-by: Gavin Shan <gws...@linux.vnet.ibm.com> --- drivers/vfio/vfio_iommu_spapr_tce.c | 51 - drivers/vfio/vfio_spapr_eeh.c | 39 include/linux/vfio.h

Re: [PATCH v1 2/3] powerpc/powernv: Support PCI error injection

2014-07-21 Thread Gavin Shan
On Tue, Jul 22, 2014 at 11:10:42AM +0800, Mike Qiu wrote: On 07/22/2014 06:49 AM, Benjamin Herrenschmidt wrote: On Mon, 2014-07-21 at 16:06 +0800, Mike Qiu wrote: I don't like this. I much prefer have dedicated error injection files in their respective locations, something for PCI under the

Re: [PATCH] Bugfix: powerpc/eeh: Create eeh sysfs entry in post_init()

2014-06-25 Thread Gavin Shan
On Wed, Jun 25, 2014 at 02:23:53PM +0800, Wei Yang wrote: On Wed, Jun 25, 2014 at 03:33:12PM +1000, Gavin Shan wrote: On Tue, Jun 24, 2014 at 11:32:07PM -0400, Mike Qiu wrote: [ cc Richard ] Eeh sysfs entry created must be after EEH_ENABLED been set in eeh_subsystem_flags. In PowerNV platform

Re: [PATCH v1 2/3] powerpc/powernv: Support PCI error injection

2014-06-24 Thread Gavin Shan
On Tue, Jun 24, 2014 at 05:00:52PM +1000, Benjamin Herrenschmidt wrote: On Tue, 2014-06-24 at 14:57 +0800, Mike Qiu wrote: Is that mean *host* side error injection should base on CONFIG_IOMMU_API ? If it is just host side(no guest, no pass through), can't we do error inject? Maybe I

Re: [PATCH v1 2/3] powerpc/powernv: Support PCI error injection

2014-06-24 Thread Gavin Shan
On Mon, Jun 23, 2014 at 04:36:44PM +1000, Michael Neuling wrote: On Mon, 2014-06-23 at 12:14 +1000, Gavin Shan wrote: The patch implements one OPAL firmware sysfs file to support PCI error injection: /sys/firmware/opal/errinjct, which will be used like the way described as follows. According

Re: [PATCH] Bugfix: powerpc/eeh: Create eeh sysfs entry in post_init()

2014-06-24 Thread Gavin Shan
On Tue, Jun 24, 2014 at 11:32:07PM -0400, Mike Qiu wrote: [ cc Richard ] Eeh sysfs entry created must be after EEH_ENABLED been set in eeh_subsystem_flags. In PowerNV platform, it try to create sysfs entry before EEH_ENABLED been set, when boot up. So nothing will be created for eeh in sysfs.

Re: [PATCH v1 1/3] powerpc/powernv: Sync header with firmware

2014-06-23 Thread Gavin Shan
On Tue, Jun 24, 2014 at 07:10:14AM +1000, Benjamin Herrenschmidt wrote: On Mon, 2014-06-23 at 12:14 +1000, Gavin Shan wrote: The patch synchronizes firmware header file (opal.h) for PCI error injection The FW API you expose is not PCI specific. I haven't seen the corresponding FW patches yet

[PATCH v1 2/3] powerpc/powernv: Support PCI error injection

2014-06-22 Thread Gavin Shan
:addr:mask:iommu_group_id:function. The above 7 and 8 represent 32-bits and 64-bits PCI error seperately and function is one of the specific PCI errors (e.g. MMIO access address parity error), which are defined by PAPR spec. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include

[PATCH v1 3/3] powerpc/powernv: Clear PAPR error injection registers

2014-06-22 Thread Gavin Shan
of Firebird-L. So we have to clear them before doing PE reset to avoid recursive EEH errors at recovery stage. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/eeh-ioda.c | 24 1 file changed, 24 insertions(+) diff --git a/arch/powerpc

[PATCH v1 1/3] powerpc/powernv: Sync header with firmware

2014-06-22 Thread Gavin Shan
The patch synchronizes firmware header file (opal.h) for PCI error injection. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/opal.h| 65 ++ arch/powerpc/platforms/powernv/opal-wrappers.S | 1 + 2 files changed, 66

[PATCH v1 0/3] Support PCI Error Injection

2014-06-22 Thread Gavin Shan
and ibm,close-errinjct won't be handled by host kernel and applications have full freedom to implement logic of themselves for them. Gavin Shan (3): powerpc/powernv: Sync header with firmware powerpc/powernv: Support PCI error injection powerpc/powernv: Clear PAPR error injection registers arch

Re: [PATCH v9 3/3] drivers/vfio: EEH support for VFIO PCI device

2014-06-09 Thread Gavin Shan
On Fri, Jun 06, 2014 at 12:20:04PM -0600, Alex Williamson wrote: On Fri, 2014-06-06 at 15:00 +1000, Gavin Shan wrote: 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

[PATCH v10 1/3] powerpc/eeh: Avoid event on passed PE

2014-06-09 Thread Gavin Shan
We must not handle EEH error on devices which are passed to somebody else. Instead, we expect that the frozen device owner detects an EEH error and recovers from it. This avoids EEH error handling on passed through devices so the device owner gets a chance to handle them. Signed-off-by: Gavin

[PATCH v10 2/3] powerpc/eeh: EEH support for VFIO PCI device

2014-06-09 Thread Gavin Shan
The patch exports functions to be used by new VFIO ioctl command, which will be introduced in subsequent patch, to support EEH functinality for VFIO PCI devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com Acked-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/eeh.h | 12

[PATCH v10 0/3] EEH Support for VFIO PCI Device

2014-06-09 Thread Gavin Shan
/vfio_spapr_eeh.c * Define inline PE state for VFIO_EEH_PE_GET_STATE. v9 - v10: * Make sure we have zero struct vfio_eeh_pe_op::flags Gavin Shan (3): powerpc/eeh: Avoid event on passed PE powerpc/eeh: EEH support for VFIO PCI device drivers/vfio: EEH support for VFIO PCI

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

2014-06-09 Thread Gavin Shan
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 gws...@linux.vnet.ibm.com Acked-by: Alexander Graf ag...@suse.de --- Documentation

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

2014-06-05 Thread Gavin Shan
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 gws...@linux.vnet.ibm.com --- Documentation/vfio.txt | 87

[PATCH v8 1/3] powerpc/eeh: Avoid event on passed PE

2014-06-05 Thread Gavin Shan
We must not handle EEH error on devices which are passed to somebody else. Instead, we expect that the frozen device owner detects an EEH error and recovers from it. This avoids EEH error handling on passed through devices so the device owner gets a chance to handle them. Signed-off-by: Gavin

[PATCH v8 0/3] EEH Support for VFIO PCI Device

2014-06-05 Thread Gavin Shan
various comments from internal reviews by Alexey. Thanks to Alexey. Gavin Shan (3): powerpc/eeh: Avoid event on passed PE powerpc/eeh: EEH support for VFIO PCI device drivers/vfio: EEH support for VFIO PCI device Documentation/vfio.txt| 87 +- arch/powerpc

[PATCH v8 2/3] powerpc/eeh: EEH support for VFIO PCI device

2014-06-05 Thread Gavin Shan
The patch exports functions to be used by new VFIO ioctl command, which will be introduced in subsequent patch, to support EEH functinality for VFIO PCI devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/eeh.h | 14 +++ arch/powerpc/kernel/eeh.c | 268

Re: [PATCH v8 2/3] powerpc/eeh: EEH support for VFIO PCI device

2014-06-05 Thread Gavin Shan
On Thu, Jun 05, 2014 at 04:50:04PM +1000, Benjamin Herrenschmidt wrote: On Thu, 2014-06-05 at 16:36 +1000, Gavin Shan wrote: +#define EEH_OPT_GET_PE_ADDR0 /* Get PE addr */ +#define EEH_OPT_GET_PE_MODE1 /* Get PE mode */ I assume that's just some leftover from the previous

Re: [PATCH v8 3/3] drivers/vfio: EEH support for VFIO PCI device

2014-06-05 Thread Gavin Shan
On Thu, Jun 05, 2014 at 11:18:34AM -0600, Alex Williamson wrote: On Thu, 2014-06-05 at 16:36 +1000, Gavin Shan wrote: 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

Re: [PATCH v8 0/3] EEH Support for VFIO PCI Device

2014-06-05 Thread Gavin Shan
On Thu, Jun 05, 2014 at 02:54:47PM +0200, Alexander Graf wrote: On 05.06.14 08:36, Gavin Shan wrote: The series of patches adds 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

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

2014-06-05 Thread Gavin Shan
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 gws...@linux.vnet.ibm.com Acked-by: Alexander Graf ag...@suse.de --- Documentation

[PATCH v9 1/3] powerpc/eeh: Avoid event on passed PE

2014-06-05 Thread Gavin Shan
We must not handle EEH error on devices which are passed to somebody else. Instead, we expect that the frozen device owner detects an EEH error and recovers from it. This avoids EEH error handling on passed through devices so the device owner gets a chance to handle them. Signed-off-by: Gavin

[PATCH v9 0/3] EEH Support for VFIO PCI Device

2014-06-05 Thread Gavin Shan
* Define inline PE state for VFIO_EEH_PE_GET_STATE. Gavin Shan (3): powerpc/eeh: Avoid event on passed PE powerpc/eeh: EEH support for VFIO PCI device drivers/vfio: EEH support for VFIO PCI device Documentation/vfio.txt| 87 +- arch/powerpc/include/asm/eeh.h

[PATCH v9 2/3] powerpc/eeh: EEH support for VFIO PCI device

2014-06-05 Thread Gavin Shan
The patch exports functions to be used by new VFIO ioctl command, which will be introduced in subsequent patch, to support EEH functinality for VFIO PCI devices. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com Acked-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/eeh.h | 12

Re: [PATCH v7 3/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-28 Thread Gavin Shan
On Wed, May 28, 2014 at 03:12:35PM +0200, Alexander Graf wrote: On 28.05.14 14:49, Gavin Shan wrote: On Wed, May 28, 2014 at 01:41:35PM +0200, Alexander Graf wrote: On 28.05.14 02:55, Gavin Shan wrote: On Tue, May 27, 2014 at 12:15:27PM -0600, Alex Williamson wrote: On Tue, 2014-05-27 at 18:40

Re: [PATCH v7 3/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-28 Thread Gavin Shan
wrote: On Wed, 2014-05-28 at 00:49 +0200, Alexander Graf wrote: On 27.05.14 20:15, Alex Williamson wrote: On Tue, 2014-05-27 at 18:40 +1000, Gavin Shan wrote: The patch adds new IOCTL commands for sPAPR VFIO container device to support EEH functionality for PCI devices, which have been passed through

Re: [PATCH v7 3/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-28 Thread Gavin Shan
On Wed, May 28, 2014 at 10:32:11AM -0600, Alex Williamson wrote: On Wed, 2014-05-28 at 10:55 +1000, Gavin Shan wrote: On Tue, May 27, 2014 at 12:15:27PM -0600, Alex Williamson wrote: On Tue, 2014-05-27 at 18:40 +1000, Gavin Shan wrote: The patch adds new IOCTL commands for sPAPR VFIO container

[PATCH v7 0/3] EEH Support for VFIO PCI Device

2014-05-27 Thread Gavin Shan
fixes, more comments suggested by Alex.G. * Split/merge patches according to suggestions from Alex.G and Alex.W. * To have EEH stub in drivers/vfio/pci/, which was suggested by Alex.W. * Define various EEH options as macros in vfio.h for userland to use. Gavin Shan

[PATCH v7 2/3] powerpc/eeh: EEH support for VFIO PCI device

2014-05-27 Thread Gavin Shan
The patch exports functions to be used by new ioctl commands, which will be introduced in subsequent patch, to support EEH functinality for VFIO PCI device. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/eeh.h | 15 +++ arch/powerpc/kernel/eeh.c | 286

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

2014-05-27 Thread Gavin Shan
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 gws...@linux.vnet.ibm.com --- Documentation/vfio.txt | 92

Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-23 Thread Gavin Shan
On Fri, May 23, 2014 at 08:55:15AM +0200, Alexander Graf wrote: Am 23.05.2014 um 06:37 schrieb Gavin Shan gws...@linux.vnet.ibm.com: On Thu, May 22, 2014 at 09:10:53PM -0600, Alex Williamson wrote: On Thu, 2014-05-22 at 18:23 +1000, Gavin Shan wrote: The patch adds new IOCTL commands for VFIO

Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-23 Thread Gavin Shan
On Fri, May 23, 2014 at 11:58:22AM +0200, Alexander Graf wrote: On 23.05.14 09:37, Gavin Shan wrote: On Fri, May 23, 2014 at 08:55:15AM +0200, Alexander Graf wrote: Am 23.05.2014 um 06:37 schrieb Gavin Shan gws...@linux.vnet.ibm.com: On Thu, May 22, 2014 at 09:10:53PM -0600, Alex Williamson wrote

Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-23 Thread Gavin Shan
On Fri, May 23, 2014 at 08:52:23AM +0200, Alexander Graf wrote: Am 23.05.2014 um 05:23 schrieb Alex Williamson alex.william...@redhat.com: On Fri, 2014-05-23 at 10:37 +1000, Gavin Shan wrote: On Fri, May 23, 2014 at 10:17:30AM +1000, Gavin Shan wrote: On Thu, May 22, 2014 at 11:55:29AM

Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-23 Thread Gavin Shan
On Fri, May 23, 2014 at 01:58:50PM +0200, Alexander Graf wrote: On 23.05.14 13:55, Gavin Shan wrote: On Fri, May 23, 2014 at 11:58:22AM +0200, Alexander Graf wrote: On 23.05.14 09:37, Gavin Shan wrote: On Fri, May 23, 2014 at 08:55:15AM +0200, Alexander Graf wrote: Am 23.05.2014 um 06:37 schrieb

Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-23 Thread Gavin Shan
On Fri, May 23, 2014 at 08:49:19AM -0600, Alex Williamson wrote: On Fri, 2014-05-23 at 14:30 +0200, Alexander Graf wrote: On 23.05.14 13:58, Gavin Shan wrote: On Fri, May 23, 2014 at 08:52:23AM +0200, Alexander Graf wrote: Am 23.05.2014 um 05:23 schrieb Alex Williamson alex.william

Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-23 Thread Gavin Shan
On Fri, May 23, 2014 at 02:49:13PM +0200, Alexander Graf wrote: .../... VFIO_EEH_RECOVER? Then it should contain VFIO_EEH_PE_RESET, which is part of the recovery. I don't expect the recovery to be done with one ioctl command :-) I personally prefer to keep VFIO_EEH_PE_CONFIUGRE, which means

Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-23 Thread Gavin Shan
On Fri, May 23, 2014 at 08:29:59AM -0600, Alex Williamson wrote: On Fri, 2014-05-23 at 14:37 +1000, Gavin Shan wrote: On Thu, May 22, 2014 at 09:10:53PM -0600, Alex Williamson wrote: On Thu, 2014-05-22 at 18:23 +1000, Gavin Shan wrote: .../... No, sorry, I mean how does the user get

[PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-22 Thread Gavin Shan
The patch adds new IOCTL commands for VFIO PCI 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 gws...@linux.vnet.ibm.com --- Documentation/vfio.txt | 88 ++- arch/powerpc/include

[PATCH v6 1/3] powerpc/eeh: Flags for passed device and PE

2014-05-22 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 somebody else. In turn, we will deliver EEH errors to the device's owner for further handling, which will be done in subsequent patches. Signed-off-by: Gavin Shan gws

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

2014-05-22 Thread Gavin Shan
On Thu, May 22, 2014 at 11:55:57AM +0200, Alexander Graf wrote: On 22.05.14 10:23, Gavin Shan wrote: If we detects frozen state on PE that has been passed through to somebody else. we needn't handle it. Instead, we rely on the device's owner to detect and recover it. The patch avoid EEH event

Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-22 Thread Gavin Shan
On Thu, May 22, 2014 at 11:55:29AM +0200, Alexander Graf wrote: On 22.05.14 10:23, Gavin Shan wrote: The patch adds new IOCTL commands for VFIO PCI 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

Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-22 Thread Gavin Shan
On Fri, May 23, 2014 at 10:17:30AM +1000, Gavin Shan wrote: On Thu, May 22, 2014 at 11:55:29AM +0200, Alexander Graf wrote: On 22.05.14 10:23, Gavin Shan wrote: .../... diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index cb9023d..ef55682 100644 --- a/include/uapi/linux

Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device

2014-05-22 Thread Gavin Shan
On Thu, May 22, 2014 at 09:10:53PM -0600, Alex Williamson wrote: On Thu, 2014-05-22 at 18:23 +1000, Gavin Shan wrote: The patch adds new IOCTL commands for VFIO PCI device to support EEH functionality for PCI devices, which have been passed through from host to somebody else via VFIO. Signed

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

2014-05-21 Thread Gavin Shan
On Wed, May 21, 2014 at 05:24:22PM +1000, Benjamin Herrenschmidt wrote: On Wed, 2014-05-21 at 08:23 +0200, Alexander Graf wrote: Note to Alex: This definitely kills the notifier idea for now though, at least as a first class citizen of the design. We can add it as an optional optimization

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

2014-05-21 Thread Gavin Shan
On Wed, May 21, 2014 at 03:07:26PM +0200, Alexander Graf wrote: On 21.05.14 07:03, 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

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 --- arch

[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 + arch/powerpc/platforms

[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
= - Emulex adapter Testing on P8 = Need testing for more after the code is finalized. The logic is required by P7/P8 machines shouldn't be different. Gavin Shan (4): drivers/vfio: Introduce CONFIG_VFIO_PCI_EEH powerpc/eeh: Flags for passed device and PE drivers/vfio: New IOCTL

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 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 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 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 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 arch/powerpc/plaforms

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
Documentation/vfio.txt, which was missed in last revision. * No QEMU changes for this revision. v4 works well. Also, remove RFC from the subject as the design is basically recognized. Gavin Shan (4): drivers/vfio: Introduce CONFIG_VFIO_PCI_EEH powerpc/eeh: Flags for passed device

[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 --- arch

[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

Re: [PATCH RFC v3 0/8] EEH Support for VFIO PCI device

2014-05-19 Thread Gavin Shan
On Wed, May 14, 2014 at 02:11:54PM +1000, Gavin Shan wrote: Ping, Alex.G and Alex.W. Could you please take a look on this when you have available bandwidth? Thanks in advance for your time :-) The series of patches intends to support EEH for PCI devices, which are passed through to PowerKVM

Re: [PATCH 2/8] powerpc/eeh: Info to trace passed devices

2014-05-19 Thread Gavin Shan
On Tue, May 20, 2014 at 08:37:29AM +1000, Benjamin Herrenschmidt wrote: On Mon, 2014-05-19 at 14:46 +0200, Alexander Graf wrote: I don't see the point of VFIO knowing about guest addresses. They are not unique across a system and the whole idea that a VFIO device has to be owned by a guest is

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

2014-05-19 Thread Gavin Shan
On Mon, May 19, 2014 at 02:51:27PM +0200, Alexander Graf wrote: On 14.05.14 06:11, 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. Signed-off-by: Gavin Shan gws

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

2014-05-19 Thread Gavin Shan
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. Thanks

Re: [PATCH RFC v3 0/8] EEH Support for VFIO PCI device

2014-05-15 Thread Gavin Shan
to do PCI error injection without EEH support. So for the case, the hooks doing real work is being protected by CONFIG_EEH. The hooks for another case (error injection from errinject utility running on guest) are protected by CONFIG_EEH_VFIO Thanks, Gavin On 05/14/2014 12:11 PM, Gavin Shan wrote

[PATCH 7/8] powerpc/powernv: Implement ppc_call_opal()

2014-05-13 Thread Gavin Shan
. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/opal.h | 3 +- arch/powerpc/platforms/powernv/opal.c | 90 ++- 2 files changed, 90 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include

[PATCH 1/8] drivers/vfio: Introduce CONFIG_VFIO_EEH

2014-05-13 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 gws...@linux.vnet.ibm.com --- drivers/vfio/Kconfig | 6 ++ 1 file changed, 6 insertions

[PATCH RFC v3 0/8] EEH Support for VFIO PCI device

2014-05-13 Thread Gavin Shan
after design is finalized. - Gavin Shan (8): drivers/vfio: Introduce CONFIG_VFIO_EEH powerpc/eeh: Info to trace passed devices drivers/vfio: New IOCTL command VFIO_EEH_INFO powerpc/eeh: Avoid event on passed PE powerpc/powernv: Sync OPAL header file with firmware powerpc: Extend

[PATCH 5/8] powerpc/powernv: Sync OPAL header file with firmware

2014-05-13 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 gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/opal.h| 65 ++ arch/powerpc/platforms/powernv/opal

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

2014-05-13 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 3/8] drivers/vfio: New IOCTL command VFIO_EEH_INFO

2014-05-13 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 gws...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/Makefile | 1 + arch/powerpc/platforms

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

2014-05-13 Thread Gavin Shan
of errors in future. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/opal.h| 6 + arch/powerpc/platforms/powernv/Makefile| 2 +- arch/powerpc/platforms/powernv/errinject.c | 224 + 3 files changed, 231 insertions(+), 1

[PATCH 2/8] powerpc/eeh: Info to trace passed devices

2014-05-13 Thread Gavin Shan
, the patch adds function eeh_vfio_pe_get() and eeh_vfio_dev_get() to search EEH PE or device according to the given guest address. Both of them will be used by subsequent patches. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/eeh.h | 52

[PATCH 6/8] powerpc: Extend syscall ppc_rtas()

2014-05-13 Thread Gavin Shan
and kerenl is by struct rtas_args. It's platform specific on how to use the data. Signed-off-by: Mike Qiu qiud...@linux.vnet.ibm.com Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/rtas.h| 10 +- arch/powerpc/include/asm/syscalls.h| 2 +- arch

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

2014-05-09 Thread Gavin Shan
-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/eeh.h | 46 ++ 1 file changed, 46 insertions(+) diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index 7782056..3268692 100644 --- a/arch/powerpc/include

[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 gws...@linux.vnet.ibm.com --- drivers/vfio/Kconfig | 6 ++ 1 file changed, 6 insertions

[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 gws...@linux.vnet.ibm.com --- arch

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

2014-05-09 Thread Gavin Shan
testing after design is finalized. - Gavin Shan (10): drivers/vfio: Introduce CONFIG_VFIO_EEH powerpc/eeh: Info to trace passed devices powerpc/eeh: Search EEH device by guest address powerpc/eeh: Search EEH PE by guest address drivers/vfio: New IOCTL command VFIO_EEH_INFO powerpc

[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 gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/opal.h| 65 ++ arch/powerpc/platforms/powernv/opal

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

2014-05-09 Thread Gavin Shan
and kerenl is by struct rtas_args. It's platform specific on how to use the data. Signed-off-by: Mike Qiu qiud...@linux.vnet.ibm.com Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/rtas.h| 10 +- arch/powerpc/include/asm/syscalls.h| 2 +- arch

[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 gws...@linux.vnet.ibm.com

[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 gws...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/Makefile | 1 + arch/powerpc/platforms

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

2014-05-09 Thread Gavin Shan
. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/opal.h | 3 +- arch/powerpc/platforms/powernv/opal.c | 90 ++- 2 files changed, 90 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include

[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 gws...@linux.vnet.ibm.com --- arch/powerpc

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

2014-05-09 Thread Gavin Shan
of errors in future. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/include/asm/opal.h| 6 + arch/powerpc/platforms/powernv/Makefile| 2 +- arch/powerpc/platforms/powernv/errinject.c | 224 + 3 files changed, 231 insertions(+), 1

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

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

2014-05-05 Thread Gavin Shan
On Mon, May 05, 2014 at 08:00:12AM -0600, Alex Williamson wrote: On Mon, 2014-05-05 at 13:56 +0200, Alexander Graf wrote: On 05/05/2014 03:27 AM, Gavin Shan wrote: The series of patches intends to support EEH for PCI devices, which have been passed through to PowerKVM based guest via VFIO

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

2014-05-04 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 VM indicator, PHB BUID, bus, slot and function number. The function is useful in the backends for EEH RTAS emulation. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com

[PATCH 10/22] powerpc/eeh: Introduce kvmppc_eeh_format_addr()

2014-05-04 Thread Gavin Shan
device or PE instance if necessary. The function will be used by subsequent patches. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/eeh-rtas.c | 52 +++ 1 file changed, 52 insertions(+) diff --git a/arch/powerpc/platforms/powernv/eeh

[PATCH 13/22] powerpc/eeh: Emulate RTAS call ibm,read-slot-reset-state2

2014-05-04 Thread Gavin Shan
The RTAS call ibm,read-slot-reset-state2 is being used to retrieve the various states of the specified PE, e.g. reset state, frozen DMA, frozen MMIO etc. The patch implements the backend to emulate the RTAS call. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/platforms

[PATCH 11/22] powerpc/eeh: Emulate RTAS call ibm,set-eeh-option

2014-05-04 Thread Gavin Shan
The RTAS call ibm,set-eeh-option is being used to enable/disable EEH functionality on the specified PE, or enable MMIO/DMA for the frozen PE. The patch emulates the RTAS call. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/eeh-rtas.c | 83

[PATCH 06/22] powerpc/eeh: Function for address mapping

2014-05-04 Thread Gavin Shan
The patch introduces function kvm_vfio_eeh_dev_map(), which is expected to be called on IOCTL command issued to the VM device, in order to build the address mapping for VFIO PCI device. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- arch/powerpc/kernel/eeh_pe.c | 88

  1   2   >