]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: selftests: add basic test for state save and restore
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 26 Jul 2018 11:19:23 +0000 (13:19 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 6 Aug 2018 15:32:04 +0000 (17:32 +0200)
commita186b293442407a789021731425bebd17198f7e0
tree4854009f8c106b8b88b7590aeb0b4aae73448a96
parentc6d26a6429d6214b62642e00d5fa390a425a787d
kvm: selftests: add basic test for state save and restore

The test calls KVM_RUN repeatedly, and creates an entirely new VM with the
old memory and vCPU state on every exit to userspace.  The kvm_util API is
expanded with two functions that manage the lifetime of a kvm_vm struct:
the first closes the file descriptors and leaves the memory allocated,
and the second opens the file descriptors and reuses the memory from
the previous incarnation of the kvm_vm struct.

For now the test is very basic, as it does not test for example XSAVE or
vCPU events.  However, it will test nested virtualization state starting
with the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/include/x86.h
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/kvm_util_internal.h
tools/testing/selftests/kvm/lib/x86.c
tools/testing/selftests/kvm/state_test.c [new file with mode: 0644]