summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/vmx/nested.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-04-17 17:24:18 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2020-04-23 16:04:57 +0300
commit33b22172452f05c351fd2fa24c28d2e76c7b0692 (patch)
tree46bb088ea9afa7600cf520fd876a4269609bee24 /arch/x86/kvm/vmx/nested.h
parent25091990ef289a5962b5bddd8c68de3f691c9e3c (diff)
downloadlinux-33b22172452f05c351fd2fa24c28d2e76c7b0692.tar.xz
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>
Diffstat (limited to 'arch/x86/kvm/vmx/nested.h')
-rw-r--r--arch/x86/kvm/vmx/nested.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/nested.h b/arch/x86/kvm/vmx/nested.h
index 1514ff4db77f..7ce9572c3d3a 100644
--- a/arch/x86/kvm/vmx/nested.h
+++ b/arch/x86/kvm/vmx/nested.h
@@ -278,4 +278,6 @@ static inline bool nested_cr4_valid(struct kvm_vcpu *vcpu, unsigned long val)
#define nested_guest_cr4_valid nested_cr4_valid
#define nested_host_cr4_valid nested_cr4_valid
+extern struct kvm_x86_nested_ops vmx_nested_ops;
+
#endif /* __KVM_X86_VMX_NESTED_H */