[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 25/27] tests/tcg/s390x: Add per.S
From: |
Richard Henderson |
Subject: |
[PATCH v2 25/27] tests/tcg/s390x: Add per.S |
Date: |
Sun, 11 Dec 2022 09:28:00 -0600 |
From: Ilya Leoshkevich <iii@linux.ibm.com>
Add a small test to avoid regressions.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20221130174610.434590-2-iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tests/tcg/s390x/Makefile.softmmu-target | 1 +
tests/tcg/s390x/per.S | 55 +++++++++++++++++++++++++
2 files changed, 56 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 d6ca8d7342..7ee69e78d8 100644
--- a/tests/tcg/s390x/Makefile.softmmu-target
+++ b/tests/tcg/s390x/Makefile.softmmu-target
@@ -9,3 +9,4 @@ QEMU_OPTS=-action panic=exit-failure -kernel
TESTS += unaligned-lowcore
TESTS += bal
TESTS += sam
+TESTS += per
diff --git a/tests/tcg/s390x/per.S b/tests/tcg/s390x/per.S
new file mode 100644
index 0000000000..02f8422c44
--- /dev/null
+++ b/tests/tcg/s390x/per.S
@@ -0,0 +1,55 @@
+#define N_ITERATIONS 10
+
+ .org 0x8d
+ilc:
+ .org 0x8e
+program_interruption_code:
+ .org 0x96
+per_code:
+ .org 0x150
+program_old_psw:
+ .org 0x1d0 /* program new PSW */
+ .quad 0,pgm_handler
+ .org 0x200 /* lowcore padding */
+
+ .globl _start
+_start:
+ lpswe per_on_psw
+start_per:
+ lghi %r0,N_ITERATIONS
+ xgr %r1,%r1
+ lctlg %c9,%c11,per_on_regs
+loop:
+ brct %r0,loop
+ lctlg %c9,%c11,per_off_regs
+ cgijne %r1,N_ITERATIONS-1,fail /* expected number of events? */
+ lpswe success_psw
+fail:
+ lpswe failure_psw
+
+pgm_handler:
+ chhsi program_interruption_code,0x80 /* PER event? */
+ jne fail
+ cli per_code,0x80 /* successful-branching event? */
+ jne fail
+ la %r1,1(%r1) /* increment event counter */
+ mvc return_psw(8),program_old_psw
+ lg %r3,program_old_psw+8
+ llgc %r2,ilc
+ sgr %r3,%r2 /* rewind PSW */
+ stg %r3,return_psw+8
+ lpswe return_psw
+
+ .align 8
+per_on_psw:
+ .quad 0x4000000000000000,start_per
+per_on_regs:
+ .quad 0x80000000,0,-1 /* successful-branching everywhere */
+per_off_regs:
+ .quad 0,0,0
+return_psw:
+ .quad 0,0
+success_psw:
+ .quad 0x2000000000000,0xfff /* see is_special_wait_psw() */
+failure_psw:
+ .quad 0x2000000000000,0 /* disabled wait */
--
2.34.1
- Re: [PATCH v2 15/27] target/s390x: Add disp argument to update_psw_addr, (continued)
- [PATCH v2 09/27] target/s390x: Remove pc argument to pc_to_link_into, Richard Henderson, 2022/12/11
- [PATCH v2 17/27] target/s390x: Introduce per_enabled, Richard Henderson, 2022/12/11
- [PATCH v2 08/27] target/s390x: Introduce gen_psw_addr_disp, Richard Henderson, 2022/12/11
- [PATCH v2 10/27] target/s390x: Use gen_psw_addr_disp in pc_to_link_info, Richard Henderson, 2022/12/11
- [PATCH v2 12/27] target/s390x: Use gen_psw_addr_disp in op_sam, Richard Henderson, 2022/12/11
- [PATCH v2 19/27] target/s390x: Introduce help_goto_indirect, Richard Henderson, 2022/12/11
- [PATCH v2 23/27] target/s390x: Remove PER check from use_goto_tb, Richard Henderson, 2022/12/11
- [PATCH v2 25/27] tests/tcg/s390x: Add per.S,
Richard Henderson <=
- [PATCH v2 24/27] target/s390x: Fix successful-branch PER events, Richard Henderson, 2022/12/11
- [PATCH v2 26/27] target/s390x: Pass original r2 register to BCR, Richard Henderson, 2022/12/11
- [PATCH v2 21/27] target/s390x: Simplify help_branch, Richard Henderson, 2022/12/11
- [PATCH v2 20/27] target/s390x: Split per_branch, Richard Henderson, 2022/12/11
- [PATCH v2 22/27] target/s390x: Split per_breaking_event from per_branch_*, Richard Henderson, 2022/12/11
- [PATCH v2 27/27] target/s390x: Enable TARGET_TB_PCREL, Richard Henderson, 2022/12/11