From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
David Hildenbrand <david@redhat.com>
Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
Ilya Leoshkevich <iii@linux.ibm.com>,
qemu-stable@nongnu.org
Subject: [PATCH v4 4/4] tests/tcg/s390x: Test SET CLOCK COMPARATOR
Date: Thu, 16 Oct 2025 19:58:33 +0200 [thread overview]
Message-ID: <20251016175954.41153-5-iii@linux.ibm.com> (raw)
In-Reply-To: <20251016175954.41153-1-iii@linux.ibm.com>
Add a small test to prevent regressions.
Cc: qemu-stable@nongnu.org
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
tests/tcg/s390x/Makefile.softmmu-target | 1 +
tests/tcg/s390x/sckc.S | 63 +++++++++++++++++++++++++
2 files changed, 64 insertions(+)
create mode 100644 tests/tcg/s390x/sckc.S
diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Makefile.softmmu-target
index 8cd4667c63b..a4425d3184a 100644
--- a/tests/tcg/s390x/Makefile.softmmu-target
+++ b/tests/tcg/s390x/Makefile.softmmu-target
@@ -28,6 +28,7 @@ ASM_TESTS = \
mc \
per \
precise-smc-softmmu \
+ sckc \
ssm-early \
stosm-early \
stpq \
diff --git a/tests/tcg/s390x/sckc.S b/tests/tcg/s390x/sckc.S
new file mode 100644
index 00000000000..ecd64a3059e
--- /dev/null
+++ b/tests/tcg/s390x/sckc.S
@@ -0,0 +1,63 @@
+/*
+ * Test clock comparator.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+ .org 0x130
+ext_old_psw:
+ .org 0x1b0
+ext_new_psw:
+ .quad 0x180000000, _ext /* 64-bit mode */
+ .org 0x1d0
+pgm_new_psw:
+ .quad 0x2000000000000,0 /* disabled wait */
+ .org 0x200 /* lowcore padding */
+
+ .globl _start
+_start:
+ lpswe start31_psw
+_start31:
+ stctg %c0,%c0,c0
+ oi c0+6,8 /* set clock-comparator subclass mask */
+ lctlg %c0,%c0,c0
+
+0:
+ brasl %r14,_f /* %r14's most significant bit is 1 */
+ jg 0b
+_f:
+ br %r14 /* it must not end up in ext_old_psw */
+
+_ext:
+ stg %r0,ext_saved_r0
+
+ lg %r0,ext_counter
+ aghi %r0,1
+ stg %r0,ext_counter
+
+ cgfi %r0,0x1000
+ jnz 0f
+ lpswe success_psw
+0:
+
+ stck clock
+ lg %r0,clock
+ agfi %r0,0x40000 /* 64us * 0x1000 =~ 0.25s */
+ stg %r0,clock
+ sckc clock
+
+ lg %r0,ext_saved_r0
+ lpswe ext_old_psw
+
+ .align 8
+start31_psw:
+ .quad 0x100000080000000,_start31 /* EX, 31-bit mode */
+success_psw:
+ .quad 0x2000000000000,0xfff /* see is_special_wait_psw() */
+c0:
+ .skip 8
+clock:
+ .quad 0
+ext_counter:
+ .quad 0
+ext_saved_r0:
+ .skip 8
--
2.51.0
next prev parent reply other threads:[~2025-10-16 18:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 17:58 [PATCH v4 0/3] target/s390x: Fix missing clock-comparator interrupts Ilya Leoshkevich
2025-10-16 17:58 ` [PATCH v4 1/4] target/s390x: Fix missing interrupts for small CKC values Ilya Leoshkevich
2025-11-27 16:43 ` Thomas Huth
2025-11-27 18:00 ` Ilya Leoshkevich
2025-11-27 21:54 ` Ilya Leoshkevich
2025-10-16 17:58 ` [PATCH v4 2/4] target/s390x: Fix missing clock-comparator interrupts after reset Ilya Leoshkevich
2025-10-16 17:58 ` [PATCH v4 3/4] target/s390x: Use address generation for register branch targets Ilya Leoshkevich
2025-10-16 18:13 ` Thomas Weißschuh
2025-10-16 17:58 ` Ilya Leoshkevich [this message]
2025-10-29 9:55 ` [PATCH PING v4 0/3] target/s390x: Fix missing clock-comparator interrupts Ilya Leoshkevich
2025-10-29 12:19 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251016175954.41153-5-iii@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=david@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.