From: Christoph Schlameuss <schlameuss@linux.ibm.com>
To: linux-s390@vger.kernel.org
Cc: "Janosch Frank" <frankja@linux.ibm.com>,
"Claudio Imbrenda" <imbrenda@linux.ibm.com>,
"Nico Böhr" <nrb@linux.ibm.com>,
"David Hildenbrand" <david@kernel.org>,
"Thomas Huth" <thuth@redhat.com>,
kvm@vger.kernel.org,
"Christoph Schlameuss" <schlameuss@linux.ibm.com>,
"Nina Schoetterl-Glausch" <nsg@linux.ibm.com>
Subject: [kvm-unit-tests PATCH v2 1/5] s390x: snippets: Add reset_guest() to lib
Date: Tue, 24 Mar 2026 16:28:05 +0100 [thread overview]
Message-ID: <20260324-vsie-stfle-fac-v2-1-5e52be2e4081@linux.ibm.com> (raw)
In-Reply-To: <20260324-vsie-stfle-fac-v2-0-5e52be2e4081@linux.ibm.com>
From: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Extract reset_guest from spec_ex-sie into the lib.
After reset_guest() the snippet can be executed again.
Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Signed-off-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
---
lib/s390x/snippet.h | 6 ++++++
s390x/spec_ex-sie.c | 10 ++--------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/s390x/snippet.h b/lib/s390x/snippet.h
index 910849aa186ce2f94c64ac1f40f8d6d7cdc36a1f..6f611de510d832f23384739606da13e71de3d6fd 100644
--- a/lib/s390x/snippet.h
+++ b/lib/s390x/snippet.h
@@ -83,6 +83,12 @@ static inline void snippet_init(struct vm *vm, const char *gbin,
vm->sblk->ictl = ICTL_OPEREXC | ICTL_PINT;
}
+static inline void reset_guest(struct vm *vm)
+{
+ vm->sblk->gpsw = snippet_psw;
+ vm->sblk->icptcode = 0;
+}
+
/*
* Sets up a snippet UV/PV guest on top of an existing and initialized
* SIE vm struct.
diff --git a/s390x/spec_ex-sie.c b/s390x/spec_ex-sie.c
index fe2f23ee3d84fa144416808cb4b353627fe87f3d..75625ecffc4a5a09ff7ef6136b7f1120a831a8c5 100644
--- a/s390x/spec_ex-sie.c
+++ b/s390x/spec_ex-sie.c
@@ -31,12 +31,6 @@ static void setup_guest(void)
SNIPPET_LEN(c, spec_ex), SNIPPET_UNPACK_OFF);
}
-static void reset_guest(void)
-{
- vm.sblk->gpsw = snippet_psw;
- vm.sblk->icptcode = 0;
-}
-
static void test_spec_ex_sie(void)
{
const char *msg;
@@ -45,7 +39,7 @@ static void test_spec_ex_sie(void)
report_prefix_push("SIE spec ex interpretation");
report_prefix_push("off");
- reset_guest();
+ reset_guest(&vm);
sie(&vm);
/* interpretation off -> initial exception must cause interception */
report(vm.sblk->icptcode == ICPT_PROGI
@@ -56,7 +50,7 @@ static void test_spec_ex_sie(void)
report_prefix_push("on");
vm.sblk->ecb |= ECB_SPECI;
- reset_guest();
+ reset_guest(&vm);
sie(&vm);
/* interpretation on -> configuration dependent if initial exception causes
* interception, but invalid new program PSW must
--
2.53.0
next prev parent reply other threads:[~2026-03-24 15:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 15:28 [kvm-unit-tests PATCH v2 0/5] s390x: Add test for STFLE interpretive execution (format-2) Christoph Schlameuss
2026-03-24 15:28 ` Christoph Schlameuss [this message]
2026-04-15 11:00 ` [kvm-unit-tests PATCH v2 1/5] s390x: snippets: Add reset_guest() to lib Nico Boehr
2026-03-24 15:28 ` [kvm-unit-tests PATCH v2 2/5] s390x: sclp: Remove unnecessary padding from struct sclp_facilities Christoph Schlameuss
2026-03-25 9:20 ` Janosch Frank
2026-04-15 11:10 ` Nico Boehr
2026-03-24 15:28 ` [kvm-unit-tests PATCH v2 3/5] s390x: sclp: Rework sclp_facilities_setup() for simpler control flow Christoph Schlameuss
2026-04-15 11:27 ` Nico Boehr
2026-04-17 15:28 ` Christoph Schlameuss
2026-03-24 15:28 ` [kvm-unit-tests PATCH v2 4/5] s390x: sclp: Add detection of alternate STFLE facilities Christoph Schlameuss
2026-04-15 11:34 ` Nico Boehr
2026-04-17 15:28 ` Christoph Schlameuss
2026-03-24 15:28 ` [kvm-unit-tests PATCH v2 5/5] s390x: Add test for STFLE interpretive execution (format-2) Christoph Schlameuss
2026-03-25 10:18 ` Janosch Frank
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=20260324-vsie-stfle-fac-v2-1-5e52be2e4081@linux.ibm.com \
--to=schlameuss@linux.ibm.com \
--cc=david@kernel.org \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox