On Fri, 13 Sep 2024 13:52:46 +0200 Christoph Schlameuss <schlameuss@xxxxxxxxxxxxx> wrote: > Add a test case verifying basic running and interaction of ucontrol VMs. > Fill the segment and page tables for allocated memory and map memory on > first access. > > * uc_map_unmap > Store and load data to mapped and unmapped memory and use pic segment > translation handling to map memory on access. > > Signed-off-by: Christoph Schlameuss <schlameuss@xxxxxxxxxxxxx> > --- > .../selftests/kvm/s390x/ucontrol_test.c | 145 +++++++++++++++++- > 1 file changed, 144 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c > index 030c59010fe1..084cea02c2fa 100644 > --- a/tools/testing/selftests/kvm/s390x/ucontrol_test.c > +++ b/tools/testing/selftests/kvm/s390x/ucontrol_test.c [...] >base_gpa + self->code_gpa; > @@ -222,6 +244,60 @@ TEST(uc_cap_hpage) > close(kvm_fd); > } > > +/* calculate host virtual addr from guest physical addr */ > +static void *gpa2hva(FIXTURE_DATA(uc_kvm) * self, u64 gpa) why the space? I would have expected *self > +{ > + return (void *)(self->base_hva - self->base_gpa + gpa); > +} > + > +/* map / make additional memory available */ [...]