Linux-Next Archive on lore.kernel.org
 help / color / Atom feed
* linux-next: build failure after merge of the iommu tree
@ 2019-09-02  6:39 Stephen Rothwell
  2019-09-02 14:03 ` Joerg Roedel
  0 siblings, 1 reply; 20+ messages in thread
From: Stephen Rothwell @ 2019-09-02  6:39 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: Linux Next Mailing List, Linux Kernel Mailing List

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

Hi all,

After merging the iommu tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:

drivers/iommu/iommu.c: In function 'iommu_subsys_init':
drivers/iommu/iommu.c:123:38: error: implicit declaration of function 'sme_active'; did you mean 'cpu_active'? [-Werror=implicit-function-declaration]
  123 |   if (iommu_default_passthrough() && sme_active()) {
      |                                      ^~~~~~~~~~
      |                                      cpu_active

Caused by commit

  2cc13bb4f59f ("iommu: Disable passthrough mode when SME is active")

sme_active() seems to be only relevant to X86.

I have reverted that commit for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: build failure after merge of the iommu tree
  2019-09-02  6:39 linux-next: build failure after merge of the iommu tree Stephen Rothwell
@ 2019-09-02 14:03 ` Joerg Roedel
  2019-09-02 14:26   ` Lendacky, Thomas
  0 siblings, 1 reply; 20+ messages in thread
From: Joerg Roedel @ 2019-09-02 14:03 UTC (permalink / raw)
  To: Stephen Rothwell, Thiago Jung Bauermann, Michael Ellerman, Tom Lendacky
  Cc: Linux Next Mailing List, Linux Kernel Mailing List

Hi,

tl;dr: And IOMMU commit introduces a new user for sme_active() in
       generic code, and commit

       	284e21fab2cf x86, s390/mm: Move sme_active() and sme_me_mask to x86-specific header

       breaks the build of drivers/iommu/ for all architectures not
       implementing sme_active().

On Mon, Sep 02, 2019 at 04:39:51PM +1000, Stephen Rothwell wrote:
> drivers/iommu/iommu.c: In function 'iommu_subsys_init':
> drivers/iommu/iommu.c:123:38: error: implicit declaration of function 'sme_active'; did you mean 'cpu_active'? [-Werror=implicit-function-declaration]
>   123 |   if (iommu_default_passthrough() && sme_active()) {
>       |                                      ^~~~~~~~~~
>       |                                      cpu_active
> 
> Caused by commit
> 
>   2cc13bb4f59f ("iommu: Disable passthrough mode when SME is active")


Actually it is caused by:

	commit 284e21fab2cfcf90dacce565e0b12f29e5df00c1
	Author: Thiago Jung Bauermann <bauerman@linux.ibm.com>
	Date:   Tue Aug 6 01:49:17 2019 -0300

	    x86, s390/mm: Move sme_active() and sme_me_mask to x86-specific header

which removes the sme_active prototype from the generic headers. The
iommu commit is in next already for a couple of days and didn't cause
problems before.

> sme_active() seems to be only relevant to X86.

It has an implementation on x86 and s390.

> I have reverted that commit for today.

Thanks, but I suggest reverting above commit instead.


Regards,

	Joerg

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

* Re: linux-next: build failure after merge of the iommu tree
  2019-09-02 14:03 ` Joerg Roedel
@ 2019-09-02 14:26   ` Lendacky, Thomas
  2019-09-03  5:28     ` Stephen Rothwell
  0 siblings, 1 reply; 20+ messages in thread
From: Lendacky, Thomas @ 2019-09-02 14:26 UTC (permalink / raw)
  To: Joerg Roedel, Stephen Rothwell, Thiago Jung Bauermann, Michael Ellerman
  Cc: Linux Next Mailing List, Linux Kernel Mailing List

