]> git.proxmox.com Git - mirror_qemu.git/blobdiff - tests/tcg/multiarch/Makefile.target
tests/tcg: Add the PROT_NONE gdbstub test
[mirror_qemu.git] / tests / tcg / multiarch / Makefile.target
index d57a1158738a6b9af224bedcd535c68769f703b5..315a2e13588caae5e1c8aa3150f4db6577e98f6b 100644 (file)
@@ -8,9 +8,13 @@
 MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch
 
 # Set search path for all sources
-VPATH          += $(MULTIARCH_SRC)
-MULTIARCH_SRCS   =$(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
-MULTIARCH_TESTS  =$(filter-out float_helpers, $(MULTIARCH_SRCS:.c=))
+VPATH         += $(MULTIARCH_SRC)
+MULTIARCH_SRCS =  $(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
+ifeq ($(filter %-linux-user, $(TARGET)),$(TARGET))
+VPATH         += $(MULTIARCH_SRC)/linux
+MULTIARCH_SRCS += $(notdir $(wildcard $(MULTIARCH_SRC)/linux/*.c))
+endif
+MULTIARCH_TESTS = $(MULTIARCH_SRCS:.c=)
 
 #
 # The following are any additional rules needed to build things
@@ -18,11 +22,11 @@ MULTIARCH_TESTS  =$(filter-out float_helpers, $(MULTIARCH_SRCS:.c=))
 
 
 float_%: LDFLAGS+=-lm
-float_%: float_%.c float_helpers.c
-       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/float_helpers.c -o $@ $(LDFLAGS)
+float_%: float_%.c libs/float_helpers.c
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/libs/float_helpers.c -o $@ $(LDFLAGS)
 
 run-float_%: float_%
-       $(call run-test,$<, $(QEMU) $(QEMU_OPTS) $<,"$< on $(TARGET_NAME)")
+       $(call run-test,$<, $(QEMU) $(QEMU_OPTS) $<)
        $(call conditional-diff-out,$<,$(SRC_PATH)/tests/tcg/$(TARGET_NAME)/$<.ref)
 
 
@@ -32,11 +36,20 @@ threadcount: LDFLAGS+=-lpthread
 
 signals: LDFLAGS+=-lrt -lpthread
 
-# This triggers failures on s390x hosts about 4% of the time
-# This triggers failures for hppa-linux about 1% of the time
-run-signals: signals
-       $(call skip-test, $<, "BROKEN awaiting sigframe clean-ups and vdso support")
+munmap-pthread: CFLAGS+=-pthread
+munmap-pthread: LDFLAGS+=-pthread
+
+vma-pthread: CFLAGS+=-pthread
+vma-pthread: LDFLAGS+=-pthread
 
+# The vma-pthread seems very sensitive on gitlab and we currently
+# don't know if its exposing a real bug or the test is flaky.
+ifneq ($(GITLAB_CI),)
+run-vma-pthread: vma-pthread
+       $(call skip-test, $<, "flaky on CI?")
+run-plugin-vma-pthread-with-%: vma-pthread
+       $(call skip-test, $<, "flaky on CI?")
+endif
 
 # We define the runner for test-mmap after the individual
 # architectures have defined their supported pages sizes. If no
@@ -44,38 +57,64 @@ run-signals: signals
 
 # default case (host page size)
 run-test-mmap: test-mmap
-       $(call run-test, test-mmap, $(QEMU) $<, \
-               "$< (default) on $(TARGET_NAME)")
+       $(call run-test, test-mmap, $(QEMU) $<, $< (default))
 
 # additional page sizes (defined by each architecture adding to EXTRA_RUNS)
 run-test-mmap-%: test-mmap
-       $(call run-test, test-mmap-$*, $(QEMU) -p $* $<,\
-               "$< ($* byte pages) on $(TARGET_NAME)")
+       $(call run-test, test-mmap-$*, $(QEMU) -p $* $<, $< ($* byte pages))
 
-ifneq ($(HAVE_GDB_BIN),)
+ifneq ($(GDB),)
 GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
 
 run-gdbstub-sha1: sha1
        $(call run-test, $@, $(GDB_SCRIPT) \
-               --gdb $(HAVE_GDB_BIN) \
+               --gdb $(GDB) \
                --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
                --bin $< --test $(MULTIARCH_SRC)/gdbstub/sha1.py, \
-       "basic gdbstub support")
-
-EXTRA_RUNS += run-gdbstub-sha1
+       basic gdbstub support)
 
 run-gdbstub-qxfer-auxv-read: sha1
        $(call run-test, $@, $(GDB_SCRIPT) \
-               --gdb $(HAVE_GDB_BIN) \
+               --gdb $(GDB) \
                --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
                --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-qxfer-auxv-read.py, \
-       "basic gdbstub qXfer:auxv:read support")
+       basic gdbstub qXfer:auxv:read support)
+
+run-gdbstub-proc-mappings: sha1
+       $(call run-test, $@, $(GDB_SCRIPT) \
+               --gdb $(GDB) \
+               --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
+               --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-proc-mappings.py, \
+       proc mappings support)
+
+run-gdbstub-thread-breakpoint: testthread
+       $(call run-test, $@, $(GDB_SCRIPT) \
+               --gdb $(GDB) \
+               --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
+               --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-thread-breakpoint.py, \
+       hitting a breakpoint on non-main thread)
+
+run-gdbstub-registers: sha512
+       $(call run-test, $@, $(GDB_SCRIPT) \
+               --gdb $(GDB) \
+               --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
+               --bin $< --test $(MULTIARCH_SRC)/gdbstub/registers.py, \
+       checking register enumeration)
+
+run-gdbstub-prot-none: prot-none
+       $(call run-test, $@, env PROT_NONE_PY=1 $(GDB_SCRIPT) \
+               --gdb $(GDB) \
+               --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
+               --bin $< --test $(MULTIARCH_SRC)/gdbstub/prot-none.py, \
+       accessing PROT_NONE memory)
 
 else
 run-gdbstub-%:
-       $(call skip-test, "gdbstub test $*", "need working gdb")
+       $(call skip-test, "gdbstub test $*", "need working gdb with $(patsubst -%,,$(TARGET_NAME)) support")
 endif
-EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read
+EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read \
+             run-gdbstub-proc-mappings run-gdbstub-thread-breakpoint \
+             run-gdbstub-registers run-gdbstub-prot-none
 
 # ARM Compatible Semi Hosting Tests
 #
@@ -90,13 +129,13 @@ VPATH += $(MULTIARCH_SRC)/arm-compat-semi
 semihosting: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
 
 run-semihosting: semihosting
-       $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)")
+       $(call run-test,$<,$(QEMU) $< 2> $<.err)
 
 run-plugin-semihosting-with-%:
        $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
                -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
                 $(call strip-plugin,$<) 2> $<.err, \
-               "$< on $(TARGET_NAME) with $*")
+               $< with $*)
 
 semiconsole: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)