]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: allow using UFFD minor faults for demand paging
authorAxel Rasmussen <axelrasmussen@google.com>
Wed, 19 May 2021 20:03:38 +0000 (13:03 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 27 May 2021 11:45:57 +0000 (07:45 -0400)
commit82f33a025aa3b1fe8a0315b65395e16bf40f0cbb
treebaa1e3ffd4fde19f8ebb109fe65e5571c726583c
parentf035c69db84741677a53f0b905054b177bd0e0bb
KVM: selftests: allow using UFFD minor faults for demand paging

UFFD handling of MINOR faults is a new feature whose use case is to
speed up demand paging (compared to MISSING faults). So, it's
interesting to let this selftest exercise this new mode.

Modify the demand paging test to have the option of using UFFD minor
faults, as opposed to missing faults. Now, when turning on userfaultfd
with '-u', the desired mode has to be specified ("MISSING" or "MINOR").

If we're in minor mode, before registering, prefault via the *alias*.
This way, the guest will trigger minor faults, instead of missing
faults, and we can UFFDIO_CONTINUE to resolve them.

Modify the page fault handler function to use the right ioctl depending
on the mode we're running in. In MINOR mode, use UFFDIO_CONTINUE.

Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Message-Id: <20210519200339.829146-10-axelrasmussen@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/demand_paging_test.c