]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: move nested-related kvm_x86_ops to a separate struct
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 17 Apr 2020 14:24:18 +0000 (10:24 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Apr 2020 13:04:57 +0000 (09:04 -0400)
commite5639c9744fb09d91a9729ebbdb7d8bce9ac1cc6
tree46bb088ea9afa7600cf520fd876a4269609bee24
parentbe02b9bfbafd8b39fb2a0720ca9b59b74947b35b
KVM: x86: move nested-related kvm_x86_ops to a separate struct

Clean up some of the patching of kvm_x86_ops, by moving kvm_x86_ops related to
nested virtualization into a separate struct.

As a result, these ops will always be non-NULL on VMX.  This is not a problem:

* check_nested_events is only called if is_guest_mode(vcpu) returns true

* get_nested_state treats VMXOFF state the same as nested being disabled

* set_nested_state fails if you attempt to set nested state while
  nesting is disabled

* nested_enable_evmcs could already be called on a CPU without VMX enabled
  in CPUID.

* nested_get_evmcs_version was fixed in the previous patch

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/hyperv.c
arch/x86/kvm/svm/nested.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/nested.h
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c