linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config
@ 2020-04-14 14:26 Krzysztof Kozlowski
  2020-04-18 12:46 ` Joerg Roedel
  2020-04-18 15:14 ` Christophe Leroy
  0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2020-04-14 14:26 UTC (permalink / raw)
  To: Joerg Roedel, Krzysztof Kozlowski, iommu, linux-kernel
  Cc: Michael Ellerman, Geert Uytterhoeven, linuxppc-dev, netdev,
	virtualization

Although SPAPR_TCE_IOMMU itself can be compile tested on certain PowerPC
configurations, its presence makes arch/powerpc/kvm/Makefile to select
modules which do not build in such configuration.

The arch/powerpc/kvm/ modules use kvm_arch.spapr_tce_tables which exists
only with CONFIG_PPC_BOOK3S_64.  However these modules are selected when
COMPILE_TEST and SPAPR_TCE_IOMMU are chosen leading to build failures:

    In file included from arch/powerpc/include/asm/book3s/64/mmu-hash.h:20:0,
                     from arch/powerpc/kvm/book3s_64_vio_hv.c:22:
    arch/powerpc/include/asm/book3s/64/pgtable.h:17:0: error: "_PAGE_EXEC" redefined [-Werror]
     #define _PAGE_EXEC  0x00001 /* execute permission */

    In file included from arch/powerpc/include/asm/book3s/32/pgtable.h:8:0,
                     from arch/powerpc/include/asm/book3s/pgtable.h:8,
                     from arch/powerpc/include/asm/pgtable.h:18,
                     from include/linux/mm.h:95,
                     from arch/powerpc/include/asm/io.h:29,
                     from include/linux/io.h:13,
                     from include/linux/irq.h:20,
                     from arch/powerpc/include/asm/hardirq.h:6,
                     from include/linux/hardirq.h:9,
                     from include/linux/kvm_host.h:7,
                     from arch/powerpc/kvm/book3s_64_vio_hv.c:12:
    arch/powerpc/include/asm/book3s/32/hash.h:29:0: note: this is the location of the previous definition
     #define _PAGE_EXEC 0x200 /* software: exec allowed */

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Fixes: e93a1695d7fb ("iommu: Enable compile testing for some of drivers")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/iommu/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 58b4a4dbfc78..3532b1ead19d 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -362,7 +362,7 @@ config IPMMU_VMSA
 
 config SPAPR_TCE_IOMMU
 	bool "sPAPR TCE IOMMU Support"
-	depends on PPC_POWERNV || PPC_PSERIES || (PPC && COMPILE_TEST)
+	depends on PPC_POWERNV || PPC_PSERIES
 	select IOMMU_API
 	help
 	  Enables bits of IOMMU API required by VFIO. The iommu_ops
-- 
2.17.1


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

* Re: [PATCH] iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config
  2020-04-14 14:26 [PATCH] iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config Krzysztof Kozlowski
@ 2020-04-18 12:46 ` Joerg Roedel
  2020-04-18 15:14 ` Christophe Leroy
  1 sibling, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2020-04-18 12:46 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: iommu, linux-kernel, Michael Ellerman, Geert Uytterhoeven,
	linuxppc-dev, netdev, virtualization

On Tue, Apr 14, 2020 at 04:26:30PM +0200, Krzysztof Kozlowski wrote:
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Fixes: e93a1695d7fb ("iommu: Enable compile testing for some of drivers")
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/iommu/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

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

* Re: [PATCH] iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config
  2020-04-14 14:26 [PATCH] iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config Krzysztof Kozlowski
  2020-04-18 12:46 ` Joerg Roedel
@ 2020-04-18 15:14 ` Christophe Leroy
  2020-04-20  3:04   ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2020-04-18 15:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Joerg Roedel, iommu, linux-kernel
  Cc: virtualization, Geert Uytterhoeven, linuxppc-dev, netdev,
	Michael Ellerman



