[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/22] tests/tcg/s390x: Add per.S
From: |
Thomas Huth |
Subject: |
[PULL 14/22] tests/tcg/s390x: Add per.S |
Date: |
Wed, 29 May 2024 12:54:46 +0200 |
From: Richard Henderson <richard.henderson@linaro.org>
Add a small test to avoid regressions.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-ID: <20240502054417.234340-15-richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/tcg/s390x/Makefile.softmmu-target | 1 +
tests/tcg/s390x/per.S | 82 +++++++++++++++++++++++++
2 files changed, 83 insertions(+)
create mode 100644 tests/tcg/s390x/per.S
diff --git a/tests/tcg/s390x/Makefile.softmmu-target
b/tests/tcg/s390x/Makefile.softmmu-target
index 1a1f088b28..80159cccf5 100644
--- a/tests/tcg/s390x/Makefile.softmmu-target
+++ b/tests/tcg/s390x/Makefile.softmmu-target
@@ -25,6 +25,7 @@ ASM_TESTS =
\
lpswe-early
\
lra
\
mc
\
+ per
\
precise-smc-softmmu
\
ssm-early
\
stosm-early
\
diff --git a/tests/tcg/s390x/per.S b/tests/tcg/s390x/per.S
new file mode 100644
index 0000000000..79e704a6ff
--- /dev/null
+++ b/tests/tcg/s390x/per.S
@@ -0,0 +1,82 @@
+ .org 0x8d
+ilc:
+ .org 0x8e
+program_interruption_code:
+ .org 0x96
+per_code:
+ .org 0x98
+per_address:
+ .org 0x150
+program_old_psw:
+ .org 0x1d0
+program_new_psw:
+ .quad 0, pgm_handler
+
+ .org 0x200 /* exit lowcore */
+
+per_on_psw:
+ .quad 0x4000000000000000, start_per
+per_on_regs:
+ .quad 0x80000000, 0, -1 /* successful-branching everywhere */
+per_off_regs:
+ .quad 0, 0 ,0
+success_psw:
+ .quad 0x2000000000000, 0xfff /* see is_special_wait_psw() */
+failure_psw:
+ .quad 0x2000000000000, 0 /* disabled wait */
+
+ .org 0x2000 /* exit lowcore pages */
+
+ .globl _start
+_start:
+ lpswe per_on_psw
+start_per:
+ lctlg %c9, %c11, per_on_regs
+
+/* Test unconditional relative branch. */
+ larl %r0, j1
+ larl %r1, d1
+ lhi %r2, 0
+j1: j d1
+ lpswe failure_psw
+d1:
+
+/* Test unconditional indirect branch. */
+ larl %r0, j2
+ larl %r1, d2
+j2: br %r1
+ lpswe failure_psw
+d2:
+
+/* Test conditional relative branch. */
+ larl %r0, j3
+ larl %r1, d3
+ clr %r1, %r2 /* d3 != 0 */
+j3: jne d3
+ lpswe failure_psw
+d3:
+
+/* Test conditional register branch. */
+ larl %r0, j4
+ larl %r1, d4
+ clr %r1, %r2 /* d4 != 0 */
+j4: bner %r1
+ lpswe failure_psw
+d4:
+
+/* Success! */
+ nop
+ lpswe success_psw
+
+pgm_handler:
+ chhsi program_interruption_code, 0x80 /* PER event? */
+ jne fail
+ cli per_code, 0x80 /* successful-branching event? */
+ jne fail
+ clg %r0, per_address /* per_address == jump insn? */
+ jne fail
+ clg %r1, program_old_psw+8 /* psw.addr updated to dest? */
+ jne fail
+ lpswe program_old_psw
+fail:
+ lpswe failure_psw
--
2.45.1
- [PULL 05/22] target/s390x: Disable conditional branch-to-next for PER, (continued)
- [PULL 05/22] target/s390x: Disable conditional branch-to-next for PER, Thomas Huth, 2024/05/29
- [PULL 03/22] target/s390x: Update CR9 bits, Thomas Huth, 2024/05/29
- [PULL 06/22] target/s390x: Introduce help_goto_indirect, Thomas Huth, 2024/05/29
- [PULL 07/22] target/s390x: Simplify help_branch, Thomas Huth, 2024/05/29
- [PULL 08/22] target/s390x: Split per_breaking_event from per_branch_*, Thomas Huth, 2024/05/29
- [PULL 10/22] target/s390x: Raise exception from per_store_real, Thomas Huth, 2024/05/29
- [PULL 09/22] target/s390x: Raise exception from helper_per_branch, Thomas Huth, 2024/05/29
- [PULL 11/22] target/s390x: Fix helper_per_ifetch flags, Thomas Huth, 2024/05/29
- [PULL 12/22] target/s390x: Simplify per_ifetch, per_check_exception, Thomas Huth, 2024/05/29
- [PULL 13/22] target/s390x: Adjust check of noreturn in translate_one, Thomas Huth, 2024/05/29
- [PULL 14/22] tests/tcg/s390x: Add per.S,
Thomas Huth <=
- [PULL 15/22] fuzz: specify audiodev for usb-audio, Thomas Huth, 2024/05/29
- [PULL 16/22] fuzz: disable leak-detection for oss-fuzz builds, Thomas Huth, 2024/05/29
- [PULL 18/22] scripts/update-linux-headers.sh: Remove temporary directory inbetween, Thomas Huth, 2024/05/29
- [PULL 17/22] hw/s390x: Remove unused macro VMSTATE_ADAPTER_ROUTES, Thomas Huth, 2024/05/29
- [PULL 19/22] scripts/update-linux-headers.sh: Fix the path of setup_data.h, Thomas Huth, 2024/05/29
- [PULL 20/22] qemu-keymap: Make references to allocations static, Thomas Huth, 2024/05/29
- [PULL 21/22] lockable: Do not cast function pointers, Thomas Huth, 2024/05/29
- [PULL 22/22] qapi: Do not cast function pointers, Thomas Huth, 2024/05/29
- Re: [PULL 00/22] s390x, build-oss-fuzz and Clang -fsanitize=undefined fixes, Richard Henderson, 2024/05/29