Skip to contentSkip to conversation

s390: export memory encryption helper functions

PATCH In review Arnd Bergmann 6 participants 7 messages May 26 – Jun 9

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

PATCH 1/2 s390: export memory encryption helper functions

From: Arnd Bergmann <[email protected]>

The set_memory_encrypted/set_memory_decrypted functions are exported on x86 and arm64 but not on s390, which leads to a new build failure because they are now used in a loadable module:

ERROR: modpost: "set_memory_encrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!
ERROR: modpost: "set_memory_decrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!

Export these the same way we do on the other architectures.

Fixes fd55edff8a0a ("dma-buf: heaps: system: Turn the heap into a module")
---
 arch/s390/mm/init.c | 2 ++
 1 file changed, 2 insertions(+)
arch/s390/mm/init.c +2 -0
index f07168a0d3dd..d589c5e4d388 100644
@@ -124,6 +124,7 @@ int set_memory_encrypted(unsigned long vaddr, int numpages)
 	}
 	return 0;
 }
+EXPORT_SYMBOL_GPL(set_memory_encrypted);
 
 int set_memory_decrypted(unsigned long vaddr, int numpages)
 {
@@ -135,6 +136,7 @@ int set_memory_decrypted(unsigned long vaddr, int numpages)
 	}
 	return 0;
 }
+EXPORT_SYMBOL_GPL(set_memory_decrypted);
 
 /* are we a protected virtualization guest? */
 bool force_dma_unencrypted(struct device *dev)
Signature · 1 line
2.39.5
#1 lore raw

PATCH 2/2 powerpc: export memory encryption helper functions

From: Arnd Bergmann <[email protected]>

The set_memory_encrypted/set_memory_decrypted functions are exported on x86 and arm64 but not on powerpc, which leads to a new build failure because they are now used in a loadable module:

ERROR: modpost: "set_memory_encrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!
ERROR: modpost: "set_memory_decrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!

Export these the same way we do on the other architectures.

Fixes fd55edff8a0a ("dma-buf: heaps: system: Turn the heap into a module")
---
 arch/powerpc/platforms/pseries/svm.c | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/platforms/pseries/svm.c +3 -0
index 384c9dc1899a..ab8f8c722741 100644
@@ -6,6 +6,7 @@
  * Author: Anshuman Khandual <[email protected]>
  */
 
+#include <linux/export.h>
 #include <linux/mm.h>
 #include <linux/memblock.h>
 #include <linux/mem_encrypt.h>
@@ -50,6 +51,7 @@ int set_memory_encrypted(unsigned long addr, int numpages)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(set_memory_encrypted);
 
 int set_memory_decrypted(unsigned long addr, int numpages)
 {
@@ -63,6 +65,7 @@ int set_memory_decrypted(unsigned long addr, int numpages)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(set_memory_decrypted);
 
 /* There's one dispatch log per CPU. */
 #define NR_DTL_PAGE (DISPATCH_LOG_BYTES * CONFIG_NR_CPUS / PAGE_SIZE)
Signature · 1 line
2.39.5
Reviewed-by on v1 1/2
#3 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · On Tue, 26 May 2026 12:20:37 +0200 Arnd Bergmann <[email protected]> wrote:

From: Arnd Bergmann <[email protected]>

The set_memory_encrypted/set_memory_decrypted functions are exported on x86 and arm64 but not on s390, which leads to a new build failure because they are now used in a loadable module:

Quoted 7 lines

ERROR: modpost: "set_memory_encrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!
ERROR: modpost: "set_memory_decrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!

Export these the same way we do on the other architectures.

Fixes fd55edff8a0a ("dma-buf: heaps: system: Turn the heap into a module")
Quoted 24 lines
---
 arch/s390/mm/init.c | 2 ++
 1 file changed, 2 insertions(+)
arch/s390/mm/init.c +2 -0
index f07168a0d3dd..d589c5e4d388 100644
@@ -124,6 +124,7 @@ int set_memory_encrypted(unsigned long vaddr, int numpages)
 	}
 	return 0;
 }
+EXPORT_SYMBOL_GPL(set_memory_encrypted);
 
 int set_memory_decrypted(unsigned long vaddr, int numpages)
 {
@@ -135,6 +136,7 @@ int set_memory_decrypted(unsigned long vaddr, int numpages)
 	}
 	return 0;
 }
+EXPORT_SYMBOL_GPL(set_memory_decrypted);
 
 /* are we a protected virtualization guest? */
 bool force_dma_unencrypted(struct device *dev)
#2 lore raw

Re: [PATCH 2/2] powerpc: export memory encryption helper functions

In reply to Arnd Bergmann

Hi Arnd,

Le 26/05/2026 à 12:20, Arnd Bergmann a écrit :

Quoted 10 lines

From: Arnd Bergmann <[email protected]>

The set_memory_encrypted/set_memory_decrypted functions are exported on x86 and arm64 but not on powerpc, which leads to a new build failure because they are now used in a loadable module:

