1cstart.o = $(TEST_DIR)/cstart64.o 2bits = 64 3ldarch = elf64-x86-64 4ifeq ($(CONFIG_EFI),y) 5# Function calls must include the number of arguments passed to the functions 6# More details: https://wiki.osdev.org/GNU-EFI 7CFLAGS += -maccumulate-outgoing-args 8 9exe = efi 10bin = so 11FORMAT = efi-app-x86_64 12cstart.o = $(TEST_DIR)/efi/efistart64.o 13arch_LDFLAGS = '' 14else 15exe = flat 16bin = elf 17arch_LDFLAGS = -m elf_x86_64 18endif 19 20fcf_protection_full := $(call cc-option, -fcf-protection=full,) 21COMMON_CFLAGS += -mno-red-zone -mno-sse -mno-sse2 $(fcf_protection_full) 22 23cflatobjs += lib/x86/setjmp64.o 24cflatobjs += lib/x86/intel-iommu.o 25cflatobjs += lib/x86/usermode.o 26 27tests = $(TEST_DIR)/apic.$(exe) \ 28 $(TEST_DIR)/idt_test.$(exe) \ 29 $(TEST_DIR)/xsave.$(exe) $(TEST_DIR)/rmap_chain.$(exe) \ 30 $(TEST_DIR)/pcid.$(exe) $(TEST_DIR)/debug.$(exe) \ 31 $(TEST_DIR)/ioapic.$(exe) $(TEST_DIR)/memory.$(exe) \ 32 $(TEST_DIR)/pku.$(exe) $(TEST_DIR)/hyperv_clock.$(exe) 33tests += $(TEST_DIR)/syscall.$(exe) 34tests += $(TEST_DIR)/tscdeadline_latency.$(exe) 35tests += $(TEST_DIR)/intel-iommu.$(exe) 36tests += $(TEST_DIR)/vmware_backdoors.$(exe) 37tests += $(TEST_DIR)/rdpru.$(exe) 38tests += $(TEST_DIR)/pks.$(exe) 39tests += $(TEST_DIR)/pmu_lbr.$(exe) 40tests += $(TEST_DIR)/pmu_pebs.$(exe) 41tests += $(TEST_DIR)/lam.$(exe) 42 43ifeq ($(CONFIG_EFI),y) 44tests += $(TEST_DIR)/amd_sev.$(exe) 45endif 46 47# The following test cases are disabled when building EFI tests because they 48# use absolute addresses in their inline assembly code, which cannot compile 49# with the '-fPIC' flag 50ifneq ($(CONFIG_EFI),y) 51tests += $(TEST_DIR)/access_test.$(exe) 52tests += $(TEST_DIR)/svm.$(exe) 53tests += $(TEST_DIR)/svm_npt.$(exe) 54tests += $(TEST_DIR)/vmx.$(exe) 55endif 56 57ifneq ($(fcf_protection_full),) 58tests += $(TEST_DIR)/cet.$(exe) 59endif 60 61include $(SRCDIR)/$(TEST_DIR)/Makefile.common 62 63$(TEST_DIR)/hyperv_clock.$(bin): $(TEST_DIR)/hyperv_clock.o 64 65$(TEST_DIR)/vmx.$(bin): $(TEST_DIR)/vmx_tests.o 66$(TEST_DIR)/svm.$(bin): $(TEST_DIR)/svm_tests.o 67$(TEST_DIR)/svm_npt.$(bin): $(TEST_DIR)/svm_npt.o 68