On 9/2/19 9:03 AM, Joerg Roedel wrote:
> Hi,
> 
> tl;dr: And IOMMU commit introduces a new user for sme_active() in
>         generic code, and commit
> 
>         	284e21fab2cf x86, s390/mm: Move sme_active() and sme_me_mask to x86-specific header
> 
>         breaks the build of drivers/iommu/ for all architectures not
>         implementing sme_active().
> 
> On Mon, Sep 02, 2019 at 04:39:51PM +1000, Stephen Rothwell wrote:
>> drivers/iommu/iommu.c: In function 'iommu_subsys_init':
>> drivers/iommu/iommu.c:123:38: error: implicit declaration of function 'sme_active'; did you mean 'cpu_active'? [-Werror=implicit-function-declaration]
>>    123 |   if (iommu_default_passthrough() && sme_active()) {

Maybe we should make this mem_encrypt_active(), since this will probably
be needed if/when an IOMMU device is eventually added to a guest, and the
referenced commit below doesn't remove that call.

Thanks,
Tom

>>        |                                      ^~~~~~~~~~
>>        |                                      cpu_active
>>
>> Caused by commit
>>
>>    2cc13bb4f59f ("iommu: Disable passthrough mode when SME is active")
> 
> 
> Actually it is caused by:
> 
> 	commit 284e21fab2cfcf90dacce565e0b12f29e5df00c1
> 	Author: Thiago Jung Bauermann <bauerman@linux.ibm.com>
> 	Date:   Tue Aug 6 01:49:17 2019 -0300
> 
> 	    x86, s390/mm: Move sme_active() and sme_me_mask to x86-specific header
> 
> which removes the sme_active prototype from the generic headers. The
> iommu commit is in next already for a couple of days and didn't cause
> problems before.
> 
>> sme_active() seems to be only relevant to X86.
> 
> It has an implementation on x86 and s390.
> 
>> I have reverted that commit for today.
> 
> Thanks, but I suggest reverting above commit instead.
> 
> 
> Regards,
> 
> 	Joerg
> 

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

* Re: linux-next: build failure after merge of the iommu tree
  2019-09-02 14:26   ` Lendacky, Thomas
@ 2019-09-03  5:28     ` Stephen Rothwell
  2019-09-03 13:20       ` [PATCH] iommu: Don't use sme_active() in generic code Joerg Roedel
  0 siblings, 1 reply; 20+ messages in thread
From: Stephen Rothwell @ 2019-09-03  5:28 UTC (permalink / raw)
  To: Lendacky, Thomas
  Cc: Joerg Roedel, Thiago Jung Bauermann, Michael Ellerman,
	Linux Next Mailing List, Linux Kernel Mailing List

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

Hi all,

On Mon, 2 Sep 2019 14:26:40 +0000 "Lendacky, Thomas" <Thomas.Lendacky@amd.com> wrote:
>
> On 9/2/19 9:03 AM, Joerg Roedel wrote:
> > 
> > tl;dr: And IOMMU commit introduces a new user for sme_active() in
> >         generic code, and commit
> > 
> >         	284e21fab2cf x86, s390/mm: Move sme_active() and sme_me_mask to x86-specific header
> > 
> >         breaks the build of drivers/iommu/ for all architectures not
> >         implementing sme_active().
> > 
> > On Mon, Sep 02, 2019 at 04:39:51PM +1000, Stephen Rothwell wrote:  
> >> drivers/iommu/iommu.c: In function 'iommu_subsys_init':
> >> drivers/iommu/iommu.c:123:38: error: implicit declaration of function 'sme_active'; did you mean 'cpu_active'? [-Werror=implicit-function-declaration]
> >>    123 |   if (iommu_default_passthrough() && sme_active()) {  
> 
> Maybe we should make this mem_encrypt_active(), since this will probably
> be needed if/when an IOMMU device is eventually added to a guest, and the
> referenced commit below doesn't remove that call.

I have done that for today:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 3 Sep 2019 15:19:34 +1000
Subject: [PATCH] iommu: use mem_encrypt_active() instead of sme_active()

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/iommu/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 66cfacaa483d..b870044ecd49 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -120,7 +120,7 @@ static int __init iommu_subsys_init(void)
 		else
 			iommu_set_default_translated(false);
 
-		if (iommu_default_passthrough() && sme_active()) {
+		if (iommu_default_passthrough() && mem_encrypt_active()) {
 			pr_info("SME detected - Disabling default IOMMU Passthrough\n");
 			iommu_set_default_translated(false);
 		}
-- 
2.23.0.rc1

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* [PATCH] iommu: Don't use sme_active() in generic code
  2019-09-03  5:28     ` Stephen Rothwell
@ 2019-09-03 13:20       ` Joerg Roedel
  2019-09-03 16:03         ` Thiago Jung Bauermann
  0 siblings, 1 reply; 20+ messages in thread
From: Joerg Roedel @ 2019-09-03 13:20 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Lendacky, Thomas, Thiago Jung Bauermann, Michael Ellerman,
	Linux Next Mailing List, Linux Kernel Mailing List

On Tue, Sep 03, 2019 at 03:28:49PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> On Mon, 2 Sep 2019 14:26:40 +0000 "Lendacky, Thomas" <Thomas.Lendacky@amd.com> wrote:
> > Maybe we should make this mem_encrypt_active(), since this will probably
> > be needed if/when an IOMMU device is eventually added to a guest, and the
> > referenced commit below doesn't remove that call.
> 
> I have done that for today:

Thanks Stephen and Tom. I queued the attached patch into the iommu tree
to fix the problem.

From 2896ba40d0becdb72b45f096cad70633abc014f6 Mon Sep 17 00:00:00 2001
From: Joerg Roedel <jroedel@suse.de>
Date: Tue, 3 Sep 2019 15:15:44 +0200
Subject: [PATCH] iommu: Don't use sme_active() in generic code

Switch to the generic function mem_encrypt_active() because
sme_active() is x86 specific and can't be called from
generic code on other platforms than x86.

Fixes: 2cc13bb4f59f ("iommu: Disable passthrough mode when SME is active")
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 66cfacaa483d..d658c7c6a2ab 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -120,8 +120,8 @@ static int __init iommu_subsys_init(void)
 		else
 			iommu_set_default_translated(false);
 
-		if (iommu_default_passthrough() && sme_active()) {
-			pr_info("SME detected - Disabling default IOMMU Passthrough\n");
+		if (iommu_default_passthrough() && mem_encrypt_active()) {
+			pr_info("Memory encryption detected - Disabling default IOMMU Passthrough\n");
 			iommu_set_default_translated(false);
 		}
 	}
-- 
2.16.4


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

* Re: [PATCH] iommu: Don't use sme_active() in generic code
  2019-09-03 13:20       ` [PATCH] iommu: Don't use sme_active() in generic code Joerg Roedel
@ 2019-09-03 16:03         ` Thiago Jung Bauermann
  0 siblings, 0 replies; 20+ messages in thread
From: Thiago Jung Bauermann @ 2019-09-03 16:03 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Stephen Rothwell, Lendacky\,
	Thomas, Michael Ellerman, Linux Next Mailing List,
	Linux Kernel Mailing List


Joerg Roedel <joro@8bytes.org> writes:

> On Tue, Sep 03, 2019 at 03:28:49PM +1000, Stephen Rothwell wrote:
>> Hi all,
>> 
>> On Mon, 2 Sep 2019 14:26:40 +0000 "Lendacky, Thomas" <Thomas.Lendacky@amd.com> wrote:
>> > Maybe we should make this mem_encrypt_active(), since this will probably
>> > be needed if/when an IOMMU device is eventually added to a guest, and the
>> > referenced commit below doesn't remove that call.
>> 
>> I have done that for today:
>
> Thanks Stephen and Tom. I queued the attached patch into the iommu tree
> to fix the problem.
>
> From 2896ba40d0becdb72b45f096cad70633abc014f6 Mon Sep 17 00:00:00 2001
> From: Joerg Roedel <jroedel@suse.de>
> Date: Tue, 3 Sep 2019 15:15:44 +0200
> Subject: [PATCH] iommu: Don't use sme_active() in generic code
>
> Switch to the generic function mem_encrypt_active() because
> sme_active() is x86 specific and can't be called from
> generic code on other platforms than x86.
>
> Fixes: 2cc13bb4f59f ("iommu: Disable passthrough mode when SME is active")
> Signed-off-by: Joerg Roedel <jroedel@suse.de>

Thank you!

-- 
Thiago Jung Bauermann
IBM Linux Technology Center

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

* Re: linux-next: build failure after merge of the iommu tree
  2015-11-01 15:14 ` Joerg Roedel
@ 2015-11-02  0:15   ` Magnus Damm
  0 siblings, 0 replies; 20+ messages in thread
From: Magnus Damm @ 2015-11-02  0:15 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: Stephen Rothwell, linux-next, linux-kernel, Magnus Damm

Hi Joerg, everyone,

On Mon, Nov 2, 2015 at 12:14 AM, Joerg Roedel <joro@8bytes.org> wrote:
> Hi Stephen,
>
> On Sun, Nov 01, 2015 at 10:42:52PM +1100, Stephen Rothwell wrote:
>> After merging the iommu tree, today's linux-next build (x86_64
>> allmodconfig) failed like this:
>>
>> drivers/iommu/ipmmu-vmsa.c:24:27: fatal error: asm/dma-iommu.h: No such file or directory
>>
>> Caused by commit
>>
>>   bad78b13e305 ("iommu/ipmmu-vmsa: Drop LPAE Kconfig dependency")
>>
>> Only arm has the include file ...
>>
>> I have used the iommu tree from next-20151022 for today.
>
> Thanks, I reverted the broken commit and will push out an updated tree
> soon.

