On Fri Dec 20, 2024 at 4:52 PM CET, Claudio Imbrenda wrote: [...] > > > diff --git a/s390x/snippets/c/pv-memhog.c b/s390x/snippets/c/pv-memhog.c > > > new file mode 100644 > > > index 00000000..43f0c2b1 > > > --- /dev/null > > > +++ b/s390x/snippets/c/pv-memhog.c > > > @@ -0,0 +1,59 @@ > > [...] > > > +int main(void) > > > +{ > > > + uint64_t param, addr, i, n; > > > + > > > + READ_ONCE(*MIDPAGE_PTR(SZ_1M + 42 * PAGE_SIZE)); > > > + param = get_value(42); > > > > (see below) > > > > > + n = (param >> 32) & 0x1fffffff; > > > + n = n ? n : N_PAGES; > > > + param &= 0x7fffffff; > > > + > > > + while (true) { > > > + for (i = 0; i < n; i++) { > > > + addr = ((param ? i * param : i * i * i) * PAGE_SIZE) & MASK_2G; > > > + WRITE_ONCE(*MIDPAGE_PTR(addr), addr); > > > + } > > > + > > > + i = get_value(23); > > > + if (i != 42) > > > > I would like some defines for 23 and 42 and possibly share them with the host. > > not sure what's the easiest way to share with the host, but I can just > copy the defines The sie-dat.c test does this, there's a header file s390x/snippets/c/sie-dat.h which is included in the host: #include "snippets/c/sie-dat.h" Not the most beautiful way, but works.