]> Git Repo - linux.git/commit
KVM: s390x: selftests: Add shared zeropage test
authorDavid Hildenbrand <[email protected]>
Fri, 12 Apr 2024 08:43:29 +0000 (10:43 +0200)
committerAlexander Gordeev <[email protected]>
Wed, 5 Jun 2024 15:03:24 +0000 (17:03 +0200)
commit01c51a32dc18f128d2e55a7b2128b77fc01a2285
treeef52476a167db8f6ae380a3784c1698d1761b317
parentd38e48563c1f70460503de7ffff9a7f46b54b67d
KVM: s390x: selftests: Add shared zeropage test

Let's test that we can have shared zeropages in our process as long as
storage keys are not getting used, that shared zeropages are properly
unshared (replaced by anonymous pages) once storage keys are enabled,
and that no new shared zeropages are populated after storage keys
were enabled.

We require the new pagemap interface to detect the shared zeropage.

On an old kernel (zeropages always disabled):
# ./s390x/shared_zeropage_test
TAP version 13
1..3
not ok 1 Shared zeropages should be enabled
ok 2 Shared zeropage should be gone
ok 3 Shared zeropages should be disabled
# Totals: pass:2 fail:1 xfail:0 xpass:0 skip:0 error:0

On a fixed kernel:
# ./s390x/shared_zeropage_test
TAP version 13
1..3
ok 1 Shared zeropages should be enabled
ok 2 Shared zeropage should be gone
ok 3 Shared zeropages should be disabled
# Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0

Testing of UFFDIO_ZEROPAGE can be added later.

[ agordeev: Fixed checkpatch complaint, added ucall_common.h include ]

Cc: Christian Borntraeger <[email protected]>
Cc: Janosch Frank <[email protected]>
Cc: Claudio Imbrenda <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Alexander Gordeev <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Shuah Khan <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Acked-by: Christian Borntraeger <[email protected]>
Acked-by: Muhammad Usama Anjum <[email protected]>
Tested-by: Alexander Gordeev <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexander Gordeev <[email protected]>
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/s390x/shared_zeropage_test.c [new file with mode: 0644]
This page took 0.055915 seconds and 4 git commands to generate.