2018-05-29 10:38:06

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] ARM: disable KCOV for trusted foundations code

The ARM trusted foundations code is currently broken in linux-next
when CONFIG_KCOV_INSTRUMENT_ALL is set:

/tmp/ccHdQsCI.s: Assembler messages:
/tmp/ccHdQsCI.s:37: Error: .err encountered
/tmp/ccHdQsCI.s:38: Error: .err encountered
/tmp/ccHdQsCI.s:39: Error: .err encountered
scripts/Makefile.build:311: recipe for target 'arch/arm/firmware/trusted_foundations.o' failed

I could not find a function attribute that lets me disable
-fsanitize-coverage=trace-pc for just one function, so this
turns it off for the entire file instead.

Fixes: mmotm ("arm: port KCOV to arm")
Cc: Dmitry Vyukov <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
---
arch/arm/firmware/Makefile | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/arm/firmware/Makefile b/arch/arm/firmware/Makefile
index a71f16536b6c..6e41336b0bc4 100644
--- a/arch/arm/firmware/Makefile
+++ b/arch/arm/firmware/Makefile
@@ -1 +1,4 @@
obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o
+
+# tf_generic_smc() fails to build with -fsanitize-coverage=trace-pc
+KCOV_INSTRUMENT := n
--
2.9.0



2018-07-03 17:52:50

by Olof Johansson

[permalink] [raw]
Subject: Re: [PATCH] ARM: disable KCOV for trusted foundations code

On Tue, May 29, 2018 at 12:36:26PM +0200, Arnd Bergmann wrote:
> The ARM trusted foundations code is currently broken in linux-next
> when CONFIG_KCOV_INSTRUMENT_ALL is set:
>
> /tmp/ccHdQsCI.s: Assembler messages:
> /tmp/ccHdQsCI.s:37: Error: .err encountered
> /tmp/ccHdQsCI.s:38: Error: .err encountered
> /tmp/ccHdQsCI.s:39: Error: .err encountered
> scripts/Makefile.build:311: recipe for target 'arch/arm/firmware/trusted_foundations.o' failed
>
> I could not find a function attribute that lets me disable
> -fsanitize-coverage=trace-pc for just one function, so this
> turns it off for the entire file instead.
>
> Fixes: mmotm ("arm: port KCOV to arm")
> Cc: Dmitry Vyukov <[email protected]>
> Cc: Mark Rutland <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Signed-off-by: Arnd Bergmann <[email protected]>

Applied to arm-soc fixes branch for v4.18.


-Olof