xref: /openbmc/qemu/tests/tcg/aarch64/Makefile.target (revision b14df228)
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
20# Pauth Tests
21ifneq ($(CROSS_CC_HAS_ARMV8_3),)
22AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
23pauth-%: CFLAGS += -march=armv8.3-a
24run-pauth-%: QEMU_OPTS += -cpu max
25run-plugin-pauth-%: QEMU_OPTS += -cpu max
26endif
27
28# BTI Tests
29# bti-1 tests the elf notes, so we require special compiler support.
30ifneq ($(CROSS_CC_HAS_ARMV8_BTI),)
31AARCH64_TESTS += bti-1 bti-3
32bti-1 bti-3: CFLAGS += -mbranch-protection=standard
33bti-1 bti-3: LDFLAGS += -nostdlib
34endif
35# bti-2 tests PROT_BTI, so no special compiler support required.
36AARCH64_TESTS += bti-2
37
38# MTE Tests
39ifneq ($(CROSS_CC_HAS_ARMV8_MTE),)
40AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6 mte-7
41mte-%: CFLAGS += -march=armv8.5-a+memtag
42endif
43
44ifneq ($(CROSS_CC_HAS_SVE),)
45# System Registers Tests
46AARCH64_TESTS += sysregs
47sysregs: CFLAGS+=-march=armv8.1-a+sve
48
49# SVE ioctl test
50AARCH64_TESTS += sve-ioctls
51sve-ioctls: CFLAGS+=-march=armv8.1-a+sve
52
53# Vector SHA1
54sha1-vector: CFLAGS=-O3
55sha1-vector: sha1.c
56	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
57run-sha1-vector: sha1-vector run-sha1
58	$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)")
59	$(call diff-out, sha1-vector, sha1.out)
60
61TESTS += sha1-vector
62
63# Vector versions of sha512 (-O3 triggers vectorisation)
64sha512-vector: CFLAGS=-O3
65sha512-vector: sha512.c
66	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
67
68TESTS += sha512-vector
69
70ifneq ($(HAVE_GDB_BIN),)
71GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
72
73run-gdbstub-sysregs: sysregs
74	$(call run-test, $@, $(GDB_SCRIPT) \
75		--gdb $(HAVE_GDB_BIN) \
76		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
77		--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve.py, \
78	"basic gdbstub SVE support")
79
80run-gdbstub-sve-ioctls: sve-ioctls
81	$(call run-test, $@, $(GDB_SCRIPT) \
82		--gdb $(HAVE_GDB_BIN) \
83		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
84		--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve-ioctl.py, \
85	"basic gdbstub SVE ZLEN support")
86
87EXTRA_RUNS += run-gdbstub-sysregs run-gdbstub-sve-ioctls
88endif
89endif
90
91ifneq ($(CROSS_CC_HAS_SVE2),)
92AARCH64_TESTS += test-826
93test-826: CFLAGS+=-march=armv8.1-a+sve2
94endif
95
96TESTS += $(AARCH64_TESTS)
97