diff mbox series

[04/13] powerpc: Disable CONFIG_DCACHE_WORD_ACCESS when KMSAN is enabled

Message ID 20231214055539.9420-5-nicholas@linux.ibm.com (mailing list archive)
State Changes Requested
Headers show
Series kmsan: Enable on powerpc | expand

Commit Message

Nicholas Miehlbradt Dec. 14, 2023, 5:55 a.m. UTC
Word sized accesses may read uninitialized data when optimizing loads.
Disable this optimization when KMSAN is enabled to prevent false
positives.

Signed-off-by: Nicholas Miehlbradt <nicholas@linux.ibm.com>
---
 arch/powerpc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christophe Leroy Dec. 14, 2023, 8:42 a.m. UTC | #1
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit :
> Word sized accesses may read uninitialized data when optimizing loads.
> Disable this optimization when KMSAN is enabled to prevent false
> positives.
> 
> Signed-off-by: Nicholas Miehlbradt <nicholas@linux.ibm.com>
> ---
>   arch/powerpc/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 6f105ee4f3cf..e33e3250c478 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -182,7 +182,7 @@ config PPC
>   	select BUILDTIME_TABLE_SORT
>   	select CLONE_BACKWARDS
>   	select CPUMASK_OFFSTACK			if NR_CPUS >= 8192
> -	select DCACHE_WORD_ACCESS		if PPC64 && CPU_LITTLE_ENDIAN
> +	select DCACHE_WORD_ACCESS		if PPC64 && CPU_LITTLE_ENDIAN && !KMSAN
>   	select DMA_OPS_BYPASS			if PPC64
>   	select DMA_OPS				if PPC64
>   	select DYNAMIC_FTRACE			if FUNCTION_TRACER


Seems like all archs do this. Maybe a better approach would be to define 
a HAVE_DCACHE_WORD_ACCESS that is selected by arches, and then the core 
part select DCACHE_WORD_ACCESS when HAVE_DCACHE_WORD_ACCESS && !KMSAN

Christophe
diff mbox series

Patch

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 6f105ee4f3cf..e33e3250c478 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -182,7 +182,7 @@  config PPC
 	select BUILDTIME_TABLE_SORT
 	select CLONE_BACKWARDS
 	select CPUMASK_OFFSTACK			if NR_CPUS >= 8192
-	select DCACHE_WORD_ACCESS		if PPC64 && CPU_LITTLE_ENDIAN
+	select DCACHE_WORD_ACCESS		if PPC64 && CPU_LITTLE_ENDIAN && !KMSAN
 	select DMA_OPS_BYPASS			if PPC64
 	select DMA_OPS				if PPC64
 	select DYNAMIC_FTRACE			if FUNCTION_TRACER