Fix some meson conversion breakage

Disable check-python-tox
 Fix emulation of hppa STBY insn
 -----BEGIN PGP SIGNATURE-----
 
 iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmHTMwQdHHJpY2hhcmQu
 aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV9Rhgf/fFVZTVKscFhrnjzH
 T7PjP3c6TeVpFU8uIb6h1NC0Ugyo4rBds2Gg/qIE+/X8jvDIHa6/aW1HKacWq6Uq
 3Qea+FU56Oc8BpH1CQZEMR/U2ChDofvtcXf/PGHklnpgYCqZctkpNAFPdWlpT9Fx
 jy2Y29rGijV1Q2GEXqD8H6Ij6SX+QZBO5DYaiqGsLSWMS8W2a58rfahBBgslvL82
 UkpJ7TMzvERN8XPBlFOzvqzgSUX4CObAxn2/EiFT4rXukRbVuf5PbDtl2nNRtcS4
 Rfu59GsrHz0tgl3JTRZ/5ab7Na/w8ewknCUPtNygf0k8kKZn8IhDDMhT0ekepoZ9
 dsynQg==
 =WrNf
 -----END PGP SIGNATURE-----

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>
This commit is contained in:
Richard Henderson 2022-01-03 09:34:41 -08:00
commit b5a3d8bc91
8 changed files with 118 additions and 21 deletions

View file

@ -46,4 +46,6 @@ check-python-tox:
QEMU_TOX_EXTRA_ARGS: --skip-missing-interpreters=false
needs:
job: python-container
rules:
- when: manual
allow_failure: true

2
configure vendored
View file

@ -3821,7 +3821,7 @@ done
(for i in $cross_cc_vars; do
export $i
done
export target_list source_path use_containers ARCH
export target_list source_path use_containers cpu
$source_path/tests/tcg/configure.sh)
# temporary config to build submodules

View file

@ -74,6 +74,8 @@ if cpu not in supported_cpus
host_arch = 'unknown'
elif cpu == 'x86'
host_arch = 'i386'
elif cpu == 'mips64'
host_arch = 'mips'
else
host_arch = cpu
endif

View file

@ -57,26 +57,29 @@ void HELPER(tcond)(CPUHPPAState *env, target_ureg cond)
}
}
static void atomic_store_3(CPUHPPAState *env, target_ulong addr, uint32_t val,
uint32_t mask, uintptr_t ra)
static void atomic_store_3(CPUHPPAState *env, target_ulong addr,
uint32_t val, uintptr_t ra)
{
#ifdef CONFIG_USER_ONLY
uint32_t old, new, cmp;
int mmu_idx = cpu_mmu_index(env, 0);
uint32_t old, new, cmp, mask, *haddr;
void *vaddr;
vaddr = probe_access(env, addr, 3, MMU_DATA_STORE, mmu_idx, ra);
if (vaddr == NULL) {
cpu_loop_exit_atomic(env_cpu(env), ra);
}
haddr = (uint32_t *)((uintptr_t)vaddr & -4);
mask = addr & 1 ? 0x00ffffffu : 0xffffff00u;
uint32_t *haddr = g2h(env_cpu(env), addr - 1);
old = *haddr;
while (1) {
new = (old & ~mask) | (val & mask);
new = be32_to_cpu((cpu_to_be32(old) & ~mask) | (val & mask));
cmp = qatomic_cmpxchg(haddr, old, new);
if (cmp == old) {
return;
}
old = cmp;
}
#else
/* FIXME -- we can do better. */
cpu_loop_exit_atomic(env_cpu(env), ra);
#endif
}
static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ureg val,
@ -92,7 +95,7 @@ static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ureg val,
case 1:
/* The 3 byte store must appear atomic. */
if (parallel) {
atomic_store_3(env, addr, val, 0x00ffffffu, ra);
atomic_store_3(env, addr, val, ra);
} else {
cpu_stb_data_ra(env, addr, val >> 16, ra);
cpu_stw_data_ra(env, addr + 1, val, ra);
@ -122,7 +125,7 @@ static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ureg val,
case 3:
/* The 3 byte store must appear atomic. */
if (parallel) {
atomic_store_3(env, addr - 3, val, 0xffffff00u, ra);
atomic_store_3(env, addr - 3, val, ra);
} else {
cpu_stw_data_ra(env, addr - 3, val >> 16, ra);
cpu_stb_data_ra(env, addr - 1, val >> 8, ra);

View file

@ -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

View file

@ -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

View file

@ -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

87
tests/tcg/hppa/stby.c Normal file
View file

@ -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;
}