18041650aSAlex Bennée# -*- Mode: makefile -*- 28041650aSAlex Bennée# 38041650aSAlex Bennée# Multiarch system tests 48041650aSAlex Bennée# 58041650aSAlex Bennée# We just collect the tests together here and rely on the actual guest 68b81968cSMichael Tokarev# architecture to add to the test dependencies and deal with the 78041650aSAlex Bennée# complications of building. 88041650aSAlex Bennée# 9ab8bf8f6SAlex Bennée# To support the multiarch guests the target arch needs to provide a 10ab8bf8f6SAlex Bennée# boot.S that jumps to main and provides a __sys_outc functions. 11ab8bf8f6SAlex Bennée# Remember to update MULTIARCH_SOFTMMU_TARGETS in the tcg test 12ab8bf8f6SAlex Bennée# Makefile.target when this is done. 13ab8bf8f6SAlex Bennée# 148041650aSAlex Bennée 15c00506aaSAlex BennéeMULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch 16c00506aaSAlex BennéeMULTIARCH_SYSTEM_SRC=$(MULTIARCH_SRC)/system 178041650aSAlex BennéeVPATH+=$(MULTIARCH_SYSTEM_SRC) 188041650aSAlex Bennée 198041650aSAlex BennéeMULTIARCH_TEST_SRCS=$(wildcard $(MULTIARCH_SYSTEM_SRC)/*.c) 208041650aSAlex BennéeMULTIARCH_TESTS = $(patsubst $(MULTIARCH_SYSTEM_SRC)/%.c, %, $(MULTIARCH_TEST_SRCS)) 21c00506aaSAlex Bennée 22a47dd5c5SPaolo Bonziniifneq ($(GDB),) 23c00506aaSAlex BennéeGDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py 24c00506aaSAlex Bennée 25c00506aaSAlex Bennéerun-gdbstub-memory: memory 26c00506aaSAlex Bennée $(call run-test, $@, $(GDB_SCRIPT) \ 27a47dd5c5SPaolo Bonzini --gdb $(GDB) \ 28c00506aaSAlex Bennée --qemu $(QEMU) \ 29c00506aaSAlex Bennée --output $<.gdb.out \ 30c00506aaSAlex Bennée --qargs \ 31c00506aaSAlex Bennée "-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \ 32c00506aaSAlex Bennée --bin $< --test $(MULTIARCH_SRC)/gdbstub/memory.py, \ 33c6cf8a20SPaolo Bonzini softmmu gdbstub support) 34761e3c10SMatheus Branco Borellarun-gdbstub-interrupt: interrupt 35761e3c10SMatheus Branco Borella $(call run-test, $@, $(GDB_SCRIPT) \ 36a47dd5c5SPaolo Bonzini --gdb $(GDB) \ 37761e3c10SMatheus Branco Borella --qemu $(QEMU) \ 38761e3c10SMatheus Branco Borella --output $<.gdb.out \ 39761e3c10SMatheus Branco Borella --qargs \ 40761e3c10SMatheus Branco Borella "-smp 2 -monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \ 41761e3c10SMatheus Branco Borella --bin $< --test $(MULTIARCH_SRC)/gdbstub/interrupt.py, \ 42761e3c10SMatheus Branco Borella softmmu gdbstub support) 43dae66a3fSMatheus Tavares Bernardinorun-gdbstub-untimely-packet: hello 44dae66a3fSMatheus Tavares Bernardino $(call run-test, $@, $(GDB_SCRIPT) \ 45a47dd5c5SPaolo Bonzini --gdb $(GDB) \ 46dae66a3fSMatheus Tavares Bernardino --gdb-args "-ex 'set debug remote 1'" \ 47dae66a3fSMatheus Tavares Bernardino --output untimely-packet.gdb.out \ 48dae66a3fSMatheus Tavares Bernardino --stderr untimely-packet.gdb.err \ 49dae66a3fSMatheus Tavares Bernardino --qemu $(QEMU) \ 50dae66a3fSMatheus Tavares Bernardino --bin $< --qargs \ 51dae66a3fSMatheus Tavares Bernardino "-monitor none -display none -chardev file$(COMMA)path=untimely-packet.out$(COMMA)id=output $(QEMU_OPTS)", \ 52bb16cb45SAlex Bennée softmmu gdbstub untimely packets) 53dae66a3fSMatheus Tavares Bernardino $(call quiet-command, \ 54dae66a3fSMatheus Tavares Bernardino (! grep -Fq 'Packet instead of Ack, ignoring it' untimely-packet.gdb.err), \ 55bb16cb45SAlex Bennée "GREP", file untimely-packet.gdb.err) 5621750c3cSAlex Bennée 5721750c3cSAlex Bennéerun-gdbstub-registers: memory 5821750c3cSAlex Bennée $(call run-test, $@, $(GDB_SCRIPT) \ 5921750c3cSAlex Bennée --gdb $(GDB) \ 6021750c3cSAlex Bennée --qemu $(QEMU) \ 6121750c3cSAlex Bennée --output $<.registers.gdb.out \ 6221750c3cSAlex Bennée --qargs \ 6321750c3cSAlex Bennée "-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \ 6421750c3cSAlex Bennée --bin $< --test $(MULTIARCH_SRC)/gdbstub/registers.py, \ 6521750c3cSAlex Bennée softmmu gdbstub support) 66bcbc36a9SAlex Bennéeelse 67bcbc36a9SAlex Bennéerun-gdbstub-%: 68a47dd5c5SPaolo Bonzini $(call skip-test, "gdbstub test $*", "need working gdb with $(patsubst -%,,$(TARGET_NAME)) support") 69c00506aaSAlex Bennéeendif 708886ff28SAlex Bennée 7121750c3cSAlex BennéeMULTIARCH_RUNS += run-gdbstub-memory run-gdbstub-interrupt \ 7221750c3cSAlex Bennée run-gdbstub-untimely-packet run-gdbstub-registers 73ecbcc9eaSAlex Bennée 7425aaf0cbSAlex Bennéeifeq ($(CONFIG_PLUGIN),y) 75ecbcc9eaSAlex Bennée# Test plugin memory access instrumentation 7625aaf0cbSAlex Bennéerun-plugin-memory-with-libmem.so: memory libmem.so 7725aaf0cbSAlex Bennéerun-plugin-memory-with-libmem.so: PLUGIN_ARGS=$(COMMA)region-summary=true 7825aaf0cbSAlex Bennéerun-plugin-memory-with-libmem.so: CHECK_PLUGIN_OUTPUT_COMMAND=$(MULTIARCH_SYSTEM_SRC)/validate-memory-counts.py $@.out 7925aaf0cbSAlex Bennée 80*676ab6a2SGustavo RomeroEXTRA_RUNS_WITH_PLUGIN += run-plugin-memory-with-libmem.so 8125aaf0cbSAlex Bennéeendif 82