Skip to contentSkip to conversation

s390x: Add tests for execute-type instructions

PATCH Superseded Nina Schoetterl-Glausch 1 participant 1 message Mar 3, 2023

Subsystems (2)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 s390x: Add tests for execute-type instructions

Test the instruction address used by targets of an execute instruction. When the target instruction calculates a relative address, the result is relative to the target instruction, not the execute instruction.

---

v3 -> v4:
* fix nits (thanks Janosch)
* pickup R-b (thanks Janosch)

v2 -> v3:
* add some comments (thanks Janosch)
* add two new tests (drop Nico's R-b)
* push prefix

v1 -> v2:
* add test to unittests.cfg and .gitlab-ci.yml
* pick up R-b (thanks Nico)

TCG does the address calculation relative to the execute instruction. Everything that has an operand that is relative to the instruction given by the immediate in the instruction and goes through in2_ri2 in TCG has this problem, because in2_ri2 does the calculation relative to pc_next which is the address of the EX(RL).
That should make fixing it easier tho.

Range-diff against v3:
1: 136eb2a2 ! 1: f29ef634 s390x: Add tests for execute-type instructions
@@ Commit message
When the target instruction calculates a relative address, the result is relative to the target instruction, not the execute instruction.

+ Reviewed-by: Janosch Frank <[email protected]>

## s390x/Makefile ##
@@ s390x/ex.c (new)
+ * Copyright IBM Corp. 2023
+ *
+ * Test EXECUTE (RELATIVE LONG).
-+ * These instruction execute a target instruction. The target instruction is formed ++ * These instructions execute a target instruction. The target instruction is formed
+ * by reading an instruction from memory and optionally modifying some of its bits.
+ * The execution of the target instruction is the same as if it was executed
+ * normally as part of the instruction sequence, except for the instruction
@@ s390x/ex.c (new)
+
+ report_prefix_push("CRL");
+ asm volatile ( ".pushsection .rodata\n"
-+ " .balign 4\n" //operand of crl must be word aligned
++ //operand of crl must be word aligned
++ " .balign 4\n"
+ "0: crl %[crl_word],0\n"
+ " .popsection\n"
+

 s390x/Makefile      |   1 +
 s390x/ex.c          | 170 ++++++++++++++++++++++++++++++++++++++++++++
 s390x/unittests.cfg |   3 +
 .gitlab-ci.yml      |   1 +
 4 files changed, 175 insertions(+)
 create mode 100644 s390x/ex.c
s390x/Makefile +1 -0
index 97a61611..6cf8018b 100644
@@ -39,6 +39,7 @@ tests += $(TEST_DIR)/panic-loop-extint.elf
 tests += $(TEST_DIR)/panic-loop-pgm.elf
 tests += $(TEST_DIR)/migration-sck.elf
 tests += $(TEST_DIR)/exittime.elf
+tests += $(TEST_DIR)/ex.elf
 
 pv-tests += $(TEST_DIR)/pv-diags.elf
 
s390x/ex.c new file +170 -0

170 lines not on this page · raw message

s390x/unittests.cfg +3 -0
index d97eb5e9..b61faf07 100644
@@ -215,3 +215,6 @@ file = migration-skey.elf
 smp = 2
 groups = migration
 extra_params = -append '--parallel'
+
+[execute]
+file = ex.elf
.gitlab-ci.yml +1 -0
index ad7949c9..a999f64a 100644
@@ -275,6 +275,7 @@ s390x-kvm:
   - ACCEL=kvm ./run_tests.sh
       selftest-setup intercept emulator sieve sthyi diag10 diag308 pfmf
       cmm vector gs iep cpumodel diag288 stsi sclp-1g sclp-3g css skrf sie
+      execute
       | tee results.txt
   - grep -q PASS results.txt && ! grep -q FAIL results.txt
  only:

base-commit: e3c5c3ef2524c58023073c0fadde2e8ae3c04ec6

Signature · 1 line
2.36.1