From: "Christoph Schlameuss" <schlameuss@linux.ibm.com>
To: "Janosch Frank" <frankja@linux.ibm.com>, <kvm@vger.kernel.org>
Cc: <linux-s390@vger.kernel.org>, <imbrenda@linux.ibm.com>,
<borntraeger@linux.ibm.com>, <nrb@linux.ibm.com>
Subject: Re: [kvm-unit-tests PATCH v2 4/4] lib: s390x: snippet: Add function to create a guest of specific length
Date: Tue, 21 Apr 2026 17:30:25 +0200 [thread overview]
Message-ID: <DHYXV833VJC0.8NBWBY4RFMD@linux.ibm.com> (raw)
In-Reply-To: <20260420084933.251244-5-frankja@linux.ibm.com>
On Mon Apr 20, 2026 at 10:44 AM CEST, Janosch Frank wrote:
> While 1MB is certainly enough to store the guest code, it's often not
> enough for memory tests. Let's add a separate function to allow
> arbitrary guest sizes.
>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
> ---
> lib/s390x/snippet.h | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/lib/s390x/snippet.h b/lib/s390x/snippet.h
> index 94688f49..05c9a2d4 100644
> --- a/lib/s390x/snippet.h
> +++ b/lib/s390x/snippet.h
> @@ -123,10 +123,14 @@ static inline void snippet_pv_init(struct vm *vm, const char *gbin,
> }
>
> /* Allocates and sets up a snippet based guest */
> -static inline void snippet_setup_guest(struct vm *vm, bool is_pv)
> +static inline void snippet_setup_guest_len(struct vm *vm, bool is_pv,
> + unsigned long len)
> {
> + /* Guest sizes are specified in megabyte chunks */
> + assert(!(len & ~HPAGE_MASK));
> +
> /* Initialize the vm struct and allocate control blocks */
> - sie_guest_create(vm, SZ_1M);
> + sie_guest_create(vm, len);
>
> if (is_pv) {
> /* FMT4 needs a ESCA */
> @@ -141,6 +145,12 @@ static inline void snippet_setup_guest(struct vm *vm, bool is_pv)
> }
> }
>
> +/* Allocates and sets up a snippet based guest */
> +static inline void snippet_setup_guest(struct vm *vm, bool is_pv)
> +{
> + snippet_setup_guest_len(vm, is_pv, SZ_1M);
> +}
> +
> static inline void snippet_destroy_guest(struct vm *vm)
> {
> sie_guest_destroy(vm);
prev parent reply other threads:[~2026-04-21 15:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 8:44 [kvm-unit-tests PATCH v2 0/4] s390x: Cleanup virtualization library Janosch Frank
2026-04-20 8:44 ` [kvm-unit-tests PATCH v2 1/4] lib: s390x: Add function to get page root Janosch Frank
2026-04-21 15:12 ` Christoph Schlameuss
2026-04-20 8:44 ` [kvm-unit-tests PATCH v2 2/4] lib: s390x: sie: Allocate physical guest memory via memalign Janosch Frank
2026-04-21 15:16 ` Christoph Schlameuss
2026-04-21 15:31 ` Christoph Schlameuss
2026-04-20 8:44 ` [kvm-unit-tests PATCH v2 3/4] lib: s390x: sie: Memory rework Janosch Frank
2026-04-21 15:25 ` Christoph Schlameuss
2026-04-20 8:44 ` [kvm-unit-tests PATCH v2 4/4] lib: s390x: snippet: Add function to create a guest of specific length Janosch Frank
2026-04-21 15:30 ` Christoph Schlameuss [this message]
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=DHYXV833VJC0.8NBWBY4RFMD@linux.ibm.com \
--to=schlameuss@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--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 \
/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