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; 6+ 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] 6+ 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; 6+ 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] 6+ 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; 6+ 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] 6+ 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; 6+ 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] 6+ 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; 6+ 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] 6+ 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; 6+ 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] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ 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

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


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