ERROR: modpost: "set_memory_encrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!
ERROR: modpost: "set_memory_decrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!

Export these the same way we do on the other architectures.

The same fix was rejected already, see https://lore.kernel.org/all/[email protected]/

Christophe

Quoted 35 lines
Fixes fd55edff8a0a ("dma-buf: heaps: system: Turn the heap into a module")
---
  arch/powerpc/platforms/pseries/svm.c | 3 +++
  1 file changed, 3 insertions(+)
arch/powerpc/platforms/pseries/svm.c +3 -0
index 384c9dc1899a..ab8f8c722741 100644
@@ -6,6 +6,7 @@
   * Author: Anshuman Khandual <[email protected]>
   */
 
+#include <linux/export.h>
  #include <linux/mm.h>
  #include <linux/memblock.h>
  #include <linux/mem_encrypt.h>
@@ -50,6 +51,7 @@ int set_memory_encrypted(unsigned long addr, int numpages)
 
  	return 0;
  }
+EXPORT_SYMBOL_GPL(set_memory_encrypted);
 
  int set_memory_decrypted(unsigned long addr, int numpages)
  {
@@ -63,6 +65,7 @@ int set_memory_decrypted(unsigned long addr, int numpages)
 
  	return 0;
  }
+EXPORT_SYMBOL_GPL(set_memory_decrypted);
 
  /* There's one dispatch log per CPU. */
  #define NR_DTL_PAGE (DISPATCH_LOG_BYTES * CONFIG_NR_CPUS / PAGE_SIZE)
Acked-by on v1 1/2
#4 lore raw
In reply to Arnd Bergmann

Hello,

Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The set_memory_encrypted/set_memory_decrypted functions are exported on x86 and arm64 but not on s390, which leads to a new build failure because they are now used in a loadable module:

Quoted 7 lines

ERROR: modpost: "set_memory_encrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!
ERROR: modpost: "set_memory_decrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!

Export these the same way we do on the other architectures.

Fixes fd55edff8a0a ("dma-buf: heaps: system: Turn the heap into a module")

That problem still exists as of next-20260608. Even though there is
resistance to this approach, can we please apply this patch to fix the
build failure given that we're already at -rc7? This doesn't have to stop efforts to get rid of that export for all archs.

Best regards
Uwe

reviewer Acked-by on v1 1/2
#5 lore raw
In reply to Arnd Bergmann

Am 26.05.26 um 12:20 schrieb Arnd Bergmann:

Quoted 6 lines

From: Arnd Bergmann <[email protected]>

The set_memory_encrypted/set_memory_decrypted functions are exported on x86 and arm64 but not on s390, which leads to a new build failure because they are now used in a loadable module:

Quoted 6 lines

ERROR: modpost: "set_memory_encrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!
ERROR: modpost: "set_memory_decrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!

Export these the same way we do on the other architectures.

Fixes fd55edff8a0a ("dma-buf: heaps: system: Turn the heap into a module")

This commit id was from an next tree? Seems to be no longer valid.

Quoted 1 line

@Alexander/vasily/Heiko, can you maybe queue that via the s390 fixes tree?> ---

Quoted 23 lines
  arch/s390/mm/init.c | 2 ++
  1 file changed, 2 insertions(+)
arch/s390/mm/init.c +2 -0
index f07168a0d3dd..d589c5e4d388 100644
@@ -124,6 +124,7 @@ int set_memory_encrypted(unsigned long vaddr, int numpages)
  	}
  	return 0;
  }
+EXPORT_SYMBOL_GPL(set_memory_encrypted);
 
  int set_memory_decrypted(unsigned long vaddr, int numpages)
  {
@@ -135,6 +136,7 @@ int set_memory_decrypted(unsigned long vaddr, int numpages)
  	}
  	return 0;
  }
+EXPORT_SYMBOL_GPL(set_memory_decrypted);
 
  /* are we a protected virtualization guest? */
  bool force_dma_unencrypted(struct device *dev)
maintainer
#6 lore raw
Quoted 14 lines · Christian Borntraeger

Am 26.05.26 um 12:20 schrieb Arnd Bergmann:

Quoted 6 lines

From: Arnd Bergmann <[email protected]>

The set_memory_encrypted/set_memory_decrypted functions are exported on x86 and arm64 but not on s390, which leads to a new build failure because they are now used in a loadable module:

Quoted 6 lines

ERROR: modpost: "set_memory_encrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!
ERROR: modpost: "set_memory_decrypted" [drivers/dma-buf/heaps/system_heap.ko] undefined!

Export these the same way we do on the other architectures.

Fixes fd55edff8a0a ("dma-buf: heaps: system: Turn the heap into a module")
Quoted 7 lines

This commit id was from an next tree? Seems to be no longer valid.

Quoted 1 line

@Alexander/vasily/Heiko, can you maybe queue that via the s390 fixes tree?

There is a lot of discussion ongoing for the similar powerpc patch. Waiting for the end result.

https://lore.kernel.org/all/[email protected]/