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 lse2-fault 13AARCH64_TESTS += test-2248 14 15fcvt: LDFLAGS+=-lm 16 17run-fcvt: fcvt 18 $(call run-test,$<,$(QEMU) $<) 19 $(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref) 20 21config-cc.mak: Makefile 22 $(quiet-@)( \ 23 $(call cc-option,-march=armv8.1-a+sve, CROSS_CC_HAS_SVE); \ 24 $(call cc-option,-march=armv8.1-a+sve2, CROSS_CC_HAS_SVE2); \ 25 $(call cc-option,-march=armv8.2-a, CROSS_CC_HAS_ARMV8_2); \ 26 $(call cc-option,-march=armv8.3-a, CROSS_CC_HAS_ARMV8_3); \ 27 $(call cc-option,-march=armv8.5-a, CROSS_CC_HAS_ARMV8_5); \ 28 $(call cc-option,-mbranch-protection=standard, CROSS_CC_HAS_ARMV8_BTI); \ 29 $(call cc-option,-march=armv8.5-a+memtag, CROSS_CC_HAS_ARMV8_MTE); \ 30 $(call cc-option,-Wa$(COMMA)-march=armv9-a+sme, CROSS_AS_HAS_ARMV9_SME)) 3> config-cc.mak 31-include config-cc.mak 32 33ifneq ($(CROSS_CC_HAS_ARMV8_2),) 34AARCH64_TESTS += dcpop 35dcpop: CFLAGS += -march=armv8.2-a 36endif 37ifneq ($(CROSS_CC_HAS_ARMV8_5),) 38AARCH64_TESTS += dcpodp 39dcpodp: CFLAGS += -march=armv8.5-a 40endif 41 42# Pauth Tests 43ifneq ($(CROSS_CC_HAS_ARMV8_3),) 44AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5 45pauth-%: CFLAGS += -march=armv8.3-a 46run-pauth-1: QEMU_OPTS += -cpu max 47run-pauth-2: QEMU_OPTS += -cpu max 48# Choose a cpu with FEAT_Pauth but without FEAT_FPAC for pauth-[45]. 49run-pauth-4: QEMU_OPTS += -cpu neoverse-v1 50run-pauth-5: QEMU_OPTS += -cpu neoverse-v1 51endif 52 53# BTI Tests 54# bti-1 tests the elf notes, so we require special compiler support. 55ifneq ($(CROSS_CC_HAS_ARMV8_BTI),) 56AARCH64_TESTS += bti-1 bti-3 57bti-1 bti-3: CFLAGS += -fno-stack-protector -mbranch-protection=standard 58bti-1 bti-3: LDFLAGS += -nostdlib 59endif 60# bti-2 tests PROT_BTI, so no special compiler support required. 61AARCH64_TESTS += bti-2 62 63# MTE Tests 64ifneq ($(CROSS_CC_HAS_ARMV8_MTE),) 65AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6 mte-7 66mte-%: CFLAGS += -march=armv8.5-a+memtag 67endif 68 69# SME Tests 70ifneq ($(CROSS_AS_HAS_ARMV9_SME),) 71AARCH64_TESTS += sme-outprod1 sme-smopa-1 sme-smopa-2 72endif 73 74# System Registers Tests 75AARCH64_TESTS += sysregs 76 77AARCH64_TESTS += test-aes 78test-aes: CFLAGS += -O -march=armv8-a+aes 79test-aes: test-aes-main.c.inc 80 81# Vector SHA1 82sha1-vector: CFLAGS=-O3 83sha1-vector: sha1.c 84 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) 85run-sha1-vector: sha1-vector run-sha1 86 $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<) 87 $(call diff-out, sha1-vector, sha1.out) 88 89TESTS += sha1-vector 90 91# Vector versions of sha512 (-O3 triggers vectorisation) 92sha512-vector: CFLAGS=-O3 93sha512-vector: sha512.c 94 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) 95 96TESTS += sha512-vector 97 98ifneq ($(CROSS_CC_HAS_SVE),) 99# SVE ioctl test 100AARCH64_TESTS += sve-ioctls 101sve-ioctls: CFLAGS+=-march=armv8.1-a+sve 102 103sha512-sve: CFLAGS=-O3 -march=armv8.1-a+sve 104sha512-sve: sha512.c 105 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) 106 107sve-str: CFLAGS=-O1 -march=armv8.1-a+sve 108sve-str: sve-str.c 109 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) 110 111TESTS += sha512-sve sve-str 112 113ifneq ($(GDB),) 114GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py 115 116run-gdbstub-sysregs: sysregs 117 $(call run-test, $@, $(GDB_SCRIPT) \ 118 --gdb $(GDB) \ 119 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ 120 --bin $< --test $(AARCH64_SRC)/gdbstub/test-sve.py, \ 121 basic gdbstub SVE support) 122 123run-gdbstub-sve-ioctls: sve-ioctls 124 $(call run-test, $@, $(GDB_SCRIPT) \ 125 --gdb $(GDB) \ 126 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ 127 --bin $< --test $(AARCH64_SRC)/gdbstub/test-sve-ioctl.py, \ 128 basic gdbstub SVE ZLEN support) 129 130EXTRA_RUNS += run-gdbstub-sysregs run-gdbstub-sve-ioctls 131endif 132endif 133 134ifneq ($(CROSS_CC_HAS_SVE2),) 135AARCH64_TESTS += test-826 136test-826: CFLAGS+=-march=armv8.1-a+sve2 137endif 138 139TESTS += $(AARCH64_TESTS) 140