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

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

2014-05-27 Thread Alex Williamson
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 host to somebody else via VFIO. > > Signed-off-by: Gavin Shan > --- > Documentation/vfio.

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

2014-05-27 Thread Benjamin Herrenschmidt
On Tue, 2014-05-27 at 12:15 -0600, Alex Williamson wrote: > > +/* > > + * Reset is the major step to recover problematic PE. The following > > + * command helps on that. > > + */ > > +struct vfio_eeh_pe_reset { > > + __u32 argsz; > > + __u32 flags; > > + __u32 option; > > +#define VFIO_EEH_P

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

2014-05-27 Thread Alex Williamson
On Wed, 2014-05-28 at 06:30 +1000, Benjamin Herrenschmidt wrote: > On Tue, 2014-05-27 at 12:15 -0600, Alex Williamson wrote: > > > > +/* > > > + * Reset is the major step to recover problematic PE. The following > > > + * command helps on that. > > > + */ > > > +struct vfio_eeh_pe_reset { > > > +

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

2014-05-27 Thread Benjamin Herrenschmidt
On Tue, 2014-05-27 at 14:37 -0600, Alex Williamson wrote: > > The usual way is the driver asks for one or the other, this plumbs back > > into the guest EEH code which itself plumbs into the PCIe error recovery > > framework in Linux. > > So magic? Yes. The driver is expected to more or less kno

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

2014-05-27 Thread Alexander Graf
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 from host to somebody else via VFIO. Signed-off-by: Gavi

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

2014-05-27 Thread Alex Williamson
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 pas

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

2014-05-27 Thread Alexander Graf
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 Shan wrote: The patch adds new IOCTL commands for sPAPR VFIO container device to support EEH functionality for

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 host to somebody else v

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

2014-05-27 Thread Alex Williamson
On Wed, 2014-05-28 at 02:44 +0200, Alexander Graf 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 Shan wrote: > The patch adds new IOCTL

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

2014-05-28 Thread Alexander Graf
On 28.05.14 02:57, Alex Williamson wrote: On Wed, 2014-05-28 at 02:44 +0200, Alexander Graf 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 Shan wrote:

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

2014-05-28 Thread Alexander Graf
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 commands for sPAPR VFIO container device to support EEH functionality for PCI devices, which have been passed thro

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 commands for sPAPR VFIO container device >>

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

2014-05-28 Thread Alexander Graf
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 +1000, Gavin Shan wrote: The patch adds new IOCTL commands fo

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

2014-05-28 Thread Alex Williamson
On Wed, 2014-05-28 at 13:37 +0200, Alexander Graf wrote: > On 28.05.14 02:57, Alex Williamson wrote: > > On Wed, 2014-05-28 at 02:44 +0200, Alexander Graf 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, A

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

2014-05-28 Thread Alex Williamson
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 device > >> to support EEH functionality for PCI devices, w

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

2014-05-28 Thread Benjamin Herrenschmidt
On Wed, 2014-05-28 at 22:49 +1000, Gavin Shan wrote: > > I will remove those "address" related macros in next revision because it's > user-level bussiness, not related to host kernel any more. > > If the user is QEMU + guest, we need the address to identify the PE though PHB > BUID could be used

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

2014-05-28 Thread Alexander Graf
On 28.05.14 18:17, Alex Williamson wrote: On Wed, 2014-05-28 at 13:37 +0200, Alexander Graf wrote: On 28.05.14 02:57, Alex Williamson wrote: On Wed, 2014-05-28 at 02:44 +0200, Alexander Graf wrote: On 28.05.14 02:39, Alex Williamson wrote: On Wed, 2014-05-28 at 00:49 +0200, Alexander Graf wr

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

2014-05-28 Thread Alexander Graf
On 28.05.14 23:58, Benjamin Herrenschmidt wrote: On Wed, 2014-05-28 at 22:49 +1000, Gavin Shan wrote: I will remove those "address" related macros in next revision because it's user-level bussiness, not related to host kernel any more. If the user is QEMU + guest, we need the address to identi

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

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

2014-05-28 Thread Benjamin Herrenschmidt
On Thu, 2014-05-29 at 00:46 +0200, Alexander Graf wrote: > I don't think so :). In QEMU the PHB emulation would have to notify the > "container" (IOMMU emulation layer -> PE) that a PE operation happened. > It's that emulation code's responsibility to broadcast operations across > its own emulat

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 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 wrote: >>>On 28.05.14 02:57, Alex Williamson wrote: On Wed, 2014-05-28 at 02:44 +0200, Alexander Graf wrote: >On 28.05.14 02:39, Ale

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

2014-05-28 Thread Alexander Graf
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 wrote: On 28.05.14 02:57, Alex Williamson wrote: On Wed, 2014-05-28 at 02:44 +0200, Alexander Graf

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 wrote: >On 28.05.14 02:57, A

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

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

2014-05-28 Thread Benjamin Herrenschmidt
On Thu, 2014-05-29 at 10:05 +1000, Gavin Shan wrote: > The log stuff is TBD and I'll figure it out later. > > About to what are the errors, there are a lot. Most of them are related > to hardware level, for example unstable PCI link. Usually, those error > bits defined in AER fatal error state reg

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

2014-05-29 Thread Alexey Kardashevskiy
On 05/29/2014 07:58 AM, Benjamin Herrenschmidt wrote: > On Wed, 2014-05-28 at 22:49 +1000, Gavin Shan wrote: >> >> I will remove those "address" related macros in next revision because it's >> user-level bussiness, not related to host kernel any more. >> >> If the user is QEMU + guest, we need the

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

2014-05-29 Thread Benjamin Herrenschmidt
On Fri, 2014-05-30 at 13:44 +1000, Alexey Kardashevskiy wrote: > > It is pseries, not real HW. Does phyp allow multiple real host PEs on > the same virtual PHB? I don't know how recent pHyp versions do it. I think they pretty much have a PE == 1 virtual PHB so you might be right there. On older