linux-next: build failure after merge of the iommu tree
Subsystems (2)
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_activeCaused 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
Joerg Roedel
maintainerHi,
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_activeCaused 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
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
284e21fab2cfx86, s390/mm: Movesme_active()andsme_me_maskto x86-specific headerbreaks the build of
drivers/iommu/for all architectures not implementingsme_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_activeCaused 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 headerwhich removes the
sme_activeprototype 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
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
284e21fab2cfx86, s390/mm: Movesme_active()andsme_me_maskto x86-specific headerbreaks the build of
drivers/iommu/for all architectures not implementingsme_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
@@ -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
Joerg Roedel
maintainerPATCH 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.
--- drivers/iommu/iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/iommu.c +2 -2
@@ -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
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
2896ba40d0becdb72b45f096cad70633abc014f6Mon 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 usesme_active()in generic code
Quoted 6 lines
Switch to the generic function
mem_encrypt_active()becausesme_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 <[email protected]>
Thank you!
Signature · 2 lines
Thiago Jung Bauermann IBM Linux Technology Center