* [PATCH v3 0/4] drivers/vfio: EEH Compile and compatibility @ 2014-08-06 9:49 Gavin Shan 2014-08-06 9:49 ` [PATCH v3 1/4] powerpc/eeh: Export eeh_iommu_group_to_pe() Gavin Shan ` (3 more replies) 0 siblings, 4 replies; 9+ messages in thread From: Gavin Shan @ 2014-08-06 9:49 UTC (permalink / raw) To: linuxppc-dev; +Cc: aik, alex.williamson, Gavin Shan, kvm The patchset is mainly for fixing errors from building VFIO compoments as dynamic modules. PATCH[4/4] allows VFIO can be used though EEH fails to initialize for VFIO PCI devices. Alexey Kardashevskiy (2): drivers/vfio: Allow EEH to be built as module drivers/vfio: Enable VFIO if EEH is not supported Gavin Shan (2): powerpc/eeh: Export eeh_iommu_group_to_pe() drivers/vfio: Fix EEH build error arch/powerpc/kernel/eeh.c | 1 + drivers/vfio/Kconfig | 6 ++++++ drivers/vfio/Makefile | 2 +- drivers/vfio/pci/vfio_pci.c | 6 +----- drivers/vfio/vfio_spapr_eeh.c | 17 +++++++++++++++-- include/linux/vfio.h | 6 +++--- 6 files changed, 27 insertions(+), 11 deletions(-) --=20 1.8.3.2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 1/4] powerpc/eeh: Export eeh_iommu_group_to_pe() 2014-08-06 9:49 [PATCH v3 0/4] drivers/vfio: EEH Compile and compatibility Gavin Shan @ 2014-08-06 9:49 ` Gavin Shan 2014-08-06 9:49 ` [PATCH v3 2/4] drivers/vfio: Fix EEH build error Gavin Shan ` (2 subsequent siblings) 3 siblings, 0 replies; 9+ messages in thread From: Gavin Shan @ 2014-08-06 9:49 UTC (permalink / raw) To: linuxppc-dev; +Cc: aik, alex.williamson, Gavin Shan, kvm The function is used by VFIO driver, which might be built as a dynamic module. So it should be exported. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> --- arch/powerpc/kernel/eeh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index 6043879..59a64f8 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c @@ -1254,6 +1254,7 @@ struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group) return edev->pe; } +EXPORT_SYMBOL_GPL(eeh_iommu_group_to_pe); #endif /* CONFIG_IOMMU_API */ -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v3 2/4] drivers/vfio: Fix EEH build error 2014-08-06 9:49 [PATCH v3 0/4] drivers/vfio: EEH Compile and compatibility Gavin Shan 2014-08-06 9:49 ` [PATCH v3 1/4] powerpc/eeh: Export eeh_iommu_group_to_pe() Gavin Shan @ 2014-08-06 9:49 ` Gavin Shan 2014-08-06 9:49 ` [PATCH v3 3/4] drivers/vfio: Allow EEH to be built as module Gavin Shan 2014-08-06 9:49 ` [PATCH v3 4/4] drivers/vfio: Enable VFIO if EEH is not supported Gavin Shan 3 siblings, 0 replies; 9+ messages in thread From: Gavin Shan @ 2014-08-06 9:49 UTC (permalink / raw) To: linuxppc-dev; +Cc: aik, alex.williamson, Gavin Shan, kvm The VFIO related components could be built as dynamic modules. Unfortunately, CONFIG_EEH can't be configured to "m". The patch fixes the build errors when configuring VFIO related components as dynamic modules as follows: CC [M] drivers/vfio/vfio_iommu_spapr_tce.o In file included from drivers/vfio/vfio.c:33:0: include/linux/vfio.h:101:43: warning: =E2=80=98struct pci_dev=E2=80=99 de= clared \ inside parameter list [enabled by default] : WRAP arch/powerpc/boot/zImage.pseries WRAP arch/powerpc/boot/zImage.maple WRAP arch/powerpc/boot/zImage.pmac WRAP arch/powerpc/boot/zImage.epapr MODPOST 1818 modules ERROR: ".vfio_spapr_iommu_eeh_ioctl" [drivers/vfio/vfio_iommu_spapr_tce.k= o]\ undefined! ERROR: ".vfio_spapr_pci_eeh_open" [drivers/vfio/pci/vfio-pci.ko] undefine= d! ERROR: ".vfio_spapr_pci_eeh_release" [drivers/vfio/pci/vfio-pci.ko] undef= ined! Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- v3: Introduce CONFIG_VFIO_SPAPR_EEH and add "struct pci_dev" in vfio.h v2: remove #include <linux/pci.h> from vfio.c --- drivers/vfio/Kconfig | 6 ++++++ drivers/vfio/Makefile | 2 +- drivers/vfio/vfio_spapr_eeh.c | 3 +++ include/linux/vfio.h | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig index af7b204..d8c5763 100644 --- a/drivers/vfio/Kconfig +++ b/drivers/vfio/Kconfig @@ -8,11 +8,17 @@ config VFIO_IOMMU_SPAPR_TCE depends on VFIO && SPAPR_TCE_IOMMU default n =20 +config VFIO_SPAPR_EEH + tristate + depends on EEH && VFIO_IOMMU_SPAPR_TCE + default n + menuconfig VFIO tristate "VFIO Non-Privileged userspace driver framework" depends on IOMMU_API select VFIO_IOMMU_TYPE1 if X86 select VFIO_IOMMU_SPAPR_TCE if (PPC_POWERNV || PPC_PSERIES) + select VFIO_SPAPR_EEH if (PPC_POWERNV || PPC_PSERIES) select ANON_INODES help VFIO provides a framework for secure userspace device drivers. diff --git a/drivers/vfio/Makefile b/drivers/vfio/Makefile index 50e30bc..0b035b1 100644 --- a/drivers/vfio/Makefile +++ b/drivers/vfio/Makefile @@ -1,5 +1,5 @@ obj-$(CONFIG_VFIO) +=3D vfio.o obj-$(CONFIG_VFIO_IOMMU_TYPE1) +=3D vfio_iommu_type1.o obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) +=3D vfio_iommu_spapr_tce.o -obj-$(CONFIG_EEH) +=3D vfio_spapr_eeh.o +obj-$(CONFIG_VFIO_SPAPR_EEH) +=3D vfio_spapr_eeh.o obj-$(CONFIG_VFIO_PCI) +=3D pci/ diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.= c index f834b4c..949f98e 100644 --- a/drivers/vfio/vfio_spapr_eeh.c +++ b/drivers/vfio/vfio_spapr_eeh.c @@ -18,11 +18,13 @@ int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) { return eeh_dev_open(pdev); } +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open); =20 void vfio_spapr_pci_eeh_release(struct pci_dev *pdev) { eeh_dev_release(pdev); } +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_release); =20 long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, unsigned int cmd, unsigned long arg) @@ -85,3 +87,4 @@ long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *gro= up, =20 return ret; } +EXPORT_SYMBOL(vfio_spapr_iommu_eeh_ioctl); diff --git a/include/linux/vfio.h b/include/linux/vfio.h index 25a0fbd..224128a 100644 --- a/include/linux/vfio.h +++ b/include/linux/vfio.h @@ -98,6 +98,7 @@ extern int vfio_external_user_iommu_id(struct vfio_grou= p *group); extern long vfio_external_check_extension(struct vfio_group *group, unsigned long arg); =20 +struct pci_dev; #ifdef CONFIG_EEH extern int vfio_spapr_pci_eeh_open(struct pci_dev *pdev); extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev); --=20 1.8.3.2 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v3 3/4] drivers/vfio: Allow EEH to be built as module 2014-08-06 9:49 [PATCH v3 0/4] drivers/vfio: EEH Compile and compatibility Gavin Shan 2014-08-06 9:49 ` [PATCH v3 1/4] powerpc/eeh: Export eeh_iommu_group_to_pe() Gavin Shan 2014-08-06 9:49 ` [PATCH v3 2/4] drivers/vfio: Fix EEH build error Gavin Shan @ 2014-08-06 9:49 ` Gavin Shan 2014-08-06 9:49 ` [PATCH v3 4/4] drivers/vfio: Enable VFIO if EEH is not supported Gavin Shan 3 siblings, 0 replies; 9+ messages in thread From: Gavin Shan @ 2014-08-06 9:49 UTC (permalink / raw) To: linuxppc-dev; +Cc: aik, alex.williamson, Gavin Shan, kvm From: Alexey Kardashevskiy <aik@ozlabs.ru> This adds necessary declarations to the SPAPR VFIO EEH module, otherwise multiple dynamic linker errors reported: vfio_spapr_eeh: Unknown symbol eeh_pe_set_option (err 0) vfio_spapr_eeh: Unknown symbol eeh_pe_configure (err 0) vfio_spapr_eeh: Unknown symbol eeh_pe_reset (err 0) vfio_spapr_eeh: Unknown symbol eeh_pe_get_state (err 0) vfio_spapr_eeh: Unknown symbol eeh_iommu_group_to_pe (err 0) vfio_spapr_eeh: Unknown symbol eeh_dev_open (err 0) vfio_spapr_eeh: Unknown symbol eeh_pe_set_option (err 0) vfio_spapr_eeh: Unknown symbol eeh_pe_configure (err 0) vfio_spapr_eeh: Unknown symbol eeh_pe_reset (err 0) vfio_spapr_eeh: Unknown symbol eeh_pe_get_state (err 0) vfio_spapr_eeh: Unknown symbol eeh_iommu_group_to_pe (err 0) vfio_spapr_eeh: Unknown symbol eeh_dev_open (err 0) Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> --- drivers/vfio/vfio_spapr_eeh.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.c index 949f98e..4779cac 100644 --- a/drivers/vfio/vfio_spapr_eeh.c +++ b/drivers/vfio/vfio_spapr_eeh.c @@ -9,10 +9,15 @@ * published by the Free Software Foundation. */ +#include <linux/module.h> #include <linux/uaccess.h> #include <linux/vfio.h> #include <asm/eeh.h> +#define DRIVER_VERSION "0.1" +#define DRIVER_AUTHOR "Gavin Shan, IBM Corporation" +#define DRIVER_DESC "VFIO IOMMU SPAPR EEH" + /* We might build address mapping here for "fast" path later */ int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) { @@ -88,3 +93,8 @@ long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, return ret; } EXPORT_SYMBOL(vfio_spapr_iommu_eeh_ioctl); + +MODULE_VERSION(DRIVER_VERSION); +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_DESCRIPTION(DRIVER_DESC); -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v3 4/4] drivers/vfio: Enable VFIO if EEH is not supported 2014-08-06 9:49 [PATCH v3 0/4] drivers/vfio: EEH Compile and compatibility Gavin Shan ` (2 preceding siblings ...) 2014-08-06 9:49 ` [PATCH v3 3/4] drivers/vfio: Allow EEH to be built as module Gavin Shan @ 2014-08-06 9:49 ` Gavin Shan 2014-08-06 12:50 ` Alex Williamson 3 siblings, 1 reply; 9+ messages in thread From: Gavin Shan @ 2014-08-06 9:49 UTC (permalink / raw) To: linuxppc-dev; +Cc: aik, alex.williamson, Gavin Shan, kvm From: Alexey Kardashevskiy <aik@ozlabs.ru> The existing vfio_pci_open() fails upon error returned from vfio_spapr_pci_eeh_open(), which breaks POWER7's P5IOC2 PHB support which this patch brings back. The patch fixes the issue by dropping the return value of vfio_spapr_pci_eeh_open(). Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> --- v3: Drop return value of vfio_spapr_pci_eeh_open() --- drivers/vfio/pci/vfio_pci.c | 6 +----- drivers/vfio/vfio_spapr_eeh.c | 4 ++-- include/linux/vfio.h | 5 ++--- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index e2ee80f..32d69c8 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -178,11 +178,7 @@ static int vfio_pci_open(void *device_data) if (ret) goto error; - ret = vfio_spapr_pci_eeh_open(vdev->pdev); - if (ret) { - vfio_pci_disable(vdev); - goto error; - } + vfio_spapr_pci_eeh_open(vdev->pdev); } return 0; diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.c index 4779cac..86dfceb 100644 --- a/drivers/vfio/vfio_spapr_eeh.c +++ b/drivers/vfio/vfio_spapr_eeh.c @@ -19,9 +19,9 @@ #define DRIVER_DESC "VFIO IOMMU SPAPR EEH" /* We might build address mapping here for "fast" path later */ -int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) +void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) { - return eeh_dev_open(pdev); + eeh_dev_open(pdev); } EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open); diff --git a/include/linux/vfio.h b/include/linux/vfio.h index 224128a..d320411 100644 --- a/include/linux/vfio.h +++ b/include/linux/vfio.h @@ -100,15 +100,14 @@ extern long vfio_external_check_extension(struct vfio_group *group, struct pci_dev; #ifdef CONFIG_EEH -extern int vfio_spapr_pci_eeh_open(struct pci_dev *pdev); +extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev); extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev); extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, unsigned int cmd, unsigned long arg); #else -static inline int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) +static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) { - return 0; } static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev) -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v3 4/4] drivers/vfio: Enable VFIO if EEH is not supported 2014-08-06 9:49 ` [PATCH v3 4/4] drivers/vfio: Enable VFIO if EEH is not supported Gavin Shan @ 2014-08-06 12:50 ` Alex Williamson 2014-08-06 13:05 ` Alexey Kardashevskiy 0 siblings, 1 reply; 9+ messages in thread From: Alex Williamson @ 2014-08-06 12:50 UTC (permalink / raw) To: Gavin Shan; +Cc: aik, linuxppc-dev, kvm On Wed, 2014-08-06 at 19:49 +1000, Gavin Shan wrote: > From: Alexey Kardashevskiy <aik@ozlabs.ru> > > The existing vfio_pci_open() fails upon error returned from > vfio_spapr_pci_eeh_open(), which breaks POWER7's P5IOC2 PHB > support which this patch brings back. > > The patch fixes the issue by dropping the return value of > vfio_spapr_pci_eeh_open(). > > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> > Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> > --- > v3: Drop return value of vfio_spapr_pci_eeh_open() > --- > drivers/vfio/pci/vfio_pci.c | 6 +----- > drivers/vfio/vfio_spapr_eeh.c | 4 ++-- > include/linux/vfio.h | 5 ++--- > 3 files changed, 5 insertions(+), 10 deletions(-) > > diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c > index e2ee80f..32d69c8 100644 > --- a/drivers/vfio/pci/vfio_pci.c > +++ b/drivers/vfio/pci/vfio_pci.c > @@ -178,11 +178,7 @@ static int vfio_pci_open(void *device_data) > if (ret) > goto error; > > - ret = vfio_spapr_pci_eeh_open(vdev->pdev); > - if (ret) { > - vfio_pci_disable(vdev); > - goto error; > - } > + vfio_spapr_pci_eeh_open(vdev->pdev); > } > > return 0; > diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.c > index 4779cac..86dfceb 100644 > --- a/drivers/vfio/vfio_spapr_eeh.c > +++ b/drivers/vfio/vfio_spapr_eeh.c > @@ -19,9 +19,9 @@ > #define DRIVER_DESC "VFIO IOMMU SPAPR EEH" > > /* We might build address mapping here for "fast" path later */ > -int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) > +void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) > { > - return eeh_dev_open(pdev); > + eeh_dev_open(pdev); Wasn't there some intent to provide a warning message, that would now be done here? Has that idea been dropped? > } > EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open); > > diff --git a/include/linux/vfio.h b/include/linux/vfio.h > index 224128a..d320411 100644 > --- a/include/linux/vfio.h > +++ b/include/linux/vfio.h > @@ -100,15 +100,14 @@ extern long vfio_external_check_extension(struct vfio_group *group, > > struct pci_dev; > #ifdef CONFIG_EEH > -extern int vfio_spapr_pci_eeh_open(struct pci_dev *pdev); > +extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev); > extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev); > extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, > unsigned int cmd, > unsigned long arg); > #else > -static inline int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) > +static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) > { > - return 0; > } > > static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 4/4] drivers/vfio: Enable VFIO if EEH is not supported 2014-08-06 12:50 ` Alex Williamson @ 2014-08-06 13:05 ` Alexey Kardashevskiy 2014-08-07 2:10 ` Gavin Shan 0 siblings, 1 reply; 9+ messages in thread From: Alexey Kardashevskiy @ 2014-08-06 13:05 UTC (permalink / raw) To: Alex Williamson, Gavin Shan; +Cc: linuxppc-dev, kvm On 08/06/2014 10:50 PM, Alex Williamson wrote: > On Wed, 2014-08-06 at 19:49 +1000, Gavin Shan wrote: >> From: Alexey Kardashevskiy <aik@ozlabs.ru> >> >> The existing vfio_pci_open() fails upon error returned from >> vfio_spapr_pci_eeh_open(), which breaks POWER7's P5IOC2 PHB >> support which this patch brings back. >> >> The patch fixes the issue by dropping the return value of >> vfio_spapr_pci_eeh_open(). >> >> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> >> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> >> --- >> v3: Drop return value of vfio_spapr_pci_eeh_open() >> --- >> drivers/vfio/pci/vfio_pci.c | 6 +----- >> drivers/vfio/vfio_spapr_eeh.c | 4 ++-- >> include/linux/vfio.h | 5 ++--- >> 3 files changed, 5 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c >> index e2ee80f..32d69c8 100644 >> --- a/drivers/vfio/pci/vfio_pci.c >> +++ b/drivers/vfio/pci/vfio_pci.c >> @@ -178,11 +178,7 @@ static int vfio_pci_open(void *device_data) >> if (ret) >> goto error; >> >> - ret = vfio_spapr_pci_eeh_open(vdev->pdev); >> - if (ret) { >> - vfio_pci_disable(vdev); >> - goto error; >> - } >> + vfio_spapr_pci_eeh_open(vdev->pdev); >> } >> >> return 0; >> diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.c >> index 4779cac..86dfceb 100644 >> --- a/drivers/vfio/vfio_spapr_eeh.c >> +++ b/drivers/vfio/vfio_spapr_eeh.c >> @@ -19,9 +19,9 @@ >> #define DRIVER_DESC "VFIO IOMMU SPAPR EEH" >> >> /* We might build address mapping here for "fast" path later */ >> -int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >> +void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >> { >> - return eeh_dev_open(pdev); >> + eeh_dev_open(pdev); > > Wasn't there some intent to provide a warning message, that would now be > done here? Has that idea been dropped? Comrade Gavin just forgot it :) Gavin, please add it. Thanks! > >> } >> EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open); >> >> diff --git a/include/linux/vfio.h b/include/linux/vfio.h >> index 224128a..d320411 100644 >> --- a/include/linux/vfio.h >> +++ b/include/linux/vfio.h >> @@ -100,15 +100,14 @@ extern long vfio_external_check_extension(struct vfio_group *group, >> >> struct pci_dev; >> #ifdef CONFIG_EEH >> -extern int vfio_spapr_pci_eeh_open(struct pci_dev *pdev); >> +extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev); >> extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev); >> extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, >> unsigned int cmd, >> unsigned long arg); >> #else >> -static inline int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >> +static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >> { >> - return 0; >> } >> >> static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev) > > > -- Alexey ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 4/4] drivers/vfio: Enable VFIO if EEH is not supported 2014-08-06 13:05 ` Alexey Kardashevskiy @ 2014-08-07 2:10 ` Gavin Shan 2014-08-07 2:46 ` Gavin Shan 0 siblings, 1 reply; 9+ messages in thread From: Gavin Shan @ 2014-08-07 2:10 UTC (permalink / raw) To: Alexey Kardashevskiy; +Cc: Alex Williamson, linuxppc-dev, Gavin Shan, kvm On Wed, Aug 06, 2014 at 11:05:43PM +1000, Alexey Kardashevskiy wrote: >On 08/06/2014 10:50 PM, Alex Williamson wrote: >> On Wed, 2014-08-06 at 19:49 +1000, Gavin Shan wrote: >>> From: Alexey Kardashevskiy <aik@ozlabs.ru> >>> >>> The existing vfio_pci_open() fails upon error returned from >>> vfio_spapr_pci_eeh_open(), which breaks POWER7's P5IOC2 PHB >>> support which this patch brings back. >>> >>> The patch fixes the issue by dropping the return value of >>> vfio_spapr_pci_eeh_open(). >>> >>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> >>> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> >>> --- >>> v3: Drop return value of vfio_spapr_pci_eeh_open() >>> --- >>> drivers/vfio/pci/vfio_pci.c | 6 +----- >>> drivers/vfio/vfio_spapr_eeh.c | 4 ++-- >>> include/linux/vfio.h | 5 ++--- >>> 3 files changed, 5 insertions(+), 10 deletions(-) >>> >>> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c >>> index e2ee80f..32d69c8 100644 >>> --- a/drivers/vfio/pci/vfio_pci.c >>> +++ b/drivers/vfio/pci/vfio_pci.c >>> @@ -178,11 +178,7 @@ static int vfio_pci_open(void *device_data) >>> if (ret) >>> goto error; >>> >>> - ret = vfio_spapr_pci_eeh_open(vdev->pdev); >>> - if (ret) { >>> - vfio_pci_disable(vdev); >>> - goto error; >>> - } >>> + vfio_spapr_pci_eeh_open(vdev->pdev); >>> } >>> >>> return 0; >>> diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.c >>> index 4779cac..86dfceb 100644 >>> --- a/drivers/vfio/vfio_spapr_eeh.c >>> +++ b/drivers/vfio/vfio_spapr_eeh.c >>> @@ -19,9 +19,9 @@ >>> #define DRIVER_DESC "VFIO IOMMU SPAPR EEH" >>> >>> /* We might build address mapping here for "fast" path later */ >>> -int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >>> +void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >>> { >>> - return eeh_dev_open(pdev); >>> + eeh_dev_open(pdev); >> >> Wasn't there some intent to provide a warning message, that would now be >> done here? Has that idea been dropped? > > >Comrade Gavin just forgot it :) > >Gavin, please add it. Thanks! > Sure, I'll add following warning message in eeh_dev_open() in separate patch in v4 in case nobody objects. int eeh_dev_open(struct pci_dev *pdev) { : /* No EEH device or PE ? */ edev = pci_dev_to_eeh_dev(pdev); if (!edev || !edev->pe) { pr_warn_once("%s: Device %s not supported\n", __func__, pci_name(pdev)); goto out; } : } Thanks, Gavin > > >> >>> } >>> EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open); >>> >>> diff --git a/include/linux/vfio.h b/include/linux/vfio.h >>> index 224128a..d320411 100644 >>> --- a/include/linux/vfio.h >>> +++ b/include/linux/vfio.h >>> @@ -100,15 +100,14 @@ extern long vfio_external_check_extension(struct vfio_group *group, >>> >>> struct pci_dev; >>> #ifdef CONFIG_EEH >>> -extern int vfio_spapr_pci_eeh_open(struct pci_dev *pdev); >>> +extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev); >>> extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev); >>> extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, >>> unsigned int cmd, >>> unsigned long arg); >>> #else >>> -static inline int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >>> +static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >>> { >>> - return 0; >>> } >>> >>> static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev) >> >> >> > > >-- >Alexey > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 4/4] drivers/vfio: Enable VFIO if EEH is not supported 2014-08-07 2:10 ` Gavin Shan @ 2014-08-07 2:46 ` Gavin Shan 0 siblings, 0 replies; 9+ messages in thread From: Gavin Shan @ 2014-08-07 2:46 UTC (permalink / raw) To: Gavin Shan; +Cc: Alexey Kardashevskiy, Alex Williamson, linuxppc-dev, kvm On Thu, Aug 07, 2014 at 12:10:07PM +1000, Gavin Shan wrote: >On Wed, Aug 06, 2014 at 11:05:43PM +1000, Alexey Kardashevskiy wrote: >>On 08/06/2014 10:50 PM, Alex Williamson wrote: >>> On Wed, 2014-08-06 at 19:49 +1000, Gavin Shan wrote: >>>> From: Alexey Kardashevskiy <aik@ozlabs.ru> >>>> >>>> The existing vfio_pci_open() fails upon error returned from >>>> vfio_spapr_pci_eeh_open(), which breaks POWER7's P5IOC2 PHB >>>> support which this patch brings back. >>>> >>>> The patch fixes the issue by dropping the return value of >>>> vfio_spapr_pci_eeh_open(). >>>> >>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> >>>> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> >>>> --- >>>> v3: Drop return value of vfio_spapr_pci_eeh_open() >>>> --- >>>> drivers/vfio/pci/vfio_pci.c | 6 +----- >>>> drivers/vfio/vfio_spapr_eeh.c | 4 ++-- >>>> include/linux/vfio.h | 5 ++--- >>>> 3 files changed, 5 insertions(+), 10 deletions(-) >>>> >>>> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c >>>> index e2ee80f..32d69c8 100644 >>>> --- a/drivers/vfio/pci/vfio_pci.c >>>> +++ b/drivers/vfio/pci/vfio_pci.c >>>> @@ -178,11 +178,7 @@ static int vfio_pci_open(void *device_data) >>>> if (ret) >>>> goto error; >>>> >>>> - ret = vfio_spapr_pci_eeh_open(vdev->pdev); >>>> - if (ret) { >>>> - vfio_pci_disable(vdev); >>>> - goto error; >>>> - } >>>> + vfio_spapr_pci_eeh_open(vdev->pdev); >>>> } >>>> >>>> return 0; >>>> diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.c >>>> index 4779cac..86dfceb 100644 >>>> --- a/drivers/vfio/vfio_spapr_eeh.c >>>> +++ b/drivers/vfio/vfio_spapr_eeh.c >>>> @@ -19,9 +19,9 @@ >>>> #define DRIVER_DESC "VFIO IOMMU SPAPR EEH" >>>> >>>> /* We might build address mapping here for "fast" path later */ >>>> -int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >>>> +void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >>>> { >>>> - return eeh_dev_open(pdev); >>>> + eeh_dev_open(pdev); >>> >>> Wasn't there some intent to provide a warning message, that would now be >>> done here? Has that idea been dropped? >> >> >>Comrade Gavin just forgot it :) >> >>Gavin, please add it. Thanks! >> > >Sure, I'll add following warning message in eeh_dev_open() in >separate patch in v4 in case nobody objects. > >int eeh_dev_open(struct pci_dev *pdev) >{ > : > /* No EEH device or PE ? */ > edev = pci_dev_to_eeh_dev(pdev); > if (!edev || !edev->pe) { > pr_warn_once("%s: Device %s not supported\n", > __func__, pci_name(pdev)); > goto out; > } > : >} > Well, I added the warning message in eeh_dev_open() and sending "v4" out. Thanks, Gavin > >> >> >>> >>>> } >>>> EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open); >>>> >>>> diff --git a/include/linux/vfio.h b/include/linux/vfio.h >>>> index 224128a..d320411 100644 >>>> --- a/include/linux/vfio.h >>>> +++ b/include/linux/vfio.h >>>> @@ -100,15 +100,14 @@ extern long vfio_external_check_extension(struct vfio_group *group, >>>> >>>> struct pci_dev; >>>> #ifdef CONFIG_EEH >>>> -extern int vfio_spapr_pci_eeh_open(struct pci_dev *pdev); >>>> +extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev); >>>> extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev); >>>> extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, >>>> unsigned int cmd, >>>> unsigned long arg); >>>> #else >>>> -static inline int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >>>> +static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) >>>> { >>>> - return 0; >>>> } >>>> >>>> static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev) >>> >>> >>> >> >> >>-- >>Alexey >> ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-08-07 2:46 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-08-06 9:49 [PATCH v3 0/4] drivers/vfio: EEH Compile and compatibility Gavin Shan 2014-08-06 9:49 ` [PATCH v3 1/4] powerpc/eeh: Export eeh_iommu_group_to_pe() Gavin Shan 2014-08-06 9:49 ` [PATCH v3 2/4] drivers/vfio: Fix EEH build error Gavin Shan 2014-08-06 9:49 ` [PATCH v3 3/4] drivers/vfio: Allow EEH to be built as module Gavin Shan 2014-08-06 9:49 ` [PATCH v3 4/4] drivers/vfio: Enable VFIO if EEH is not supported Gavin Shan 2014-08-06 12:50 ` Alex Williamson 2014-08-06 13:05 ` Alexey Kardashevskiy 2014-08-07 2:10 ` Gavin Shan 2014-08-07 2:46 ` Gavin Shan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).