All files containing functions run before kasan_early_init() is called
must have KASAN instrumentation disabled.
For those file, branch profiling also have to be disabled otherwise
each if () generates a call to ftrace_likely_update().
Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxx>
---
arch/powerpc/kernel/Makefile | 12 ++++++++++++
arch/powerpc/lib/Makefile | 8 ++++++++
arch/powerpc/mm/Makefile | 6 ++++++
arch/powerpc/platforms/powermac/Makefile | 6 ++++++
arch/powerpc/purgatory/Makefile | 3 +++
arch/powerpc/xmon/Makefile | 1 +
6 files changed, 36 insertions(+)
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 3c1bd9fa23cd..dd945ca869b2 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -7,6 +7,12 @@ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
CFLAGS_REMOVE_slb.o = $(CC_FLAGS_FTRACE)
+KASAN_SANITIZE_ppc_mmu_32.o := n
+
+ifdef CONFIG_KASAN
+CFLAGS_ppc_mmu_32.o += -DDISABLE_BRANCH_PROFILING
+endif
+