s390: export memory encryption helper functions
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.
--- arch/s390/mm/init.c | 2 ++ 1 file changed, 2 insertions(+)
arch/s390/mm/init.c +2 -0
@@ -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
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.
--- arch/powerpc/platforms/pseries/svm.c | 3 +++ 1 file changed, 3 insertions(+)
arch/powerpc/platforms/pseries/svm.c +3 -0
@@ -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
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")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 24 lines
--- arch/s390/mm/init.c | 2 ++ 1 file changed, 2 insertions(+)arch/s390/mm/init.c +2
-0@@ -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)
Christophe Leroy (CS GROUP)
reviewerRe: [PATCH 2/2] powerpc: export memory encryption helper functions
In reply to Arnd BergmannHi 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")Signed-off-by Arnd Bergmann <[email protected]>--- arch/powerpc/platforms/pseries/svm.c | 3 +++ 1 file changed, 3 insertions(+)arch/powerpc/platforms/pseries/svm.c +3
-0@@ -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)
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")Signed-off-by Arnd Bergmann <[email protected]>
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
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
Signed-off-by Arnd Bergmann <[email protected]>
@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@@ -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)
Heiko Carstens
maintainerQuoted 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
Signed-off-by Arnd Bergmann <[email protected]>@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.