Thanks for your help and my apologies for the breakage. I did not
expect this patch to enable build on non-ARM platforms but I can now
understand that the LPAE Kconfig bits may have been the last bit
stopping other architectures to build this driver.

I'm currently poking around with this driver on 32/64-bit ARM and
getting rid of those includes from asm/ is for sure on my TODO list.

/ magnus

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

* Re: linux-next: build failure after merge of the iommu tree
  2015-11-01 11:42 linux-next: build failure after merge of the iommu tree Stephen Rothwell
@ 2015-11-01 15:14 ` Joerg Roedel
  2015-11-02  0:15   ` Magnus Damm
  0 siblings, 1 reply; 20+ messages in thread
From: Joerg Roedel @ 2015-11-01 15:14 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Magnus Damm

Hi Stephen,

On Sun, Nov 01, 2015 at 10:42:52PM +1100, Stephen Rothwell wrote:
> After merging the iommu tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/iommu/ipmmu-vmsa.c:24:27: fatal error: asm/dma-iommu.h: No such file or directory
> 
> Caused by commit
> 
>   bad78b13e305 ("iommu/ipmmu-vmsa: Drop LPAE Kconfig dependency")
> 
> Only arm has the include file ...
> 
> I have used the iommu tree from next-20151022 for today.

Thanks, I reverted the broken commit and will push out an updated tree
soon.


	Joerg

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

