linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
@ 2017-06-06 12:09 Murilo Opsfelder Araujo
  2017-06-07 10:49 ` Michael Ellerman
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Murilo Opsfelder Araujo @ 2017-06-06 12:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: kvm, Alex Williamson, Michael Ellerman, linuxppc-dev,
	Murilo Opsfelder Araujo

When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the
following:

    drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
    vfio_pci.c:(.text+0xa98): undefined reference to `.vfio_spapr_pci_eeh_release'
    drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_open':
    vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'

In this case, vfio_pci.c should use the empty definitions of
vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.

This patch fixes it by guarding these function definitions with
CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is
built, which is where the non-empty versions of these functions are.

This issue was found during a randconfig build. Logs are here:

    http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/

Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
---
 include/linux/vfio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index edf9b2c..0a05d57 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -150,7 +150,7 @@ extern int vfio_set_irqs_validate_and_prepare(struct vfio_irq_set *hdr,
 					      size_t *data_size);
 
 struct pci_dev;
-#ifdef CONFIG_EEH
+#ifdef CONFIG_VFIO_SPAPR_EEH
 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,
@@ -171,7 +171,7 @@ static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
 {
 	return -ENOTTY;
 }
-#endif /* CONFIG_EEH */
+#endif /* CONFIG_VFIO_SPAPR_EEH */
 
 /*
  * IRQfd - generic
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
  2017-06-06 12:09 [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH Murilo Opsfelder Araujo
@ 2017-06-07 10:49 ` Michael Ellerman
  2017-06-07 16:31 ` kbuild test robot
  2017-06-08  0:06 ` [PATCH v2] " Murilo Opsfelder Araujo
  2 siblings, 0 replies; 11+ messages in thread
From: Michael Ellerman @ 2017-06-07 10:49 UTC (permalink / raw)
  To: Murilo Opsfelder Araujo, linux-kernel
  Cc: kvm, Alex Williamson, linuxppc-dev, Murilo Opsfelder Araujo

Murilo Opsfelder Araujo <mopsfelder@gmail.com> writes:

> When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the
> following:
>
>     drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
>     vfio_pci.c:(.text+0xa98): undefined reference to `.vfio_spapr_pci_eeh_release'
>     drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_open':
>     vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'
>
> In this case, vfio_pci.c should use the empty definitions of
> vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.
>
> This patch fixes it by guarding these function definitions with
> CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is
> built, which is where the non-empty versions of these functions are.
>
> This issue was found during a randconfig build. Logs are here:
>
>     http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/
>
> Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
> ---
>  include/linux/vfio.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

Alex I assume you will take this, thanks.

cheers

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
  2017-06-06 12:09 [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH Murilo Opsfelder Araujo
  2017-06-07 10:49 ` Michael Ellerman
@ 2017-06-07 16:31 ` kbuild test robot
  2017-06-08  5:35   ` Alexey Kardashevskiy
  2017-06-08  0:06 ` [PATCH v2] " Murilo Opsfelder Araujo
  2 siblings, 1 reply; 11+ messages in thread
From: kbuild test robot @ 2017-06-07 16:31 UTC (permalink / raw)
  To: Murilo Opsfelder Araujo
  Cc: kbuild-all, linux-kernel, kvm, Alex Williamson, Michael Ellerman,
	linuxppc-dev, Murilo Opsfelder Araujo

[-- Attachment #1: Type: text/plain, Size: 4227 bytes --]

Hi Murilo,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.12-rc4 next-20170607]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Murilo-Opsfelder-Araujo/include-linux-vfio-h-Guard-powerpc-specific-functions-with-CONFIG_VFIO_SPAPR_EEH/20170607-000643
config: powerpc-allmodconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

>> drivers/vfio/vfio_spapr_eeh.c:22:6: error: redefinition of 'vfio_spapr_pci_eeh_open'
    void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
         ^~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
   include/linux/vfio.h:160:20: note: previous definition of 'vfio_spapr_pci_eeh_open' was here
    static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
                       ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/vfio/vfio_spapr_eeh.c:28:6: error: redefinition of 'vfio_spapr_pci_eeh_release'
    void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
   include/linux/vfio.h:164:20: note: previous definition of 'vfio_spapr_pci_eeh_release' was here
    static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/vfio/vfio_spapr_eeh.c:34:6: error: redefinition of 'vfio_spapr_iommu_eeh_ioctl'
    long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
   include/linux/vfio.h:168:20: note: previous definition of 'vfio_spapr_iommu_eeh_ioctl' was here
    static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/vfio_spapr_pci_eeh_open +22 drivers/vfio/vfio_spapr_eeh.c

1b69be5e Gavin Shan           2014-06-10  16  
89a2edd6 Alexey Kardashevskiy 2014-08-08  17  #define DRIVER_VERSION	"0.1"
89a2edd6 Alexey Kardashevskiy 2014-08-08  18  #define DRIVER_AUTHOR	"Gavin Shan, IBM Corporation"
89a2edd6 Alexey Kardashevskiy 2014-08-08  19  #define DRIVER_DESC	"VFIO IOMMU SPAPR EEH"
89a2edd6 Alexey Kardashevskiy 2014-08-08  20  
1b69be5e Gavin Shan           2014-06-10  21  /* We might build address mapping here for "fast" path later */
9b936c96 Alexey Kardashevskiy 2014-08-08 @22  void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
1b69be5e Gavin Shan           2014-06-10  23  {
9b936c96 Alexey Kardashevskiy 2014-08-08  24  	eeh_dev_open(pdev);
1b69be5e Gavin Shan           2014-06-10  25  }
92d18a68 Gavin Shan           2014-08-08  26  EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open);
1b69be5e Gavin Shan           2014-06-10  27  
1b69be5e Gavin Shan           2014-06-10 @28  void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
1b69be5e Gavin Shan           2014-06-10  29  {
1b69be5e Gavin Shan           2014-06-10  30  	eeh_dev_release(pdev);
1b69be5e Gavin Shan           2014-06-10  31  }
92d18a68 Gavin Shan           2014-08-08  32  EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_release);
1b69be5e Gavin Shan           2014-06-10  33  
1b69be5e Gavin Shan           2014-06-10 @34  long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
1b69be5e Gavin Shan           2014-06-10  35  				unsigned int cmd, unsigned long arg)
1b69be5e Gavin Shan           2014-06-10  36  {
1b69be5e Gavin Shan           2014-06-10  37  	struct eeh_pe *pe;

:::::: The code at line 22 was first introduced by commit
:::::: 9b936c960f22954bfb89f2fefd8f96916bb42908 drivers/vfio: Enable VFIO if EEH is not supported

:::::: TO: Alexey Kardashevskiy <aik@ozlabs.ru>
:::::: CC: Alex Williamson <alex.williamson@redhat.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 54443 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
  2017-06-06 12:09 [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH Murilo Opsfelder Araujo
  2017-06-07 10:49 ` Michael Ellerman
  2017-06-07 16:31 ` kbuild test robot
@ 2017-06-08  0:06 ` Murilo Opsfelder Araujo
  2 siblings, 0 replies; 11+ messages in thread
From: Murilo Opsfelder Araujo @ 2017-06-08  0:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: kvm, Alex Williamson, Michael Ellerman, linuxppc-dev,
	kbuild test robot, kbuild-all, Murilo Opsfelder Araujo

When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the
following:

    drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
    vfio_pci.c:(.text+0xa98): undefined reference to `.vfio_spapr_pci_eeh_release'
    drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_open':
    vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'

In this case, vfio_pci.c should use the empty definitions of
vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.

This patch fixes it by guarding these function definitions with
CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is
built, which is where the non-empty versions of these functions are. We need to
make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate
option.

This issue was found during a randconfig build. Logs are here:

    http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/

Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
---
v1..v2:
- Make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate
  option (fix http://www.spinics.net/lists/kvm/msg151032.html).

 include/linux/vfio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index edf9b2c..92232f73 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -150,7 +150,7 @@ extern int vfio_set_irqs_validate_and_prepare(struct vfio_irq_set *hdr,
 					      size_t *data_size);
 
 struct pci_dev;
-#ifdef CONFIG_EEH
+#if IS_ENABLED(CONFIG_VFIO_SPAPR_EEH)
 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,
@@ -171,7 +171,7 @@ static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
 {
 	return -ENOTTY;
 }
-#endif /* CONFIG_EEH */
+#endif /* CONFIG_VFIO_SPAPR_EEH */
 
 /*
  * IRQfd - generic
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
  2017-06-07 16:31 ` kbuild test robot
@ 2017-06-08  5:35   ` Alexey Kardashevskiy
  2017-06-08  5:36     ` Alexey Kardashevskiy
  2017-06-08 11:41     ` Michael Ellerman
  0 siblings, 2 replies; 11+ messages in thread
From: Alexey Kardashevskiy @ 2017-06-08  5:35 UTC (permalink / raw)
  To: kbuild test robot, Murilo Opsfelder Araujo
  Cc: kbuild-all, linux-kernel, kvm, Alex Williamson, Michael Ellerman,
	linuxppc-dev

Hi,

How did you manage to have CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n? "make
oldconfig" fixes this to CONFIG_VFIO_SPAPR_EEH=y.



On 08/06/17 02:31, kbuild test robot wrote:
> Hi Murilo,
> 
> [auto build test ERROR on linus/master]
> [also build test ERROR on v4.12-rc4 next-20170607]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Murilo-Opsfelder-Araujo/include-linux-vfio-h-Guard-powerpc-specific-functions-with-CONFIG_VFIO_SPAPR_EEH/20170607-000643
> config: powerpc-allmodconfig (attached as .config)
> compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
>         wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=powerpc 
> 
> All errors (new ones prefixed by >>):
> 
>>> drivers/vfio/vfio_spapr_eeh.c:22:6: error: redefinition of 'vfio_spapr_pci_eeh_open'
>     void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>          ^~~~~~~~~~~~~~~~~~~~~~~
>    In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
>    include/linux/vfio.h:160:20: note: previous definition of 'vfio_spapr_pci_eeh_open' was here
>     static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>                        ^~~~~~~~~~~~~~~~~~~~~~~
>>> drivers/vfio/vfio_spapr_eeh.c:28:6: error: redefinition of 'vfio_spapr_pci_eeh_release'
>     void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>          ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
>    include/linux/vfio.h:164:20: note: previous definition of 'vfio_spapr_pci_eeh_release' was here
>     static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>> drivers/vfio/vfio_spapr_eeh.c:34:6: error: redefinition of 'vfio_spapr_iommu_eeh_ioctl'
>     long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>          ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
>    include/linux/vfio.h:168:20: note: previous definition of 'vfio_spapr_iommu_eeh_ioctl' was here
>     static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> vim +/vfio_spapr_pci_eeh_open +22 drivers/vfio/vfio_spapr_eeh.c
> 
> 1b69be5e Gavin Shan           2014-06-10  16  
> 89a2edd6 Alexey Kardashevskiy 2014-08-08  17  #define DRIVER_VERSION	"0.1"
> 89a2edd6 Alexey Kardashevskiy 2014-08-08  18  #define DRIVER_AUTHOR	"Gavin Shan, IBM Corporation"
> 89a2edd6 Alexey Kardashevskiy 2014-08-08  19  #define DRIVER_DESC	"VFIO IOMMU SPAPR EEH"
> 89a2edd6 Alexey Kardashevskiy 2014-08-08  20  
> 1b69be5e Gavin Shan           2014-06-10  21  /* We might build address mapping here for "fast" path later */
> 9b936c96 Alexey Kardashevskiy 2014-08-08 @22  void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
> 1b69be5e Gavin Shan           2014-06-10  23  {
> 9b936c96 Alexey Kardashevskiy 2014-08-08  24  	eeh_dev_open(pdev);
> 1b69be5e Gavin Shan           2014-06-10  25  }
> 92d18a68 Gavin Shan           2014-08-08  26  EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open);
> 1b69be5e Gavin Shan           2014-06-10  27  
> 1b69be5e Gavin Shan           2014-06-10 @28  void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
> 1b69be5e Gavin Shan           2014-06-10  29  {
> 1b69be5e Gavin Shan           2014-06-10  30  	eeh_dev_release(pdev);
> 1b69be5e Gavin Shan           2014-06-10  31  }
> 92d18a68 Gavin Shan           2014-08-08  32  EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_release);
> 1b69be5e Gavin Shan           2014-06-10  33  
> 1b69be5e Gavin Shan           2014-06-10 @34  long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
> 1b69be5e Gavin Shan           2014-06-10  35  				unsigned int cmd, unsigned long arg)
> 1b69be5e Gavin Shan           2014-06-10  36  {
> 1b69be5e Gavin Shan           2014-06-10  37  	struct eeh_pe *pe;
> 
> :::::: The code at line 22 was first introduced by commit
> :::::: 9b936c960f22954bfb89f2fefd8f96916bb42908 drivers/vfio: Enable VFIO if EEH is not supported
> 
> :::::: TO: Alexey Kardashevskiy <aik@ozlabs.ru>
> :::::: CC: Alex Williamson <alex.williamson@redhat.com>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
  2017-06-08  5:35   ` Alexey Kardashevskiy
@ 2017-06-08  5:36     ` Alexey Kardashevskiy
  2017-06-13  8:36       ` [kbuild-all] " Ye Xiaolong
  2017-06-08 11:41     ` Michael Ellerman
  1 sibling, 1 reply; 11+ messages in thread
From: Alexey Kardashevskiy @ 2017-06-08  5:36 UTC (permalink / raw)
  To: kbuild test robot, Murilo Opsfelder Araujo
  Cc: kbuild-all, linux-kernel, kvm, Alex Williamson, Michael Ellerman,
	linuxppc-dev

On 08/06/17 15:35, Alexey Kardashevskiy wrote:
> Hi,
> 
> How did you manage to have CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n? "make
> oldconfig" fixes this to CONFIG_VFIO_SPAPR_EEH=y.


Also, the attached config has "CONFIG_VFIO_SPAPR_EEH=m" and cannot produce
the error below, what am I missing here?



> 
> 
> 
> On 08/06/17 02:31, kbuild test robot wrote:
>> Hi Murilo,
>>
>> [auto build test ERROR on linus/master]
>> [also build test ERROR on v4.12-rc4 next-20170607]
>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>
>> url:    https://github.com/0day-ci/linux/commits/Murilo-Opsfelder-Araujo/include-linux-vfio-h-Guard-powerpc-specific-functions-with-CONFIG_VFIO_SPAPR_EEH/20170607-000643
>> config: powerpc-allmodconfig (attached as .config)
>> compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
>> reproduce:
>>         wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>         chmod +x ~/bin/make.cross
>>         # save the attached .config to linux build tree
>>         make.cross ARCH=powerpc 
>>
>> All errors (new ones prefixed by >>):
>>
>>>> drivers/vfio/vfio_spapr_eeh.c:22:6: error: redefinition of 'vfio_spapr_pci_eeh_open'
>>     void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>>          ^~~~~~~~~~~~~~~~~~~~~~~
>>    In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
>>    include/linux/vfio.h:160:20: note: previous definition of 'vfio_spapr_pci_eeh_open' was here
>>     static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>>                        ^~~~~~~~~~~~~~~~~~~~~~~
>>>> drivers/vfio/vfio_spapr_eeh.c:28:6: error: redefinition of 'vfio_spapr_pci_eeh_release'
>>     void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>>          ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>    In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
>>    include/linux/vfio.h:164:20: note: previous definition of 'vfio_spapr_pci_eeh_release' was here
>>     static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>>> drivers/vfio/vfio_spapr_eeh.c:34:6: error: redefinition of 'vfio_spapr_iommu_eeh_ioctl'
>>     long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>>          ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>    In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
>>    include/linux/vfio.h:168:20: note: previous definition of 'vfio_spapr_iommu_eeh_ioctl' was here
>>     static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> vim +/vfio_spapr_pci_eeh_open +22 drivers/vfio/vfio_spapr_eeh.c
>>
>> 1b69be5e Gavin Shan           2014-06-10  16  
>> 89a2edd6 Alexey Kardashevskiy 2014-08-08  17  #define DRIVER_VERSION	"0.1"
>> 89a2edd6 Alexey Kardashevskiy 2014-08-08  18  #define DRIVER_AUTHOR	"Gavin Shan, IBM Corporation"
>> 89a2edd6 Alexey Kardashevskiy 2014-08-08  19  #define DRIVER_DESC	"VFIO IOMMU SPAPR EEH"
>> 89a2edd6 Alexey Kardashevskiy 2014-08-08  20  
>> 1b69be5e Gavin Shan           2014-06-10  21  /* We might build address mapping here for "fast" path later */
>> 9b936c96 Alexey Kardashevskiy 2014-08-08 @22  void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>> 1b69be5e Gavin Shan           2014-06-10  23  {
>> 9b936c96 Alexey Kardashevskiy 2014-08-08  24  	eeh_dev_open(pdev);
>> 1b69be5e Gavin Shan           2014-06-10  25  }
>> 92d18a68 Gavin Shan           2014-08-08  26  EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open);
>> 1b69be5e Gavin Shan           2014-06-10  27  
>> 1b69be5e Gavin Shan           2014-06-10 @28  void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>> 1b69be5e Gavin Shan           2014-06-10  29  {
>> 1b69be5e Gavin Shan           2014-06-10  30  	eeh_dev_release(pdev);
>> 1b69be5e Gavin Shan           2014-06-10  31  }
>> 92d18a68 Gavin Shan           2014-08-08  32  EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_release);
>> 1b69be5e Gavin Shan           2014-06-10  33  
>> 1b69be5e Gavin Shan           2014-06-10 @34  long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>> 1b69be5e Gavin Shan           2014-06-10  35  				unsigned int cmd, unsigned long arg)
>> 1b69be5e Gavin Shan           2014-06-10  36  {
>> 1b69be5e Gavin Shan           2014-06-10  37  	struct eeh_pe *pe;
>>
>> :::::: The code at line 22 was first introduced by commit
>> :::::: 9b936c960f22954bfb89f2fefd8f96916bb42908 drivers/vfio: Enable VFIO if EEH is not supported
>>
>> :::::: TO: Alexey Kardashevskiy <aik@ozlabs.ru>
>> :::::: CC: Alex Williamson <alex.williamson@redhat.com>
>>
>> ---
>> 0-DAY kernel test infrastructure                Open Source Technology Center
>> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
>>
> 
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
  2017-06-08  5:35   ` Alexey Kardashevskiy
  2017-06-08  5:36     ` Alexey Kardashevskiy
@ 2017-06-08 11:41     ` Michael Ellerman
  2017-06-08 12:45       ` Murilo Opsfelder Araújo
  1 sibling, 1 reply; 11+ messages in thread
From: Michael Ellerman @ 2017-06-08 11:41 UTC (permalink / raw)
  To: Alexey Kardashevskiy, kbuild test robot, Murilo Opsfelder Araujo
  Cc: kbuild-all, linux-kernel, kvm, Alex Williamson, linuxppc-dev

Alexey Kardashevskiy <aik@ozlabs.ru> writes:

> Hi,
>
> How did you manage to have CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n? "make
> oldconfig" fixes this to CONFIG_VFIO_SPAPR_EEH=y.

Hmm, Murilo did you confirm the bug still happens on upstream with that
rand config?

cheers

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
  2017-06-08 11:41     ` Michael Ellerman
@ 2017-06-08 12:45       ` Murilo Opsfelder Araújo
  2017-06-08 13:10         ` Alexey Kardashevskiy
  0 siblings, 1 reply; 11+ messages in thread
From: Murilo Opsfelder Araújo @ 2017-06-08 12:45 UTC (permalink / raw)
  To: Michael Ellerman, Alexey Kardashevskiy, kbuild test robot
  Cc: kbuild-all, linux-kernel, kvm, Alex Williamson, linuxppc-dev

On 06/08/2017 08:41 AM, Michael Ellerman wrote:
> Alexey Kardashevskiy <aik@ozlabs.ru> writes:
> 
>> Hi,
>>
>> How did you manage to have CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n? "make
>> oldconfig" fixes this to CONFIG_VFIO_SPAPR_EEH=y.
> 
> Hmm, Murilo did you confirm the bug still happens on upstream with that
> rand config?

Yes, it's still happening with next-20170607.

For me, `make oldconfig` hasn't changed it to CONFIG_VFIO_SPAPR_EEH=y. See:

    $ git clean -dfxq
    $ git reset --hard origin/master
    HEAD is now at 8d1b80c Add linux-next specific files for 20170607

    $ curl http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/config/ -o .config
    $ grep -E 'EEH|SPAPR' .config
    CONFIG_EEH=y
    # CONFIG_SPAPR_TCE_IOMMU is not set

    $ yes '' | make oldconfig

    $ grep -E 'EEH|SPAPR' .config
    CONFIG_EEH=y
    # CONFIG_SPAPR_TCE_IOMMU is not set

    $ make -j 160 ARCH=powerpc
    ...
    drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
    vfio_pci.c:(.text+0xa98): undefined reference to `.vfio_spapr_pci_eeh_release'
    drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_open':
    vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'
    make: *** [vmlinux] Error 1

-- 
Murilo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
  2017-06-08 12:45       ` Murilo Opsfelder Araújo
@ 2017-06-08 13:10         ` Alexey Kardashevskiy
  2017-06-08 15:32           ` Murilo Opsfelder Araújo
  0 siblings, 1 reply; 11+ messages in thread
From: Alexey Kardashevskiy @ 2017-06-08 13:10 UTC (permalink / raw)
  To: Murilo Opsfelder Araújo, Michael Ellerman, kbuild test robot
  Cc: kbuild-all, linux-kernel, kvm, Alex Williamson, linuxppc-dev

On 08/06/17 22:45, Murilo Opsfelder Araújo wrote:
> On 06/08/2017 08:41 AM, Michael Ellerman wrote:
>> Alexey Kardashevskiy <aik@ozlabs.ru> writes:
>>
>>> Hi,
>>>
>>> How did you manage to have CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n? "make
>>> oldconfig" fixes this to CONFIG_VFIO_SPAPR_EEH=y.
>>
>> Hmm, Murilo did you confirm the bug still happens on upstream with that
>> rand config?
> 
> Yes, it's still happening with next-20170607.


The config you attached in the first mail has CONFIG_VFIO_SPAPR_EEH=m, here
is my confusion. The config from the link below does not have KVM_BOOK3S_64
which selects SPAPR_TCE_IOMMU and which in turn selects VFIO_IOMMU_SPAPR_TCE.

So
https://github.com/0day-ci/linux/commit/36ed1ddb05e132aa3cfbb610f0f8402a0774da12
looks correct.



> 
> For me, `make oldconfig` hasn't changed it to CONFIG_VFIO_SPAPR_EEH=y. See:
> 
>     $ git clean -dfxq
>     $ git reset --hard origin/master
>     HEAD is now at 8d1b80c Add linux-next specific files for 20170607
> 
>     $ curl http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/config/ -o .config
>     $ grep -E 'EEH|SPAPR' .config
>     CONFIG_EEH=y
>     # CONFIG_SPAPR_TCE_IOMMU is not set
> 
>     $ yes '' | make oldconfig
> 
>     $ grep -E 'EEH|SPAPR' .config
>     CONFIG_EEH=y
>     # CONFIG_SPAPR_TCE_IOMMU is not set
> 
>     $ make -j 160 ARCH=powerpc
>     ...
>     drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
>     vfio_pci.c:(.text+0xa98): undefined reference to `.vfio_spapr_pci_eeh_release'
>     drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_open':
>     vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'
>     make: *** [vmlinux] Error 1
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
  2017-06-08 13:10         ` Alexey Kardashevskiy
@ 2017-06-08 15:32           ` Murilo Opsfelder Araújo
  0 siblings, 0 replies; 11+ messages in thread
From: Murilo Opsfelder Araújo @ 2017-06-08 15:32 UTC (permalink / raw)
  To: Alexey Kardashevskiy, Michael Ellerman, kbuild test robot
  Cc: kbuild-all, linux-kernel, kvm, Alex Williamson, linuxppc-dev

On 06/08/2017 10:10 AM, Alexey Kardashevskiy wrote:
[...]
> The config you attached in the first mail has CONFIG_VFIO_SPAPR_EEH=m, here
> is my confusion. The config from the link below does not have KVM_BOOK3S_64
> which selects SPAPR_TCE_IOMMU and which in turn selects VFIO_IOMMU_SPAPR_TCE.
> 
> So
> https://github.com/0day-ci/linux/commit/36ed1ddb05e132aa3cfbb610f0f8402a0774da12
> looks correct.

It wasn't me that attached the .config.gz, it was this 0dayci robot.

When CONFIG_VFIO_SPAPR_EEH=m, there is no definition of it in autoconf.h, only
CONFIG_VFIO_SPAPR_EEH_MODULE is defined:

    $ grep 'VFIO_SPAPR_EEH' ./include/generated/autoconf.h
    #define CONFIG_VFIO_SPAPR_EEH_MODULE 1

In this case, `#ifdef CONFIG_VFIO_SPAPR_EEH` will be false. That's why my v1
patch failed with the 0dayci .config and robot reported back.

This was addressed in my v2 patch using the IS_ENABLED() macro, which checks for
both CONFIG_<name> and CONFIG_<name>_MODULE definitions.

-- 
Murilo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH
  2017-06-08  5:36     ` Alexey Kardashevskiy
@ 2017-06-13  8:36       ` Ye Xiaolong
  0 siblings, 0 replies; 11+ messages in thread
From: Ye Xiaolong @ 2017-06-13  8:36 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: kbuild test robot, Murilo Opsfelder Araujo, kvm,
	Michael Ellerman, linux-kernel, Alex Williamson, kbuild-all,
	linuxppc-dev

On 06/08, Alexey Kardashevskiy wrote:
>On 08/06/17 15:35, Alexey Kardashevskiy wrote:
>> Hi,
>> 
>> How did you manage to have CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n? "make
>> oldconfig" fixes this to CONFIG_VFIO_SPAPR_EEH=y.
>
>
>Also, the attached config has "CONFIG_VFIO_SPAPR_EEH=m" and cannot produce
>the error below, what am I missing here?

Sorry for the late, I can reproduce below error by following below steps with
attached config in original report:

   wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
   chmod +x ~/bin/make.cross
   # save the attached .config to linux build tree
   make.cross ARCH=powerpc 

What's your steps?

Thanks,
Xiaolong
>
>
>
>> 
>> 
>> 
>> On 08/06/17 02:31, kbuild test robot wrote:
>>> Hi Murilo,
>>>
>>> [auto build test ERROR on linus/master]
>>> [also build test ERROR on v4.12-rc4 next-20170607]
>>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>>
>>> url:    https://github.com/0day-ci/linux/commits/Murilo-Opsfelder-Araujo/include-linux-vfio-h-Guard-powerpc-specific-functions-with-CONFIG_VFIO_SPAPR_EEH/20170607-000643
>>> config: powerpc-allmodconfig (attached as .config)
>>> compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
>>> reproduce:
>>>         wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>         chmod +x ~/bin/make.cross
>>>         # save the attached .config to linux build tree
>>>         make.cross ARCH=powerpc 
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>>>> drivers/vfio/vfio_spapr_eeh.c:22:6: error: redefinition of 'vfio_spapr_pci_eeh_open'
>>>     void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>>>          ^~~~~~~~~~~~~~~~~~~~~~~
>>>    In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
>>>    include/linux/vfio.h:160:20: note: previous definition of 'vfio_spapr_pci_eeh_open' was here
>>>     static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>>>                        ^~~~~~~~~~~~~~~~~~~~~~~
>>>>> drivers/vfio/vfio_spapr_eeh.c:28:6: error: redefinition of 'vfio_spapr_pci_eeh_release'
>>>     void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>>>          ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>>    In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
>>>    include/linux/vfio.h:164:20: note: previous definition of 'vfio_spapr_pci_eeh_release' was here
>>>     static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>>>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>> drivers/vfio/vfio_spapr_eeh.c:34:6: error: redefinition of 'vfio_spapr_iommu_eeh_ioctl'
>>>     long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>>>          ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>>    In file included from drivers/vfio/vfio_spapr_eeh.c:14:0:
>>>    include/linux/vfio.h:168:20: note: previous definition of 'vfio_spapr_iommu_eeh_ioctl' was here
>>>     static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>>>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> vim +/vfio_spapr_pci_eeh_open +22 drivers/vfio/vfio_spapr_eeh.c
>>>
>>> 1b69be5e Gavin Shan           2014-06-10  16  
>>> 89a2edd6 Alexey Kardashevskiy 2014-08-08  17  #define DRIVER_VERSION	"0.1"
>>> 89a2edd6 Alexey Kardashevskiy 2014-08-08  18  #define DRIVER_AUTHOR	"Gavin Shan, IBM Corporation"
>>> 89a2edd6 Alexey Kardashevskiy 2014-08-08  19  #define DRIVER_DESC	"VFIO IOMMU SPAPR EEH"
>>> 89a2edd6 Alexey Kardashevskiy 2014-08-08  20  
>>> 1b69be5e Gavin Shan           2014-06-10  21  /* We might build address mapping here for "fast" path later */
>>> 9b936c96 Alexey Kardashevskiy 2014-08-08 @22  void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>>> 1b69be5e Gavin Shan           2014-06-10  23  {
>>> 9b936c96 Alexey Kardashevskiy 2014-08-08  24  	eeh_dev_open(pdev);
>>> 1b69be5e Gavin Shan           2014-06-10  25  }
>>> 92d18a68 Gavin Shan           2014-08-08  26  EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open);
>>> 1b69be5e Gavin Shan           2014-06-10  27  
>>> 1b69be5e Gavin Shan           2014-06-10 @28  void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>>> 1b69be5e Gavin Shan           2014-06-10  29  {
>>> 1b69be5e Gavin Shan           2014-06-10  30  	eeh_dev_release(pdev);
>>> 1b69be5e Gavin Shan           2014-06-10  31  }
>>> 92d18a68 Gavin Shan           2014-08-08  32  EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_release);
>>> 1b69be5e Gavin Shan           2014-06-10  33  
>>> 1b69be5e Gavin Shan           2014-06-10 @34  long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>>> 1b69be5e Gavin Shan           2014-06-10  35  				unsigned int cmd, unsigned long arg)
>>> 1b69be5e Gavin Shan           2014-06-10  36  {
>>> 1b69be5e Gavin Shan           2014-06-10  37  	struct eeh_pe *pe;
>>>
>>> :::::: The code at line 22 was first introduced by commit
>>> :::::: 9b936c960f22954bfb89f2fefd8f96916bb42908 drivers/vfio: Enable VFIO if EEH is not supported
>>>
>>> :::::: TO: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> :::::: CC: Alex Williamson <alex.williamson@redhat.com>
>>>
>>> ---
>>> 0-DAY kernel test infrastructure                Open Source Technology Center
>>> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
>>>
>> 
>> 
>
>
>-- 
>Alexey
>_______________________________________________
>kbuild-all mailing list
>kbuild-all@lists.01.org
>https://lists.01.org/mailman/listinfo/kbuild-all

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-06-13  8:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 12:09 [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH Murilo Opsfelder Araujo
2017-06-07 10:49 ` Michael Ellerman
2017-06-07 16:31 ` kbuild test robot
2017-06-08  5:35   ` Alexey Kardashevskiy
2017-06-08  5:36     ` Alexey Kardashevskiy
2017-06-13  8:36       ` [kbuild-all] " Ye Xiaolong
2017-06-08 11:41     ` Michael Ellerman
2017-06-08 12:45       ` Murilo Opsfelder Araújo
2017-06-08 13:10         ` Alexey Kardashevskiy
2017-06-08 15:32           ` Murilo Opsfelder Araújo
2017-06-08  0:06 ` [PATCH v2] " Murilo Opsfelder Araujo

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