]> Gentwo Git Trees - linux/.git/commit
KVM: selftests: Stash the host page size in a global in the guest_memfd test
authorSean Christopherson <seanjc@google.com>
Fri, 3 Oct 2025 23:25:59 +0000 (16:25 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 10 Oct 2025 21:25:26 +0000 (14:25 -0700)
commit3a6c08538c742624c60cb6a53dd61eb025e0d1e1
treeac051860bc3ab44fee7f57867d94465b0517e9a4
parent44c6cb9fe9888b371e31165b2854bd0f4e2787d4
KVM: selftests: Stash the host page size in a global in the guest_memfd test

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@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Ackerley Tng <ackerleytng@google.com>
Tested-by: Ackerley Tng <ackerleytng@google.com>
Link: https://lore.kernel.org/r/20251003232606.4070510-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/guest_memfd_test.c