On Fri, 24 Mar 2023 14:31:15 +0100 Nico Boehr <nrb@xxxxxxxxxxxxx> wrote: > Quoting Claudio Imbrenda (2023-03-23 15:36:44) > > > diff --git a/tools/testing/selftests/kvm/s390x/cmma_test.c b/tools/testing/selftests/kvm/s390x/cmma_test.c > > > new file mode 100644 > > > index 000000000000..76751abf2331 > > > --- /dev/null > > > +++ b/tools/testing/selftests/kvm/s390x/cmma_test.c > [...] > > > +static void create_main_memslot(struct kvm_vm *vm) > > > +{ > > > + int i; > > > + > > > + vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS, 0, 0, MAIN_PAGE_COUNT, 0); > > > + for (i = 0; i < NR_MEM_REGIONS; i++) > > > + vm->memslots[i] = 0; > > > > can you explain why you are zeroing all memslots? > > I think it's not all memslots, this array only contains IDs of some memslots. I think the IDs are set to 0 to indicate "this slot is unused". > > I did this here, because that's what __vm_create does. Since I can't use __vm_create (I want my custom memslots), I have to use ____vm_create and I thought it's good to just do the same thing here. can you please add a comment to explain this