]> git.proxmox.com Git - mirror_qemu.git/commit - target/i386/kvm/kvm.c
target/i386: skip KVM_GET/SET_NESTED_STATE if VMX disabled, or for SVM
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 11 Jul 2019 13:41:48 +0000 (15:41 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Jul 2019 16:02:22 +0000 (18:02 +0200)
commit1e44f3ab71fb4291d266a264f7c207ae5c6d59b2
tree2ad8b18748abac7f148f05b6faa01d46d322c692
parent79a197ab180e75838523c58973b1221ad7bf51eb
target/i386: skip KVM_GET/SET_NESTED_STATE if VMX disabled, or for SVM

Do not allocate env->nested_state unless we later need to migrate the
nested virtualization state.

With this change, nested_state_needed() will return false if the
VMX flag is not included in the virtual machine.  KVM_GET/SET_NESTED_STATE
is also disabled for SVM which is safer (we know that at least the NPT
root and paging mode have to be saved/loaded), and thus the corresponding
subsection can go away as well.

Inspired by a patch from Liran Alon.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/kvm.c
target/i386/machine.c