Skip to contentSkip to conversation

linux-next: build failure after merge of the iommu tree

PATCH In review Stephen Rothwell 4 participants 6 messages Sep 2, 2019 – Sep 3, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#1 lore raw

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

Quoted 9 lines · Stephen Rothwell

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 <[email protected]>
	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.

Quoted 1 line

sme_active() seems to be only relevant to X86.

It has an implementation on x86 and s390.

Quoted 1 line

I have reverted that commit for today.

Thanks, but I suggest reverting above commit instead.

Regards,

Joerg

#2 lore raw
Quoted 5 lines · Joerg Roedel

Hi,

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

Quoted 9 lines

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

Quoted 3 lines · Stephen Rothwell

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

Quoted 33 lines
Quoted 6 lines
       |                                      ^~~~~~~~~~
       |                                      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 <[email protected]>
	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.

Quoted 1 line

sme_active() seems to be only relevant to X86.

It has an implementation on x86 and s390.

Quoted 1 line

I have reverted that commit for today.

Thanks, but I suggest reverting above commit instead.

Regards,

Joerg

#3 lore raw

Hi all,

Quoted 11 lines · Thomas
Quoted 9 lines · Joerg Roedel

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

Quoted 8 lines
Quoted 4 lines · Stephen Rothwell
Quoted 3 lines

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 <[email protected]>
Date: Tue, 3 Sep 2019 15:19:34 +1000
Subject: [PATCH] iommu: use mem_encrypt_active() instead of sme_active()

---
 drivers/iommu/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/iommu.c +1 -1
index 66cfacaa483d..b870044ecd49 100644
@@ -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);
 		}
Signature · 5 lines
2.23.0.rc1

-- 
Cheers,
Stephen Rothwell
maintainer
#4 lore raw

PATCH 1/1 iommu: Don't use sme_active() in generic code

Quoted 8 lines · Stephen Rothwell

Hi all,

Quoted 3 lines · Thomas

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 <[email protected]>
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")
---
 drivers/iommu/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/iommu.c +2 -2
index 66cfacaa483d..d658c7c6a2ab 100644
@@ -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);
 		}
 	}
Signature · 1 line
2.16.4
#5 lore raw

Re: [PATCH] iommu: Don't use sme_active() in generic code

Quoted 18 lines · Joerg Roedel
Quoted 8 lines · Stephen Rothwell

Hi all,

Quoted 3 lines · Thomas

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 <[email protected]>
Date: Tue, 3 Sep 2019 15:15:44 +0200
Subject: [PATCH] iommu: Don't use sme_active() in generic code

Quoted 6 lines

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

Thank you!

Signature · 2 lines
Thiago Jung Bauermann
IBM Linux Technology Center