On 7/23/24 11:31, Christoph Schlameuss wrote:
Add test case running code interacting with registers within a
ucontrol VM.

* Add uc_gprs test case

The test uses the same VM setup using the fixture and debug macros
introduced in earlier patches in this series.

Signed-off-by: Christoph Schlameuss <schlame...@linux.ibm.com>
---
  .../selftests/kvm/s390x/ucontrol_test.c       | 132 ++++++++++++++++++
  1 file changed, 132 insertions(+)

diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c 
b/tools/testing/selftests/kvm/s390x/ucontrol_test.c
index 527c431a9758..c98d5a3a315b 100644
--- a/tools/testing/selftests/kvm/s390x/ucontrol_test.c
+++ b/tools/testing/selftests/kvm/s390x/ucontrol_test.c
@@ -43,6 +43,23 @@ void require_ucontrol_admin(void)
        TEST_REQUIRE(kvm_has_cap(KVM_CAP_S390_UCONTROL));
  }
+/* Test program setting some registers and looping */
+extern char test_gprs_pgm[];
+asm("test_gprs_pgm:\n"
+       "xgr       %r0, %r0\n"
+       "lgfi      %r1,1\n"
[...]

Naming something PGM for handling anything else than Program Exceptions is not recommendable. PGM has been a stable name on s390 for code related to PGM exceptions

When first reading this I expected to find some kind of exception code.

Reply via email to