Re: [PATCH v2 06/13] KVM: selftests: Stash the host page size in a global in the guest_memfd test
From: Ackerley Tng
Date: Mon Oct 06 2025 - 14:30:43 EST
Sean Christopherson <seanjc@xxxxxxxxxx> writes:
> Use a global variable to track the host page size in the guest_memfd test
> so that the information doesn't need to be constantly passed around. The
> state is purely a reflection of the underlying system, i.e. can't be set
> by the test and is constant for a given invocation of the test, and thus
> explicitly passing the host page size to individual testcases adds no
> value, e.g. doesn't allow testing different combinations.
>
> Making page_size a global will simplify an upcoming change to create a new
> guest_memfd instance per testcase.
>
> No functional change intended.
>
> Reviewed-by: Fuad Tabba <tabba@xxxxxxxxxx>
> Tested-by: Fuad Tabba <tabba@xxxxxxxxxx>
> Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>
> Reviewed-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>
Tested-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> ---
> .../testing/selftests/kvm/guest_memfd_test.c | 37 +++++++++----------
> 1 file changed, 18 insertions(+), 19 deletions(-)
>
>
> [...snip...]
>