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-17 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 --- drivers/vfio/vfio_iommu_spapr_

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

2015-09-17 Thread Gavin Shan
are affected as before. Gavin Shan (2): drivers/vfio: Support EEH API revision drivers/vfio: Support IOMMU group for EEH operations drivers/vfio/vfio_iommu_spapr_tce.c | 50 ++--- drivers/vfio/vfio_spapr_eeh.c | 46

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

2015-09-17 Thread Gavin Shan
o specify IOMMU group (PE) ID when requesting EEH operation. Signed-off-by: Gavin Shan --- drivers/vfio/vfio_iommu_spapr_tce.c | 51 - drivers/vfio/vfio_spapr_eeh.c | 39 include/linux/vfio.h| 7 ++--- include/ua

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

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

2014-06-24 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_ENABLE

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 sys

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 &g

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? >> >> Ma

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

[PATCH v1 0/3] Support PCI Error Injection

2014-06-22 Thread Gavin Shan
o "ibm,errinjct". So "ibm,open-errinjct" 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

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

2014-06-22 Thread Gavin Shan
in the token by itself. 32-bits PCI error: "7:addr:mask:iommu_group_id:function". 64-bits PCI error: "8: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 spe

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

2014-06-22 Thread Gavin Shan
OC 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 --- arch/powerpc/platforms/powernv/eeh-ioda.c | 24 1 file changed, 24 insertions(+) diff --git a/arch/powerpc/platforms/powernv/eeh-i

