xref: /linux/arch/arm64/kvm/hyp/nvhe/Makefile (revision c50cb04303cb88c517715b078e3e010c024af1a5)
176217129SDavid Brazdil# SPDX-License-Identifier: GPL-2.0
276217129SDavid Brazdil#
376217129SDavid Brazdil# Makefile for Kernel-based Virtual Machine module, HYP/nVHE part
476217129SDavid Brazdil#
576217129SDavid Brazdil
676217129SDavid Brazdilasflags-y := -D__KVM_NVHE_HYPERVISOR__
776217129SDavid Brazdilccflags-y := -D__KVM_NVHE_HYPERVISOR__
876217129SDavid Brazdil
9c04dd455SDavid Brazdilobj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o hyp-init.o
10c04dd455SDavid Brazdilobj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \
11c04dd455SDavid Brazdil	 ../fpsimd.o ../hyp-entry.o
1276217129SDavid Brazdil
1376217129SDavid Brazdilobj-y := $(patsubst %.o,%.hyp.o,$(obj-y))
1476217129SDavid Brazdilextra-y := $(patsubst %.hyp.o,%.hyp.tmp.o,$(obj-y))
1576217129SDavid Brazdil
1676217129SDavid Brazdil$(obj)/%.hyp.tmp.o: $(src)/%.c FORCE
1776217129SDavid Brazdil	$(call if_changed_rule,cc_o_c)
1876217129SDavid Brazdil$(obj)/%.hyp.tmp.o: $(src)/%.S FORCE
1976217129SDavid Brazdil	$(call if_changed_rule,as_o_S)
2076217129SDavid Brazdil$(obj)/%.hyp.o: $(obj)/%.hyp.tmp.o FORCE
2176217129SDavid Brazdil	$(call if_changed,hypcopy)
2276217129SDavid Brazdil
2376217129SDavid Brazdilquiet_cmd_hypcopy = HYPCOPY $@
24*c50cb043SDavid Brazdil      cmd_hypcopy = $(OBJCOPY)	--prefix-symbols=__kvm_nvhe_		\
25*c50cb043SDavid Brazdil				--rename-section=.text=.hyp.text	\
26*c50cb043SDavid Brazdil				$< $@
27*c50cb043SDavid Brazdil
28*c50cb043SDavid Brazdil# Remove ftrace and Shadow Call Stack CFLAGS.
29*c50cb043SDavid Brazdil# This is equivalent to the 'notrace' and '__noscs' annotations.
30*c50cb043SDavid BrazdilKBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS), $(KBUILD_CFLAGS))
3176217129SDavid Brazdil
3276217129SDavid Brazdil# KVM nVHE code is run at a different exception code with a different map, so
3376217129SDavid Brazdil# compiler instrumentation that inserts callbacks or checks into the code may
3476217129SDavid Brazdil# cause crashes. Just disable it.
3576217129SDavid BrazdilGCOV_PROFILE	:= n
3676217129SDavid BrazdilKASAN_SANITIZE	:= n
3776217129SDavid BrazdilUBSAN_SANITIZE	:= n
3876217129SDavid BrazdilKCOV_INSTRUMENT	:= n
3976217129SDavid Brazdil
4076217129SDavid Brazdil# Skip objtool checking for this directory because nVHE code is compiled with
4176217129SDavid Brazdil# non-standard build rules.
4276217129SDavid BrazdilOBJECT_FILES_NON_STANDARD := y
43