]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: selftests: Do not use hardcoded page sizes in guest_memfd test
authorFuad Tabba <tabba@google.com>
Tue, 29 Jul 2025 22:54:53 +0000 (15:54 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 27 Aug 2025 08:37:03 +0000 (04:37 -0400)
commit692f6ecf387aff1596ea1d86be7d333a474b7d56
treebf619e84fb5c97008a0c34b599f03f83605a5c33
parent3d3a04fad25a6621828518a2abe536142d2c1a7d
KVM: selftests: Do not use hardcoded page sizes in guest_memfd test

Update the guest_memfd_test selftest to use getpagesize() instead of
hardcoded 4KB page size values.

Using hardcoded page sizes can cause test failures on architectures or
systems configured with larger page sizes, such as arm64 with 64KB
pages. By dynamically querying the system's page size, the test becomes
more portable and robust across different environments.

Additionally, build the guest_memfd_test selftest for arm64.

Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Shivank Garg <shivankg@amd.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Suggested-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20250729225455.670324-23-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/Makefile.kvm
tools/testing/selftests/kvm/guest_memfd_test.c