From bd7d13c36e4b10e3f0173b2e481dbb04ecfcd56f Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Mon, 12 Jul 2021 07:49:03 +0000 Subject: [PATCH] ANDROID: arm64: disable LSE when building the FIPS140 module The arm64 LSE atomics implementation uses both alternatives patching and jump label patching, both of which need to be selectively disabled when building the FIPS140 module, or the hashing of the .text section no longer works. We already disable jump labels in generic code, but this uncovers a rather nasty circular include dependency, as the jump label fallback code uses atomics, which are provided by the LSE code if enabled. So let's disable LSE as well when building the FIPS140 module: this does not have any impact on the code, as no code patching goes on in this module anyway, but it avoids #include hell. Bug: 153614920 Bug: 188620248 Change-Id: Ia3d823fa3a309777f0c955d619ae8b139dc74061 Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/lse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/lse.h b/arch/arm64/include/asm/lse.h index 5d10051c3e62..29d0719bd2ed 100644 --- a/arch/arm64/include/asm/lse.h +++ b/arch/arm64/include/asm/lse.h @@ -4,7 +4,7 @@ #include -#ifdef CONFIG_ARM64_LSE_ATOMICS +#if defined(CONFIG_ARM64_LSE_ATOMICS) && !defined(BUILD_FIPS140_KO) #define __LSE_PREAMBLE ".arch_extension lse\n"