diff options
author | Vitaly Kuznetsov <vkuznets@redhat.com> | 2018-10-16 18:50:09 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-10-17 00:30:19 +0200 |
commit | 8cab6507f64eff0ccfea01fccbc7e3e05e2aaf7e (patch) | |
tree | d2fbccdfbddb062b027360c66c4b06c4d2da2c09 /arch/x86/kvm/x86.c | |
parent | 1e7ecd1b3d21a6302f3ee4a3720f682eb2467a3c (diff) | |
download | linux-stable-8cab6507f64eff0ccfea01fccbc7e3e05e2aaf7e.tar.gz linux-stable-8cab6507f64eff0ccfea01fccbc7e3e05e2aaf7e.tar.bz2 linux-stable-8cab6507f64eff0ccfea01fccbc7e3e05e2aaf7e.zip |
x86/kvm/nVMX: nested state migration for Enlightened VMCS
Add support for get/set of nested state when Enlightened VMCS is in use.
A new KVM_STATE_NESTED_EVMCS flag to indicate eVMCS on the vCPU was enabled
is added.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 50f308499ce5..0fe1e3762e82 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4068,11 +4068,13 @@ long kvm_arch_vcpu_ioctl(struct file *filp, break; if (kvm_state.flags & - ~(KVM_STATE_NESTED_RUN_PENDING | KVM_STATE_NESTED_GUEST_MODE)) + ~(KVM_STATE_NESTED_RUN_PENDING | KVM_STATE_NESTED_GUEST_MODE + | KVM_STATE_NESTED_EVMCS)) break; /* nested_run_pending implies guest_mode. */ - if (kvm_state.flags == KVM_STATE_NESTED_RUN_PENDING) + if ((kvm_state.flags & KVM_STATE_NESTED_RUN_PENDING) + && !(kvm_state.flags & KVM_STATE_NESTED_GUEST_MODE)) break; r = kvm_x86_ops->set_nested_state(vcpu, user_kvm_nested_state, &kvm_state); |