[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 --- arch/powerpc/include/asm/opal.h| 65 ++ arch/powerpc/platforms/powernv/opal-wrappers.S | 1 + 2 files changed, 66 insertions(+) diff --git a/arch

[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 Acked-by: Alexander Graf --- Documentation/vfio.txt | 87

[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 Acked-by: Alexander Graf --- arch/powerpc/include/asm/eeh.h | 12 ++ arch/powerpc/kernel/eeh.c | 268

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

2014-06-09 Thread Gavin Shan
Missed to disable VFIO device on error from vfio_spapr_pci_eeh_open(). * Don't include unused header files in drivers/vfio/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

[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

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

[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
O device on error from vfio_spapr_pci_eeh_open(). * Don't include unused header files in drivers/vfio/vfio_spapr_eeh.c * 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 driver

[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 Acked-by: Alexander Graf --- arch/powerpc/include/asm/eeh.h | 12 ++ arch/powerpc/kernel/eeh.c | 268

[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 Acked-by: Alexander Graf --- Documentation/vfio.txt | 87

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

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

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 j

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

2014-06-04 Thread Gavin Shan
, inline functions defined in include/linux/vfio.h * Change vfio.txt according to the source code changes. * Fix 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 PC

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

2014-06-04 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 --- arch/powerpc/include/asm/eeh.h | 14 +++ arch/powerpc/kernel/eeh.c | 268

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

2014-06-04 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 --- Documentation/vfio.txt | 87

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

2014-06-04 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

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

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

2014-05-28 Thread Gavin Shan
On Thu, May 29, 2014 at 01:38:46AM +0200, Alexander Graf wrote: >On 29.05.14 01:37, Gavin Shan wrote: >>On Thu, May 29, 2014 at 12:40:26AM +0200, Alexander Graf wrote: >>>On 28.05.14 18:17, Alex Williamson wrote: >>>>On Wed, 2014-05-28 at 13:37 +0200, Alexander Graf

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

2014-05-28 Thread Gavin Shan
wrote: >>>>>On 28.05.14 02:39, Alex Williamson 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 Sh

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 Wi

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 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 +1000, Gavin Shan wrote: >>>>The patch adds new IOCTL command

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

2014-05-27 Thread Gavin Shan
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 device >> to support EEH functionality for PCI devices, which have been passed >> through from

[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 --- Documentation/vfio.txt | 92

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

2014-05-27 Thread Gavin Shan
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 on the frozen passed PE so that the device's owner can have chance to handle that. Signe

[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 --- arch/powerpc/include/asm/eeh.h | 15 +++ arch/powerpc/kernel/eeh.c | 286

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

2014-05-27 Thread Gavin Shan
/, which was suggested by Alex.W. * Define various EEH options as macros in vfio.h for userland to use. 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.tx

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

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 mean

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

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, Alexande

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

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 : >>>>>On Thu, May 22, 2014 at 09:10:53PM

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

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 s

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 1

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

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 a

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

[PATCH v6 0/3] EEH Support for VFIO PCI device

2014-05-22 Thread Gavin Shan
l numbers have been replaced by macros defined in eeh.h. The comments, including the function names have been amended not to mention "guest" or "vfio". * Add one mutex to protect flag in eeh_dev_open()/release(). * More information on how to use those ioctl

[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 --- Documentation/vfio.txt | 88 ++- arch/powerpc/include/asm/eeh.h | 17 +++ arch

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

2014-05-22 Thread Gavin Shan
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 on the frozen passed PE so that the device's owner can have chance to handle that. Signe

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

2014-05-22 Thread Gavin Shan
On Thu, May 22, 2014 at 07:56:31AM +1000, Benjamin Herrenschmidt wrote: >On Wed, 2014-05-21 at 15:07 +0200, Alexander Graf wrote: > >> > +#ifdef CONFIG_VFIO_PCI_EEH >> > +int eeh_vfio_open(struct pci_dev *pdev) >> >> Why vfio? Also that config option will not be set if vfio is compiled as >> a mo

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

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

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. &

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 opt

[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 --- arch/powerpc/include/asm/eeh.h | 32

[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 --- drivers/vfio/pci/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/vfio

[PATCH v5 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 --- arch/powerpc/k

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

2014-05-20 Thread Gavin Shan
related to error injection. * Amending 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): d

[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 --- Documentation/vfio.txt | 6 +- arch/powerpc/include/asm/eeh.h | 10 ++ arch/powerpc/kernel

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

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 a

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 bee

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, Alexande

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

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 E

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 dev

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

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

[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 --- arch/powerpc/platforms/powernv/Makefile | 1 + arch/powerpc/platforms/powernv/eeh-vfio.c | 445

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

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

2014-05-20 Thread Gavin Shan
ted by Alex.W. Testing on P7 = - 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 devic

[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 --- arch/powerpc/include/asm/eeh.h | 32

[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 --- drivers/vfio/pci/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/vfio

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 n

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 gu

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. &

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 gu

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 Po

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

2014-05-15 Thread Gavin Shan
lly >>to host kernel. >>v2 -> v3: >> * Make the fields in struct eeh_vfio_pci_addr, struct vfio_eeh_info >> based >>on the comments from Alexey. >> * Define macros for EEH VFIO operations (Alexey). >> * Clear frozen stat

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

2014-05-13 Thread Gavin Shan
transported between userland and kerenl is by "struct rtas_args". It's platform specific on how to use the data. Signed-off-by: Mike Qiu Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/rtas.h| 10 +- arch/powerpc/include/asm/syscalls.h| 2 +- arch/powerpc/incl

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

[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 --- arch/powerpc/platforms/powernv/Makefile | 1 + arch/powerpc/platforms/powernv/eeh-vfio.c | 593

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

2014-05-13 Thread Gavin Shan
errors in future. Signed-off-by: Gavin Shan --- 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 deletion(-) create mode 100644

[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 --- arch/powerpc/include/asm/eeh.h | 52 +++ arch/powerpc/kernel

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

2014-05-13 Thread Gavin Shan
be distributed. Signed-off-by: Gavin Shan --- 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/asm/opal.

[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 --- drivers/vfio/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/vfio

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

2014-05-13 Thread Gavin Shan
pter Testing on P8 = - Need more testing 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:

[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 --- arch/powerpc/include/asm/opal.h| 65 ++ arch/powerpc/platforms/powernv/opal-wrappers.S | 1 + 2 files

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

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

2014-05-09 Thread Gavin Shan
be distributed. Signed-off-by: Gavin Shan --- 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/asm/opal.

[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
errors in future. Signed-off-by: Gavin Shan --- 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 deletion(-) create mode

[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

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

2014-05-09 Thread Gavin Shan
transported between userland and kerenl is by "struct rtas_args". It's platform specific on how to use the data. Signed-off-by: Mike Qiu Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/rtas.h| 10 +- arch/powerpc/include/asm/syscalls.h| 2 +- arch/powerpc/incl

[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/k

  1   2   >