* linux-next: build failure after merge of the iommu tree
@ 2015-11-01 11:42 Stephen Rothwell
  2015-11-01 15:14 ` Joerg Roedel
  0 siblings, 1 reply; 20+ messages in thread
From: Stephen Rothwell @ 2015-11-01 11:42 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: linux-next, linux-kernel, Magnus Damm

Hi Joerg,

After merging the iommu tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/iommu/ipmmu-vmsa.c:24:27: fatal error: asm/dma-iommu.h: No such file or directory

Caused by commit

  bad78b13e305 ("iommu/ipmmu-vmsa: Drop LPAE Kconfig dependency")

Only arm has the include file ...

I have used the iommu tree from next-20151022 for today.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

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

* Re: linux-next: build failure after merge of the iommu tree
  2014-11-05  2:47 Stephen Rothwell
@ 2014-11-05 11:16 ` Joerg Roedel
  0 siblings, 0 replies; 20+ messages in thread
From: Joerg Roedel @ 2014-11-05 11:16 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Olav Haugan, ppc-dev

On Wed, Nov 05, 2014 at 01:47:31PM +1100, Stephen Rothwell wrote:
> Hi Joerg,
> 
> After merging the iommu tree, today's linux-next build (powerpc
> pc64_defconfig) failed like this:
> 
> In file included from arch/powerpc/platforms/powernv/pci.c:33:0:
> arch/powerpc/include/asm/iommu.h:140:12: error: conflicting types for 'iommu_map_sg'
>  extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
>             ^
> In file included from arch/powerpc/platforms/powernv/pci.c:23:0:
> include/linux/iommu.h:311:22: note: previous definition of 'iommu_map_sg' was here
>  static inline size_t iommu_map_sg(struct iommu_domain *domain,
>                       ^
> 
> Caused by commit 315786ebbf4a ("iommu: Add iommu_map_sg() function").
> Grep is your friend ...
> 
> I have used the iommu tree from next-20141104 for today.

Thanks Stephen, I exluded the my core branch from next for now until the
issue is fixed.


	Joerg

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

* linux-next: build failure after merge of the iommu tree
@ 2014-11-05  2:47 Stephen Rothwell
  2014-11-05 11:16 ` Joerg Roedel
  0 siblings, 1 reply; 20+ messages in thread
From: Stephen Rothwell @ 2014-11-05  2:47 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: linux-next, linux-kernel, Olav Haugan, ppc-dev

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

Hi Joerg,

After merging the iommu tree, today's linux-next build (powerpc
pc64_defconfig) failed like this:

In file included from arch/powerpc/platforms/powernv/pci.c:33:0:
arch/powerpc/include/asm/iommu.h:140:12: error: conflicting types for 'iommu_map_sg'
 extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
            ^
In file included from arch/powerpc/platforms/powernv/pci.c:23:0:
include/linux/iommu.h:311:22: note: previous definition of 'iommu_map_sg' was here
 static inline size_t iommu_map_sg(struct iommu_domain *domain,
                      ^

Caused by commit 315786ebbf4a ("iommu: Add iommu_map_sg() function").
Grep is your friend ...

I have used the iommu tree from next-20141104 for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: linux-next: build failure after merge of the iommu tree
  2014-07-08  4:02 Stephen Rothwell
  2014-07-08  4:12 ` Alex Williamson
@ 2014-07-08 11:20 ` Joerg Roedel
  1 sibling, 0 replies; 20+ messages in thread
From: Joerg Roedel @ 2014-07-08 11:20 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Alex Williamson

Hi Stephen,

On Tue, Jul 08, 2014 at 02:02:46PM +1000, Stephen Rothwell wrote:
> Caused by commit c61959ecbbc6 ("iommu: Add sysfs support for IOMMUs").
> CONFIG_IOMMU_API is not set for this build.  Forgotten "static
> inline"s :-(
> 
> I have used the iommu tree from next-20140707 for today.

I have committed the patch from Alex and published a new next branch. It
should be fixed now.


Thanks,

	Joerg

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

* Re: linux-next: build failure after merge of the iommu tree
  2014-07-08  4:02 Stephen Rothwell
@ 2014-07-08  4:12 ` Alex Williamson
  2014-07-08 11:20 ` Joerg Roedel
  1 sibling, 0 replies; 20+ messages in thread
From: Alex Williamson @ 2014-07-08  4:12 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Joerg Roedel, linux-next, linux-kernel

On Tue, 2014-07-08 at 14:02 +1000, Stephen Rothwell wrote:
> Hi Joerg,
> 
> After merging the iommu tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
> 
> arch/powerpc/platforms/built-in.o:(.opd+0x29e8): multiple definition of `iommu_device_destroy'
> arch/powerpc/kernel/built-in.o:(.opd+0x5628): first defined here
> arch/powerpc/platforms/built-in.o: In function `.iommu_device_unlink':
> (.text+0x13240): multiple definition of `.iommu_device_unlink'
> arch/powerpc/kernel/built-in.o:(.text+0x2b240): first defined here
> arch/powerpc/platforms/built-in.o: In function `.iommu_device_create':
> (.text+0x13210): multiple definition of `.iommu_device_create'
> arch/powerpc/kernel/built-in.o:(.text+0x2b210): first defined here
> arch/powerpc/platforms/built-in.o: In function `.iommu_device_destroy':
> (.text+0x13220): multiple definition of `.iommu_device_destroy'
> arch/powerpc/kernel/built-in.o:(.text+0x2b220): first defined here
> arch/powerpc/platforms/built-in.o: In function `.iommu_device_link':
> (.text+0x13230): multiple definition of `.iommu_device_link'
> arch/powerpc/kernel/built-in.o:(.text+0x2b230): first defined here
> arch/powerpc/platforms/built-in.o:(.opd+0x2a00): multiple definition of `iommu_device_link'
> arch/powerpc/kernel/built-in.o:(.opd+0x5640): first defined here
> arch/powerpc/platforms/built-in.o:(.opd+0x2a18): multiple definition of `iommu_device_unlink'
> arch/powerpc/kernel/built-in.o:(.opd+0x5658): first defined here
> arch/powerpc/platforms/built-in.o:(.opd+0x29d0): multiple definition of `iommu_device_create'
> arch/powerpc/kernel/built-in.o:(.opd+0x5610): first defined here
> 
> Caused by commit c61959ecbbc6 ("iommu: Add sysfs support for IOMMUs").
> CONFIG_IOMMU_API is not set for this build.  Forgotten "static
> inline"s :-(

Yep, I already posted a patch for this:

http://lists.linuxfoundation.org/pipermail/iommu/2014-July/009123.html

Sorry for the trouble.  Thanks,

Alex

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

* linux-next: build failure after merge of the iommu tree
@ 2014-07-08  4:02 Stephen Rothwell
  2014-07-08  4:12 ` Alex Williamson
  2014-07-08 11:20 ` Joerg Roedel
  0 siblings, 2 replies; 20+ messages in thread
From: Stephen Rothwell @ 2014-07-08  4:02 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: linux-next, linux-kernel, Alex Williamson

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

Hi Joerg,

After merging the iommu tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

arch/powerpc/platforms/built-in.o:(.opd+0x29e8): multiple definition of `iommu_device_destroy'
arch/powerpc/kernel/built-in.o:(.opd+0x5628): first defined here
arch/powerpc/platforms/built-in.o: In function `.iommu_device_unlink':
(.text+0x13240): multiple definition of `.iommu_device_unlink'
arch/powerpc/kernel/built-in.o:(.text+0x2b240): first defined here
arch/powerpc/platforms/built-in.o: In function `.iommu_device_create':
(.text+0x13210): multiple definition of `.iommu_device_create'
arch/powerpc/kernel/built-in.o:(.text+0x2b210): first defined here
arch/powerpc/platforms/built-in.o: In function `.iommu_device_destroy':
(.text+0x13220): multiple definition of `.iommu_device_destroy'
arch/powerpc/kernel/built-in.o:(.text+0x2b220): first defined here
arch/powerpc/platforms/built-in.o: In function `.iommu_device_link':
(.text+0x13230): multiple definition of `.iommu_device_link'
arch/powerpc/kernel/built-in.o:(.text+0x2b230): first defined here
arch/powerpc/platforms/built-in.o:(.opd+0x2a00): multiple definition of `iommu_device_link'
arch/powerpc/kernel/built-in.o:(.opd+0x5640): first defined here
arch/powerpc/platforms/built-in.o:(.opd+0x2a18): multiple definition of `iommu_device_unlink'
arch/powerpc/kernel/built-in.o:(.opd+0x5658): first defined here
arch/powerpc/platforms/built-in.o:(.opd+0x29d0): multiple definition of `iommu_device_create'
arch/powerpc/kernel/built-in.o:(.opd+0x5610): first defined here

Caused by commit c61959ecbbc6 ("iommu: Add sysfs support for IOMMUs").
CONFIG_IOMMU_API is not set for this build.  Forgotten "static
inline"s :-(

I have used the iommu tree from next-20140707 for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: linux-next: build failure after merge of the iommu tree
  2011-12-15  4:40 Stephen Rothwell
@ 2011-12-15 10:09 ` Joerg Roedel
  0 siblings, 0 replies; 20+ messages in thread
From: Joerg Roedel @ 2011-12-15 10:09 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Alex Williamson, Jesse Barnes

Hi Stephen,

On Thu, Dec 15, 2011 at 03:40:51PM +1100, Stephen Rothwell wrote:
> After merging the iommu tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/iommu/amd_iommu.c: In function 'pci_iommuv2_capable':
> drivers/iommu/amd_iommu.c:179:3: error: 'PCI_PRI_CAP' undeclared (first use in this function)
> drivers/iommu/amd_iommu.c:180:3: error: 'PCI_PASID_CAP' undeclared (first use in this function)
> drivers/iommu/amd_iommu.c: In function 'pri_reset_while_enabled':
> drivers/iommu/amd_iommu.c:1981:38: error: 'PCI_PRI_CAP' undeclared (first use in this function)
> drivers/iommu/amd_iommu.c:1981:2: warning: passing argument 2 of 'pci_find_ext_capability' makes integer from pointer without a cast [enabled by default]
> include/linux/pci.h:712:5: note: expected 'int' but argument is of type 'const int *'
> drivers/iommu/amd_iommu.c: In function 'pci_pri_tlp_required':
> drivers/iommu/amd_iommu.c:2045:38: error: 'PCI_PRI_CAP' undeclared (first use in this function)
> drivers/iommu/amd_iommu.c:2045:2: warning: passing argument 2 of 'pci_find_ext_capability' makes integer from pointer without a cast [enabled by default]
> include/linux/pci.h:712:5: note: expected 'int' but argument is of type 'const int *'
> 
> Caused by commit 56288ab6e949 ("PCI: Fix PRI and PASID consistency") from
> the pci tree interacting with various commits from the iommu tree.
> 
> I have added the following merge fix patch (and can carry it as
> necessary).

Thanks for resolving this too. I already have a patch for this, it was
just not queued yet. I will queue it in my tree and update my next
branch.
Jesse already provided me a branch which I can pull in, so some of the
patches in his tree will also be in the iommu-tree then.


	Joerg

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

* linux-next: build failure after merge of the iommu tree
@ 2011-12-15  4:40 Stephen Rothwell
  2011-12-15 10:09 ` Joerg Roedel
  0 siblings, 1 reply; 20+ messages in thread
From: Stephen Rothwell @ 2011-12-15  4:40 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: linux-next, linux-kernel, Alex Williamson, Jesse Barnes

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

Hi Joerg,

After merging the iommu tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/iommu/amd_iommu.c: In function 'pci_iommuv2_capable':
drivers/iommu/amd_iommu.c:179:3: error: 'PCI_PRI_CAP' undeclared (first use in this function)
drivers/iommu/amd_iommu.c:180:3: error: 'PCI_PASID_CAP' undeclared (first use in this function)
drivers/iommu/amd_iommu.c: In function 'pri_reset_while_enabled':
drivers/iommu/amd_iommu.c:1981:38: error: 'PCI_PRI_CAP' undeclared (first use in this function)
drivers/iommu/amd_iommu.c:1981:2: warning: passing argument 2 of 'pci_find_ext_capability' makes integer from pointer without a cast [enabled by default]
include/linux/pci.h:712:5: note: expected 'int' but argument is of type 'const int *'
drivers/iommu/amd_iommu.c: In function 'pci_pri_tlp_required':
drivers/iommu/amd_iommu.c:2045:38: error: 'PCI_PRI_CAP' undeclared (first use in this function)
drivers/iommu/amd_iommu.c:2045:2: warning: passing argument 2 of 'pci_find_ext_capability' makes integer from pointer without a cast [enabled by default]
include/linux/pci.h:712:5: note: expected 'int' but argument is of type 'const int *'

Caused by commit 56288ab6e949 ("PCI: Fix PRI and PASID consistency") from
the pci tree interacting with various commits from the iommu tree.

I have added the following merge fix patch (and can carry it as
necessary).

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 15 Dec 2011 15:35:23 +1100
Subject: [PATCH] iommu: fix for pci identifier changes

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/iommu/amd_iommu.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 32fc99c..b1f155e 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -176,8 +176,8 @@ static bool pci_iommuv2_capable(struct pci_dev *pdev)
 {
 	static const int caps[] = {
 		PCI_EXT_CAP_ID_ATS,
-		PCI_PRI_CAP,
-		PCI_PASID_CAP,
+		PCI_EXT_CAP_ID_PRI,
+		PCI_EXT_CAP_ID_PASID,
 	};
 	int i, pos;
 
@@ -1978,7 +1978,7 @@ static int pri_reset_while_enabled(struct pci_dev *pdev)
 	u16 control;
 	int pos;
 
-	pos = pci_find_ext_capability(pdev, PCI_PRI_CAP);
+	pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
 	if (!pos)
 		return -EINVAL;
 
@@ -2042,7 +2042,7 @@ bool pci_pri_tlp_required(struct pci_dev *pdev)
 	u16 control;
 	int pos;
 
-	pos = pci_find_ext_capability(pdev, PCI_PRI_CAP);
+	pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
 	if (!pos)
 		return false;
 
-- 
1.7.7.3

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: linux-next: build failure after merge of the iommu tree
  2011-08-29  5:11 ` Ohad Ben-Cohen
@ 2011-08-29 10:42   ` Joerg Roedel
  0 siblings, 0 replies; 20+ messages in thread
From: Joerg Roedel @ 2011-08-29 10:42 UTC (permalink / raw)
  To: Ohad Ben-Cohen; +Cc: Stephen Rothwell, linux-next, linux-kernel

On Mon, Aug 29, 2011 at 08:11:53AM +0300, Ohad Ben-Cohen wrote:
> Thank you, Stephen, you're completely right of course.
> 
> Here is what we're missing (patch also attached):
> 
> >From 7a7949ca60bb0d58079b669733f9aa43015ba0f0 Mon Sep 17 00:00:00 2001
> From: Ohad Ben-Cohen <ohad@wizery.com>
> Date: Mon, 29 Aug 2011 07:57:44 +0300
> Subject: [PATCH] iommu: omap: add Kconfig OMAP dependency
> 
> Make CONFIG_OMAP_IOMMU depend on CONFIG_ARCH_OMAP so other
> allmodconfig builds won't fail.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
> ---
>  drivers/iommu/Kconfig |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> index 432463b..d901930 100644
> --- a/drivers/iommu/Kconfig
> +++ b/drivers/iommu/Kconfig
> @@ -110,6 +110,7 @@ config INTR_REMAP
>  # OMAP IOMMU support
>  config OMAP_IOMMU
>  	bool "OMAP IOMMU Support"
> +	depends on ARCH_OMAP
>  	select IOMMU_API
> 
>  config OMAP_IOVMM

Applied to arm/omap and pushed into my next branch, Thanks.

	Joerg

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

* Re: linux-next: build failure after merge of the iommu tree
  2011-08-29  3:32 Stephen Rothwell
  2011-08-29  5:11 ` Ohad Ben-Cohen
@ 2011-08-29  8:36 ` Joerg Roedel
  1 sibling, 0 replies; 20+ messages in thread
From: Joerg Roedel @ 2011-08-29  8:36 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Ohad Ben-Cohen

On Mon, Aug 29, 2011 at 01:32:37PM +1000, Stephen Rothwell wrote:
> After merging the iommu tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/iommu/omap-iommu.c:27:24: fatal error: plat/iommu.h: No such file or directory
> 
> Caused by commit fcf3a6ef4a58 ("omap: iommu/iovmm: move to dedicated
> iommu folder").  Presumably building of this code should be restricted to
> just some platforms only.
> 
> I have dropped the iommu tree for today (since I have no older working
> version).

Thanks for the report Stephen, I apply Ohads patch today so that this
should be fixed for tomorrow.

	Joerg

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

* Re: linux-next: build failure after merge of the iommu tree
  2011-08-29  3:32 Stephen Rothwell
@ 2011-08-29  5:11 ` Ohad Ben-Cohen
  2011-08-29 10:42   ` Joerg Roedel
  2011-08-29  8:36 ` Joerg Roedel
  1 sibling, 1 reply; 20+ messages in thread
From: Ohad Ben-Cohen @ 2011-08-29  5:11 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Joerg Roedel, linux-next, linux-kernel

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

On Mon, Aug 29, 2011 at 6:32 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> After merging the iommu tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> drivers/iommu/omap-iommu.c:27:24: fatal error: plat/iommu.h: No such file or directory
>
> Caused by commit fcf3a6ef4a58 ("omap: iommu/iovmm: move to dedicated
> iommu folder").  Presumably building of this code should be restricted to
> just some platforms only.

Thank you, Stephen, you're completely right of course.

Here is what we're missing (patch also attached):

>From 7a7949ca60bb0d58079b669733f9aa43015ba0f0 Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <ohad@wizery.com>
Date: Mon, 29 Aug 2011 07:57:44 +0300
Subject: [PATCH] iommu: omap: add Kconfig OMAP dependency

Make CONFIG_OMAP_IOMMU depend on CONFIG_ARCH_OMAP so other
allmodconfig builds won't fail.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/iommu/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 432463b..d901930 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -110,6 +110,7 @@ config INTR_REMAP
 # OMAP IOMMU support
 config OMAP_IOMMU
 	bool "OMAP IOMMU Support"
+	depends on ARCH_OMAP
 	select IOMMU_API

 config OMAP_IOVMM
-- 
1.7.4.1

[-- Attachment #2: 0001-iommu-omap-add-Kconfig-OMAP-dependency.patch --]
[-- Type: text/x-patch, Size: 815 bytes --]

From 7a7949ca60bb0d58079b669733f9aa43015ba0f0 Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <ohad@wizery.com>
Date: Mon, 29 Aug 2011 07:57:44 +0300
Subject: [PATCH] iommu: omap: add Kconfig OMAP dependency

Make CONFIG_OMAP_IOMMU depend on CONFIG_ARCH_OMAP so other
allmodconfig builds won't fail.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/iommu/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 432463b..d901930 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -110,6 +110,7 @@ config INTR_REMAP
 # OMAP IOMMU support
 config OMAP_IOMMU
 	bool "OMAP IOMMU Support"
+	depends on ARCH_OMAP
 	select IOMMU_API
 
 config OMAP_IOVMM
-- 
1.7.4.1


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

* linux-next: build failure after merge of the iommu tree
@ 2011-08-29  3:32 Stephen Rothwell
  2011-08-29  5:11 ` Ohad Ben-Cohen
  2011-08-29  8:36 ` Joerg Roedel
  0 siblings, 2 replies; 20+ messages in thread
From: Stephen Rothwell @ 2011-08-29  3:32 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: linux-next, linux-kernel, Ohad Ben-Cohen

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

Hi Joerg,

After merging the iommu tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/iommu/omap-iommu.c:27:24: fatal error: plat/iommu.h: No such file or directory

Caused by commit fcf3a6ef4a58 ("omap: iommu/iovmm: move to dedicated
iommu folder").  Presumably building of this code should be restricted to
just some platforms only.

I have dropped the iommu tree for today (since I have no older working
version).
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

end of thread, back to index

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-02  6:39 linux-next: build failure after merge of the iommu tree Stephen Rothwell
2019-09-02 14:03 ` Joerg Roedel
2019-09-02 14:26   ` Lendacky, Thomas
2019-09-03  5:28     ` Stephen Rothwell
2019-09-03 13:20       ` [PATCH] iommu: Don't use sme_active() in generic code Joerg Roedel
2019-09-03 16:03         ` Thiago Jung Bauermann
  -- strict thread matches above, loose matches on Subject: below --
2015-11-01 11:42 linux-next: build failure after merge of the iommu tree Stephen Rothwell
2015-11-01 15:14 ` Joerg Roedel
2015-11-02  0:15   ` Magnus Damm
2014-11-05  2:47 Stephen Rothwell
2014-11-05 11:16 ` Joerg Roedel
2014-07-08  4:02 Stephen Rothwell
2014-07-08  4:12 ` Alex Williamson
2014-07-08 11:20 ` Joerg Roedel
2011-12-15  4:40 Stephen Rothwell
2011-12-15 10:09 ` Joerg Roedel
2011-08-29  3:32 Stephen Rothwell
2011-08-29  5:11 ` Ohad Ben-Cohen
2011-08-29 10:42   ` Joerg Roedel
2011-08-29  8:36 ` Joerg Roedel

Linux-Next Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-next/0 linux-next/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-next linux-next/ https://lore.kernel.org/linux-next \
		linux-next@vger.kernel.org linux-next@archiver.kernel.org
	public-inbox-index linux-next

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-next


AGPL code for this site: git clone https://public-inbox.org/ public-inbox