summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/lib
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2018-10-16 18:50:08 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-10-17 00:30:18 +0200
commit1e7ecd1b3d21a6302f3ee4a3720f682eb2467a3c (patch)
treee25ed1e05c29d87a2404b48fe8bbc62f72415777 /tools/testing/selftests/kvm/lib
parentx86/kvm/nVMX: allow bare VMXON state migration (diff)
downloadlinux-1e7ecd1b3d21a6302f3ee4a3720f682eb2467a3c.tar.xz
linux-1e7ecd1b3d21a6302f3ee4a3720f682eb2467a3c.zip
KVM: selftests: state_test: test bare VMXON migration
Split prepare_for_vmx_operation() into prepare_for_vmx_operation() and load_vmcs() so we can inject GUEST_SYNC() in between. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/lib')
-rw-r--r--tools/testing/selftests/kvm/lib/x86_64/vmx.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/lib/x86_64/vmx.c b/tools/testing/selftests/kvm/lib/x86_64/vmx.c
index d7c401472247..cc356da9b3d8 100644
--- a/tools/testing/selftests/kvm/lib/x86_64/vmx.c
+++ b/tools/testing/selftests/kvm/lib/x86_64/vmx.c
@@ -107,6 +107,11 @@ bool prepare_for_vmx_operation(struct vmx_pages *vmx)
if (vmxon(vmx->vmxon_gpa))
return false;
+ return true;
+}
+
+bool load_vmcs(struct vmx_pages *vmx)
+{
/* Load a VMCS. */
*(uint32_t *)(vmx->vmcs) = vmcs_revision();
if (vmclear(vmx->vmcs_gpa))