arm64: allow building with kcov coverage on ARM64
authorAlexander Potapenko <glider@google.com>
Thu, 16 Jun 2016 16:39:52 +0000 (18:39 +0200)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 21 Jun 2016 15:15:57 +0000 (16:15 +0100)
Add ARCH_HAS_KCOV to ARM64 config. To avoid potential crashes, disable
instrumentation of the files in arch/arm64/kvm/hyp/*.

Signed-off-by: Alexander Potapenko <glider@google.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Tested-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/Kconfig
arch/arm64/kvm/hyp/Makefile

index ab319eb750d32b26919f7290da73c2f40b6fe419..73362f52d18610013f73f5946b9d03a4f994c1ed 100644 (file)
@@ -7,6 +7,7 @@ config ARM64
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_GCOV_PROFILE_ALL
+       select ARCH_HAS_KCOV
        select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_USE_CMPXCHG_LOCKREF
index 778d0effa2afd38bd94b34b0a7a88c02ff2a79bf..0c85febcc1eba0b452472b459951feea077c6a52 100644 (file)
@@ -17,6 +17,10 @@ obj-$(CONFIG_KVM_ARM_HOST) += tlb.o
 obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o
 obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o
 
+# KVM code is run at a different exception code with a different map, so
+# compiler instrumentation that inserts callbacks or checks into the code may
+# cause crashes. Just disable it.
 GCOV_PROFILE   := n
 KASAN_SANITIZE := n
 UBSAN_SANITIZE := n
+KCOV_INSTRUMENT        := n