Skip to contentSkip to conversation

Misc patch queue

GIT PULL Applied Richard Henderson 1 participant 7 messages Jan 3, 2022 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

The following changes since commit 69f153667fce723ee546d2f047d66d0cfa67c3cc:

Merge tag 'memory-api-20211231' of https://github.com/philmd/qemu into staging (2021-12-30 17:02:42 -0800)

are available in the Git repository at:

https://gitlab.com/rth7680/qemu.git tags/pull-misc-20220103

for you to fetch changes up to 5c23f0c3191907000bab278654570a7d5879822a:

gitlab: Disable check-python-tox (2022-01-03 08:55:55 -0800)

----------------------------------------------------------------
Fix some meson conversion breakage
Disable check-python-tox
Fix emulation of hppa STBY insn

----------------------------------------------------------------
Richard Henderson (5):
meson: Unify mips and mips64 in host_arch tests/tcg: Use $cpu in configure.sh tests/tcg: Unconditionally use 90 second timeout target/hppa: Fix atomic_store_3 for STBY
gitlab: Disable check-python-tox

 configure                      |  2 +-
 meson.build                    |  2 +
 target/hppa/op_helper.c        | 27 +++++++------
 tests/tcg/hppa/stby.c          | 87 ++++++++++++++++++++++++++++++++++++++++++
 .gitlab-ci.d/static_checks.yml |  2 +
 tests/tcg/Makefile.target      | 12 +++---
 tests/tcg/configure.sh         |  2 +-
 tests/tcg/hppa/Makefile.target |  5 +++
 8 files changed, 118 insertions(+), 21 deletions(-)
 create mode 100644 tests/tcg/hppa/stby.c
#1 lore raw

[PULL 1/5] meson: Unify mips and mips64 in host_arch

Fixes the build on a mips64 host. Prior to the break, we identified the arch via the __mips__ define; afterward we use meson's host_machine.cpu_family(). Restore the previous combination.

Fixes 823eb013452e ("configure, meson: move ARCH to meson.build")
---
 meson.build | 2 ++
 1 file changed, 2 insertions(+)
meson.build +2 -0
index 886f0a9343..53065e96ec 100644
@@ -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
Signature · 1 line
2.25.1
#2 lore raw

[PULL 3/5] tests/tcg: Unconditionally use 90 second timeout

In reply to Richard Henderson

The cross-i386-tci test has timeouts because we're no longer applying the timeout that we desired. Hack around it.

Fixes 23a77b2d18b8 ("build-system: clean up TCG/TCI configury")
---
 tests/tcg/Makefile.target | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
tests/tcg/Makefile.target +5 -7
index 63cf1b2573..0f8645f782 100644
@@ -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
 
Signature · 1 line
2.25.1
#3 lore raw

[PULL 5/5] gitlab: Disable check-python-tox

In reply to Richard Henderson

Set this test to be manually run, until failures can be fixed.

---
 .gitlab-ci.d/static_checks.yml | 2 ++
 1 file changed, 2 insertions(+)
.gitlab-ci.d/static_checks.yml +2 -0
index 902843f8b3..5e955540d3 100644
@@ -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
Signature · 1 line
2.25.1
#4 lore raw

[PULL 4/5] target/hppa: Fix atomic_store_3 for STBY

In reply to Richard Henderson

The parallel version of STBY did not take host endianness into account, and also computed the incorrect address for STBY_E.

Bswap twice to handle the merge and store. Compute mask inside the function rather than as a parameter. Force align the address, rather than subtracting one.

Generalize the function to system mode by using probe_access().

---
 target/hppa/op_helper.c        | 27 ++++++-----
 tests/tcg/hppa/stby.c          | 87 ++++++++++++++++++++++++++++++++++
 tests/tcg/hppa/Makefile.target |  5 ++
 3 files changed, 107 insertions(+), 12 deletions(-)
 create mode 100644 tests/tcg/hppa/stby.c
target/hppa/op_helper.c +15 -12
index 96d9391c39..1b86557d5d 100644
@@ -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);
tests/tcg/hppa/stby.c new file +87 -0

87 lines not on this page · raw message

tests/tcg/hppa/Makefile.target +5 -0
index d0d5e0e257..b78e6b4849 100644
@@ -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
Signature · 1 line
2.25.1
#5 lore raw

[PULL 2/5] tests/tcg: Use $cpu in configure.sh

In reply to Richard Henderson

Use $cpu instead of $ARCH, which has been removed from the top-level configure.

Fixes 823eb013452e ("configure, meson: move ARCH to meson.build")
---
 configure              | 2 +-
 tests/tcg/configure.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
configure +1 -1
index eb977e5b6f..030728d11e 100755
@@ -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
tests/tcg/configure.sh +1 -1
index 9ef913df5b..8eb4287c84 100755
@@ -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
Signature · 1 line
2.25.1
author Applied
#6 lore raw
In reply to Richard Henderson
Quoted 34 lines · Richard Henderson

The following changes since commit 69f153667fce723ee546d2f047d66d0cfa67c3cc:

   Merge tag 'memory-api-20211231' of https://github.com/philmd/qemu into staging (2021-12-30 17:02:42 -0800)

are available in the Git repository at:

   https://gitlab.com/rth7680/qemu.git tags/pull-misc-20220103

for you to fetch changes up to 5c23f0c3191907000bab278654570a7d5879822a:

   gitlab: Disable check-python-tox (2022-01-03 08:55:55 -0800)

----------------------------------------------------------------
Fix some meson conversion breakage
Disable check-python-tox
Fix emulation of hppa STBY insn

----------------------------------------------------------------
Richard Henderson (5):
meson: Unify mips and mips64 in host_arch tests/tcg: Use $cpu in configure.sh tests/tcg: Unconditionally use 90 second timeout target/hppa: Fix atomic_store_3 for STBY
gitlab: Disable check-python-tox

  configure                      |  2 +-
  meson.build                    |  2 +
  target/hppa/op_helper.c        | 27 +++++++------
  tests/tcg/hppa/stby.c          | 87 ++++++++++++++++++++++++++++++++++++++++++
  .gitlab-ci.d/static_checks.yml |  2 +
  tests/tcg/Makefile.target      | 12 +++---
  tests/tcg/configure.sh         |  2 +-
  tests/tcg/hppa/Makefile.target |  5 +++
  8 files changed, 118 insertions(+), 21 deletions(-)
Quoted 1 line

create mode 100644 tests/tcg/hppa/stby.c

Applied.

r~