xref: /openbmc/qemu/tests/tcg/aarch64/Makefile.target (revision 1af0006a)
1# -*- Mode: makefile -*-
2#
3# AArch64 specific tweaks
4
5ARM_SRC=$(SRC_PATH)/tests/tcg/arm
6VPATH 		+= $(ARM_SRC)
7
8AARCH64_SRC=$(SRC_PATH)/tests/tcg/aarch64
9VPATH 		+= $(AARCH64_SRC)
10
11# Base architecture tests
12AARCH64_TESTS=fcvt pcalign-a64
13
14fcvt: LDFLAGS+=-lm
15
16run-fcvt: fcvt
17	$(call run-test,$<,$(QEMU) $<, "$< on $(TARGET_NAME)")
18	$(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref)
19
20config-cc.mak: Makefile
21	$(quiet-@)( \
22	    $(call cc-option,-march=armv8.1-a+sve,          CROSS_CC_HAS_SVE); \
23	    $(call cc-option,-march=armv8.1-a+sve2,         CROSS_CC_HAS_SVE2); \
24	    $(call cc-option,-march=armv8.3-a,              CROSS_CC_HAS_ARMV8_3); \
25	    $(call cc-option,-mbranch-protection=standard,  CROSS_CC_HAS_ARMV8_BTI); \
26	    $(call cc-option,-march=armv8.5-a+memtag,       CROSS_CC_HAS_ARMV8_MTE)) 3> config-cc.mak
27-include config-cc.mak
28
29# Pauth Tests
30ifneq ($(CROSS_CC_HAS_ARMV8_3),)
31AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
32pauth-%: CFLAGS += -march=armv8.3-a
33run-pauth-%: QEMU_OPTS += -cpu max
34run-plugin-pauth-%: QEMU_OPTS += -cpu max
35endif
36
37# BTI Tests
38# bti-1 tests the elf notes, so we require special compiler support.
39ifneq ($(CROSS_CC_HAS_ARMV8_BTI),)
40AARCH64_TESTS += bti-1 bti-3
41bti-1 bti-3: CFLAGS += -mbranch-protection=standard
42bti-1 bti-3: LDFLAGS += -nostdlib
43endif
44# bti-2 tests PROT_BTI, so no special compiler support required.
45AARCH64_TESTS += bti-2
46
47# MTE Tests
48ifneq ($(CROSS_CC_HAS_ARMV8_MTE),)
49AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6 mte-7
50mte-%: CFLAGS += -march=armv8.5-a+memtag
51endif
52
53ifneq ($(CROSS_CC_HAS_SVE),)
54# System Registers Tests
55AARCH64_TESTS += sysregs
56sysregs: CFLAGS+=-march=armv8.1-a+sve
57
58# SVE ioctl test
59AARCH64_TESTS += sve-ioctls
60sve-ioctls: CFLAGS+=-march=armv8.1-a+sve
61
62# Vector SHA1
63sha1-vector: CFLAGS=-O3
64sha1-vector: sha1.c
65	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
66run-sha1-vector: sha1-vector run-sha1
67	$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
68	$(call diff-out, sha1-vector, sha1.out)
69
70TESTS += sha1-vector
71
72# Vector versions of sha512 (-O3 triggers vectorisation)
73sha512-vector: CFLAGS=-O3
74sha512-vector: sha512.c
75	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
76
77TESTS += sha512-vector
78
79ifneq ($(HAVE_GDB_BIN),)
80GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
81
82run-gdbstub-sysregs: sysregs
83	$(call run-test, $@, $(GDB_SCRIPT) \
84		--gdb $(HAVE_GDB_BIN) \
85		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
86		--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve.py, \
87	basic gdbstub SVE support)
88
89run-gdbstub-sve-ioctls: sve-ioctls
90	$(call run-test, $@, $(GDB_SCRIPT) \
91		--gdb $(HAVE_GDB_BIN) \
92		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
93		--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve-ioctl.py, \
94	basic gdbstub SVE ZLEN support)
95
96EXTRA_RUNS += run-gdbstub-sysregs run-gdbstub-sve-ioctls
97endif
98endif
99
100ifneq ($(CROSS_CC_HAS_SVE2),)
101AARCH64_TESTS += test-826
102test-826: CFLAGS+=-march=armv8.1-a+sve2
103endif
104
105TESTS += $(AARCH64_TESTS)
106