diff mbox series

[1/2] asm-generic: export: Stub EXPORT_SYMBOL with __DISABLE_EXPORTS

Message ID 20210203141931.615898-2-qperret@google.com (mailing list archive)
State New, archived
Headers show
Series KVM: arm64: Stub exports in nvhe code | expand

Commit Message

Quentin Perret Feb. 3, 2021, 2:19 p.m. UTC
It is currently possible to stub EXPORT_SYMBOL() macros in C code using
__DISABLE_EXPORTS, which is necessary to run in constrained environments
such as the EFI stub or the decompressor. But this currently doesn't
apply to exports from assembly, which can lead to somewhat confusing
situations.

Consolidate the __DISABLE_EXPORTS infrastructure by checking it from
asm-generic/export.h as well.

Signed-off-by: Quentin Perret <qperret@google.com>
---
 include/asm-generic/export.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Will Deacon Feb. 3, 2021, 3:24 p.m. UTC | #1
On Wed, Feb 03, 2021 at 02:19:30PM +0000, Quentin Perret wrote:
> It is currently possible to stub EXPORT_SYMBOL() macros in C code using
> __DISABLE_EXPORTS, which is necessary to run in constrained environments
> such as the EFI stub or the decompressor. But this currently doesn't
> apply to exports from assembly, which can lead to somewhat confusing
> situations.
> 
> Consolidate the __DISABLE_EXPORTS infrastructure by checking it from
> asm-generic/export.h as well.
> 
> Signed-off-by: Quentin Perret <qperret@google.com>
> ---
>  include/asm-generic/export.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Will Deacon <will@kernel.org>

Will
diff mbox series

Patch

diff --git a/include/asm-generic/export.h b/include/asm-generic/export.h
index 365345f9a9e3..07a36a874dca 100644
--- a/include/asm-generic/export.h
+++ b/include/asm-generic/export.h
@@ -33,7 +33,7 @@ 
  */
 
 .macro ___EXPORT_SYMBOL name,val,sec
-#ifdef CONFIG_MODULES
+#if defined(CONFIG_MODULES) && !defined(__DISABLE_EXPORTS)
 	.section ___ksymtab\sec+\name,"a"
 	.balign KSYM_ALIGN
 __ksymtab_\name: