Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kvm: arm64: Disable compiler instrumentation for hypervisor code

With the recent rewrite of the arm64 KVM hypervisor code in C, enabling
certain options like KASAN would allow the compiler to generate memory
accesses or function calls to addresses not mapped at EL2. This patch
disables the compiler instrumentation on the arm64 hypervisor code for
gcov-based profiling (GCOV_KERNEL), undefined behaviour sanity checker
(UBSAN) and kernel address sanitizer (KASAN).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: <stable@vger.kernel.org> # 4.5+
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>

authored by

Catalin Marinas and committed by
Christoffer Dall
a6cdf1c0 2510ffe1

+4
+4
arch/arm64/kvm/hyp/Makefile
··· 16 16 obj-$(CONFIG_KVM_ARM_HOST) += tlb.o 17 17 obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o 18 18 obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o 19 + 20 + GCOV_PROFILE := n 21 + KASAN_SANITIZE := n 22 + UBSAN_SANITIZE := n