diff mbox series

[v9,1/6] kasan: allow an architecture to disable inline instrumentation

Message ID 20201201161632.1234753-2-dja@axtens.net (mailing list archive)
State Superseded
Headers show
Series KASAN for powerpc64 radix | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch powerpc/merge (78c312324391ee996944e1196123b0060888e189)
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
snowpatch_ozlabs/needsstable success Patch has no Fixes tags

Commit Message

Daniel Axtens Dec. 1, 2020, 4:16 p.m. UTC
For annoying architectural reasons, it's very difficult to support inline
instrumentation on powerpc64.

Add a Kconfig flag to allow an arch to disable inline. (It's a bit
annoying to be 'backwards', but I'm not aware of any way to have
an arch force a symbol to be 'n', rather than 'y'.)

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 lib/Kconfig.kasan | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Christophe Leroy Dec. 1, 2020, 4:49 p.m. UTC | #1
Le 01/12/2020 à 17:16, Daniel Axtens a écrit :
> For annoying architectural reasons, it's very difficult to support inline
> instrumentation on powerpc64.
> 
> Add a Kconfig flag to allow an arch to disable inline. (It's a bit
> annoying to be 'backwards', but I'm not aware of any way to have
> an arch force a symbol to be 'n', rather than 'y'.)
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> ---
>   lib/Kconfig.kasan | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan
> index 542a9c18398e..31a0b28f6c2b 100644
> --- a/lib/Kconfig.kasan
> +++ b/lib/Kconfig.kasan
> @@ -9,6 +9,9 @@ config HAVE_ARCH_KASAN_SW_TAGS
>   config	HAVE_ARCH_KASAN_VMALLOC
>   	bool
>   
> +config HAVE_ARCH_NO_KASAN_INLINE

Maybe a better name could be: ARCH_DISABLE_KASAN_INLINE

> +	def_bool n
> +
>   config CC_HAS_KASAN_GENERIC
>   	def_bool $(cc-option, -fsanitize=kernel-address)
>   
> @@ -108,6 +111,7 @@ config KASAN_OUTLINE
>   
>   config KASAN_INLINE
>   	bool "Inline instrumentation"
> +	depends on !HAVE_ARCH_NO_KASAN_INLINE
>   	help
>   	  Compiler directly inserts code checking shadow memory before
>   	  memory accesses. This is faster than outline (in some workloads
>
diff mbox series

Patch

diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan
index 542a9c18398e..31a0b28f6c2b 100644
--- a/lib/Kconfig.kasan
+++ b/lib/Kconfig.kasan
@@ -9,6 +9,9 @@  config HAVE_ARCH_KASAN_SW_TAGS
 config	HAVE_ARCH_KASAN_VMALLOC
 	bool
 
+config HAVE_ARCH_NO_KASAN_INLINE
+	def_bool n
+
 config CC_HAS_KASAN_GENERIC
 	def_bool $(cc-option, -fsanitize=kernel-address)
 
@@ -108,6 +111,7 @@  config KASAN_OUTLINE
 
 config KASAN_INLINE
 	bool "Inline instrumentation"
+	depends on !HAVE_ARCH_NO_KASAN_INLINE
 	help
 	  Compiler directly inserts code checking shadow memory before
 	  memory accesses. This is faster than outline (in some workloads