On 04/14/2020 02:26 PM, Krzysztof Kozlowski wrote:
> Although SPAPR_TCE_IOMMU itself can be compile tested on certain PowerPC
> configurations, its presence makes arch/powerpc/kvm/Makefile to select
> modules which do not build in such configuration.
> 
> The arch/powerpc/kvm/ modules use kvm_arch.spapr_tce_tables which exists
> only with CONFIG_PPC_BOOK3S_64.  However these modules are selected when
> COMPILE_TEST and SPAPR_TCE_IOMMU are chosen leading to build failures:
> 
>      In file included from arch/powerpc/include/asm/book3s/64/mmu-hash.h:20:0,
>                       from arch/powerpc/kvm/book3s_64_vio_hv.c:22:
>      arch/powerpc/include/asm/book3s/64/pgtable.h:17:0: error: "_PAGE_EXEC" redefined [-Werror]
>       #define _PAGE_EXEC  0x00001 /* execute permission */
> 
>      In file included from arch/powerpc/include/asm/book3s/32/pgtable.h:8:0,
>                       from arch/powerpc/include/asm/book3s/pgtable.h:8,
>                       from arch/powerpc/include/asm/pgtable.h:18,
>                       from include/linux/mm.h:95,
>                       from arch/powerpc/include/asm/io.h:29,
>                       from include/linux/io.h:13,
>                       from include/linux/irq.h:20,
>                       from arch/powerpc/include/asm/hardirq.h:6,
>                       from include/linux/hardirq.h:9,
>                       from include/linux/kvm_host.h:7,
>                       from arch/powerpc/kvm/book3s_64_vio_hv.c:12:
>      arch/powerpc/include/asm/book3s/32/hash.h:29:0: note: this is the location of the previous definition
>       #define _PAGE_EXEC 0x200 /* software: exec allowed */
> 
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Fixes: e93a1695d7fb ("iommu: Enable compile testing for some of drivers")
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>   drivers/iommu/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> index 58b4a4dbfc78..3532b1ead19d 100644
> --- a/drivers/iommu/Kconfig
> +++ b/drivers/iommu/Kconfig
> @@ -362,7 +362,7 @@ config IPMMU_VMSA
>   
>   config SPAPR_TCE_IOMMU
>   	bool "sPAPR TCE IOMMU Support"
> -	depends on PPC_POWERNV || PPC_PSERIES || (PPC && COMPILE_TEST)
> +	depends on PPC_POWERNV || PPC_PSERIES
>   	select IOMMU_API
>   	help
>   	  Enables bits of IOMMU API required by VFIO. The iommu_ops
> 

Should it be fixed the other way round, something like:

diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index 2bfeaa13befb..906707d15810 100644
--- a/arch/powerpc/kvm/Makefile
+++ b/arch/powerpc/kvm/Makefile
@@ -135,4 +135,4 @@ obj-$(CONFIG_KVM_BOOK3S_32) += kvm.o
  obj-$(CONFIG_KVM_BOOK3S_64_PR) += kvm-pr.o
  obj-$(CONFIG_KVM_BOOK3S_64_HV) += kvm-hv.o

-obj-y += $(kvm-book3s_64-builtin-objs-y)
+obj-$(CONFIG_KVM_BOOK3S_64) += $(kvm-book3s_64-builtin-objs-y)


Christophe

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

* Re: [PATCH] iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config
  2020-04-18 15:14 ` Christophe Leroy
@ 2020-04-20  3:04   ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2020-04-20  3:04 UTC (permalink / raw)
  To: Christophe Leroy, Krzysztof Kozlowski, Joerg Roedel, iommu, linux-kernel
  Cc: virtualization, Geert Uytterhoeven, linuxppc-dev, netdev

Christophe Leroy <christophe.leroy@c-s.fr> writes:
> On 04/14/2020 02:26 PM, Krzysztof Kozlowski wrote:
>> Although SPAPR_TCE_IOMMU itself can be compile tested on certain PowerPC
>> configurations, its presence makes arch/powerpc/kvm/Makefile to select
>> modules which do not build in such configuration.
>> 
>> The arch/powerpc/kvm/ modules use kvm_arch.spapr_tce_tables which exists
>> only with CONFIG_PPC_BOOK3S_64.  However these modules are selected when
>> COMPILE_TEST and SPAPR_TCE_IOMMU are chosen leading to build failures:
>> 
>>      In file included from arch/powerpc/include/asm/book3s/64/mmu-hash.h:20:0,
>>                       from arch/powerpc/kvm/book3s_64_vio_hv.c:22:
>>      arch/powerpc/include/asm/book3s/64/pgtable.h:17:0: error: "_PAGE_EXEC" redefined [-Werror]
>>       #define _PAGE_EXEC  0x00001 /* execute permission */
>> 
>>      In file included from arch/powerpc/include/asm/book3s/32/pgtable.h:8:0,
>>                       from arch/powerpc/include/asm/book3s/pgtable.h:8,
>>                       from arch/powerpc/include/asm/pgtable.h:18,
>>                       from include/linux/mm.h:95,
>>                       from arch/powerpc/include/asm/io.h:29,
>>                       from include/linux/io.h:13,
>>                       from include/linux/irq.h:20,
>>                       from arch/powerpc/include/asm/hardirq.h:6,
>>                       from include/linux/hardirq.h:9,
>>                       from include/linux/kvm_host.h:7,
>>                       from arch/powerpc/kvm/book3s_64_vio_hv.c:12:
>>      arch/powerpc/include/asm/book3s/32/hash.h:29:0: note: this is the location of the previous definition
>>       #define _PAGE_EXEC 0x200 /* software: exec allowed */
>> 
>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> Fixes: e93a1695d7fb ("iommu: Enable compile testing for some of drivers")
>> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
>> ---
>>   drivers/iommu/Kconfig | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
>> index 58b4a4dbfc78..3532b1ead19d 100644
>> --- a/drivers/iommu/Kconfig
>> +++ b/drivers/iommu/Kconfig
>> @@ -362,7 +362,7 @@ config IPMMU_VMSA
>>   
>>   config SPAPR_TCE_IOMMU
>>   	bool "sPAPR TCE IOMMU Support"
>> -	depends on PPC_POWERNV || PPC_PSERIES || (PPC && COMPILE_TEST)
>> +	depends on PPC_POWERNV || PPC_PSERIES
>>   	select IOMMU_API
>>   	help
>>   	  Enables bits of IOMMU API required by VFIO. The iommu_ops
>> 
>
> Should it be fixed the other way round, something like:

That doesn't actually fix this specific issue, the code will build but
then not link:

  ld: arch/powerpc/../../virt/kvm/vfio.o: in function `.kvm_spapr_tce_release_vfio_group':
  vfio.c:(.text.kvm_spapr_tce_release_vfio_group+0xb0): undefined reference to `.kvm_spapr_tce_release_iommu_group'
  ld: arch/powerpc/../../virt/kvm/vfio.o: in function `.kvm_vfio_set_group':
  vfio.c:(.text.kvm_vfio_set_group+0x7f4): undefined reference to `.kvm_spapr_tce_attach_iommu_group'
  ld: arch/powerpc/kvm/powerpc.o: in function `.kvm_arch_vm_ioctl':
  (.text.kvm_arch_vm_ioctl+0x1a4): undefined reference to `.kvm_vm_ioctl_create_spapr_tce'
  ld: (.text.kvm_arch_vm_ioctl+0x230): undefined reference to `.kvm_vm_ioctl_create_spapr_tce'
  make[1]: *** [/home/michael/linux/Makefile:1106: vmlinux] Error 1

> diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
> index 2bfeaa13befb..906707d15810 100644
> --- a/arch/powerpc/kvm/Makefile
> +++ b/arch/powerpc/kvm/Makefile
> @@ -135,4 +135,4 @@ obj-$(CONFIG_KVM_BOOK3S_32) += kvm.o
>   obj-$(CONFIG_KVM_BOOK3S_64_PR) += kvm-pr.o
>   obj-$(CONFIG_KVM_BOOK3S_64_HV) += kvm-hv.o
>
> -obj-y += $(kvm-book3s_64-builtin-objs-y)
> +obj-$(CONFIG_KVM_BOOK3S_64) += $(kvm-book3s_64-builtin-objs-y)

But this is probably still a good thing to do, as it would have made the
error messages clearer in this case I think.

cheers

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

end of thread, other threads:[~2020-04-20  3:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 14:26 [PATCH] iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config Krzysztof Kozlowski
2020-04-18 12:46 ` Joerg Roedel
2020-04-18 15:14 ` Christophe Leroy
2020-04-20  3:04   ` Michael Ellerman

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