Re: [PATCH v2 01/20] KVM: selftests: Use MEM_REGION_PT memslot instead of '0' for s390 regions/segments

From: Claudio Imbrenda

Date: Thu Sep 10 2026 - 06:45:41 EST


On Wed, 2 Sep 2026 09:41:04 -0700
Sean Christopherson <seanjc@xxxxxxxxxx> wrote:

> Use MEM_REGION_PT to indirectly specify memslot '0' instead of hardcoding
> the memslot in s390's virtual memory allocator, as a first step towards
> taking the allocation type instead of the exact, raw memslot in the
> physical memory allocator.
>
> Note, the only tests that set MEM_REGION_PT to a memslot other than '0' are
> arm64-only, i.e. s390 always uses memslot '0' for page tables.
>
> No functional change intended.
>
> Tested-by: Itaru Kitayama <itaru.kitayama@xxxxxxxxxxx>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>

Acked-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>

> ---
> tools/testing/selftests/kvm/lib/s390/processor.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/lib/s390/processor.c b/tools/testing/selftests/kvm/lib/s390/processor.c
> index a9adb3782b35..fb9dab92d4d1 100644
> --- a/tools/testing/selftests/kvm/lib/s390/processor.c
> +++ b/tools/testing/selftests/kvm/lib/s390/processor.c
> @@ -39,7 +39,8 @@ static u64 virt_alloc_region(struct kvm_vm *vm, int ri)
> u64 taddr;
>
> taddr = vm_phy_pages_alloc(vm, ri < 4 ? PAGES_PER_REGION : 1,
> - KVM_GUEST_PAGE_TABLE_MIN_PADDR, 0);
> + KVM_GUEST_PAGE_TABLE_MIN_PADDR,
> + vm->memslots[MEM_REGION_PT]);
> memset(addr_gpa2hva(vm, taddr), 0xff, PAGES_PER_REGION * vm->page_size);
>
> return (taddr & REGION_ENTRY_ORIGIN)