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

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE141d

2 messages, 2 authors, 2026-05-26 · open the first message on its own page

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

From: Arnd Bergmann <arnd@kernel.org>
Date: 2026-05-26 10:21:45

From: Arnd Bergmann <arnd@arndb.de>

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/powerpc/platforms/pseries/svm.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/svm.c b/arch/powerpc/platforms/pseries/svm.c
index 384c9dc1899a..ab8f8c722741 100644
--- a/arch/powerpc/platforms/pseries/svm.c
+++ b/arch/powerpc/platforms/pseries/svm.c
@@ -6,6 +6,7 @@
  * Author: Anshuman Khandual <khandual@linux.vnet.ibm.com>
  */
 
+#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)
-- 
2.39.5

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

From: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Date: 2026-05-26 11:54:04

Hi Arnd,

Le 26/05/2026 à 12:20, Arnd Bergmann a écrit :
From: Arnd Bergmann <arnd@arndb.de>

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/ahPqbfH54R3JJyaV@infradead.org/

Christophe
quoted hunk
Fixes: fd55edff8a0a ("dma-buf: heaps: system: Turn the heap into a module")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
  arch/powerpc/platforms/pseries/svm.c | 3 +++
  1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/svm.c b/arch/powerpc/platforms/pseries/svm.c
index 384c9dc1899a..ab8f8c722741 100644
--- a/arch/powerpc/platforms/pseries/svm.c
+++ b/arch/powerpc/platforms/pseries/svm.c
@@ -6,6 +6,7 @@
   * Author: Anshuman Khandual <khandual@linux.vnet.ibm.com>
   */
  
+#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)

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help