diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-01-03 09:34:41 -0800 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2022-01-03 09:34:41 -0800 |
commit | b5a3d8bc9146ba22a25116cb748c97341bf99737 (patch) | |
tree | ee128256bea83d2700f87ba6e3afbf91516af732 /tests | |
parent | 814a0505302d6af277557f10f88d3639eff7a547 (diff) | |
parent | 5c23f0c3191907000bab278654570a7d5879822a (diff) |
Merge tag 'pull-misc-20220103' of https://gitlab.com/rth7680/qemu into staging
Fix some meson conversion breakage
Disable check-python-tox
Fix emulation of hppa STBY insn
# gpg: Signature made Mon 03 Jan 2022 09:31:48 AM PST
# gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg: issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]
* tag 'pull-misc-20220103' of https://gitlab.com/rth7680/qemu:
gitlab: Disable check-python-tox
target/hppa: Fix atomic_store_3 for STBY
tests/tcg: Unconditionally use 90 second timeout
tests/tcg: Use $cpu in configure.sh
meson: Unify mips and mips64 in host_arch
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tcg/Makefile.target | 12 | ||||
-rwxr-xr-x | tests/tcg/configure.sh | 2 | ||||
-rw-r--r-- | tests/tcg/hppa/Makefile.target | 5 | ||||
-rw-r--r-- | tests/tcg/hppa/stby.c | 87 |
4 files changed, 98 insertions, 8 deletions
diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 63cf1b2573..0f8645f782 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -82,13 +82,12 @@ QEMU_OPTS= # If TCG debugging, or TCI is enabled things are a lot slower -ifneq ($(CONFIG_TCG_INTERPRETER),) +# ??? Makefile no longer has any indication that TCI is enabled, +# but for the record: +# 15s original default +# 60s with --enable-debug +# 90s with --enable-tcg-interpreter TIMEOUT=90 -else ifneq ($(CONFIG_DEBUG_TCG),) -TIMEOUT=60 -else -TIMEOUT=15 -endif ifdef CONFIG_USER_ONLY # The order we include is important. We include multiarch first and @@ -144,7 +143,6 @@ PLUGINS=$(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c))) $(foreach p,$(PLUGINS), \ $(foreach t,$(TESTS),\ $(eval run-plugin-$(t)-with-$(p): $t $p) \ - $(eval run-plugin-$(t)-with-$(p): TIMEOUT=60) \ $(eval RUN_TESTS+=run-plugin-$(t)-with-$(p)))) endif diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 9ef913df5b..8eb4287c84 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -326,7 +326,7 @@ for target in $target_list; do elif test $got_cross_cc = no && test "$container" != no && \ test -n "$container_image"; then for host in $container_hosts; do - if test "$host" = "$ARCH"; then + if test "$host" = "$cpu"; then echo "DOCKER_IMAGE=$container_image" >> $config_target_mak echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> \ $config_target_mak diff --git a/tests/tcg/hppa/Makefile.target b/tests/tcg/hppa/Makefile.target index d0d5e0e257..b78e6b4849 100644 --- a/tests/tcg/hppa/Makefile.target +++ b/tests/tcg/hppa/Makefile.target @@ -12,3 +12,8 @@ run-signals: signals $(call skip-test, $<, "BROKEN awaiting vdso support") run-plugin-signals-with-%: $(call skip-test, $<, "BROKEN awaiting vdso support") + +VPATH += $(SRC_PATH)/tests/tcg/hppa +TESTS += stby + +stby: CFLAGS += -pthread diff --git a/tests/tcg/hppa/stby.c b/tests/tcg/hppa/stby.c new file mode 100644 index 0000000000..36bd5f723c --- /dev/null +++ b/tests/tcg/hppa/stby.c @@ -0,0 +1,87 @@ +/* Test STBY */ + +#include <pthread.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + +struct S { + unsigned a; + unsigned b; + unsigned c; +}; + +static void check(const struct S *s, unsigned e, + const char *which, const char *insn, int ofs) +{ + int err = 0; + + if (s->a != 0) { + fprintf(stderr, "%s %s %d: garbage before word 0x%08x\n", + which, insn, ofs, s->a); + err = 1; + } + if (s->c != 0) { + fprintf(stderr, "%s %s %d: garbage after word 0x%08x\n", + which, insn, ofs, s->c); + err = 1; + } + if (s->b != e) { + fprintf(stderr, "%s %s %d: 0x%08x != 0x%08x\n", + which, insn, ofs, s->b, e); + err = 1; + } + + if (err) { + exit(1); + } +} + +#define TEST(INSN, OFS, E) \ + do { \ + s.b = 0; \ + asm volatile(INSN " %1, " #OFS "(%0)" \ + : : "r"(&s.b), "r" (0x11223344) : "memory"); \ + check(&s, E, which, INSN, OFS); \ + } while (0) + +static void test(const char *which) +{ + struct S s = { }; + + TEST("stby,b", 0, 0x11223344); + TEST("stby,b", 1, 0x00223344); + TEST("stby,b", 2, 0x00003344); + TEST("stby,b", 3, 0x00000044); + + TEST("stby,e", 0, 0x00000000); + TEST("stby,e", 1, 0x11000000); + TEST("stby,e", 2, 0x11220000); + TEST("stby,e", 3, 0x11223300); +} + +static void *child(void *x) +{ + return NULL; +} + +int main() +{ + int err; + pthread_t thr; + + /* Run test in serial mode */ + test("serial"); + + /* Create a dummy thread to start parallel mode. */ + err = pthread_create(&thr, NULL, child, NULL); + if (err != 0) { + fprintf(stderr, "pthread_create: %s\n", strerror(err)); + return 2; + } + + /* Run test in parallel mode */ + test("parallel"); + return 0; +} |