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 Reviewed-by: Nico Boehr --- 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); -- 2.51.0