summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/vmx/hyperv.h
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2023-12-05 11:36:28 +0100
committerSean Christopherson <seanjc@google.com>2023-12-07 09:35:08 -0800
commitc98842b26c233318bb18c77cc6e25859fe76c80e (patch)
tree0bb7c520f66595f7e93cc61dafd5f799b096e538 /arch/x86/kvm/vmx/hyperv.h
parent453e42b0557148cc7092c72eff6677a5436e3c7c (diff)
KVM: nVMX: Introduce accessor to get Hyper-V eVMCS pointer
There's a number of 'vmx->nested.hv_evmcs' accesses in nested.c, introduce 'nested_vmx_evmcs()' accessor to hide them all in !CONFIG_KVM_HYPERV case. No functional change intended. Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Tested-by: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Link: https://lore.kernel.org/r/20231205103630.1391318-15-vkuznets@redhat.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm/vmx/hyperv.h')
-rw-r--r--arch/x86/kvm/vmx/hyperv.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/hyperv.h b/arch/x86/kvm/vmx/hyperv.h
index 71e90a16f183..a87407412615 100644
--- a/arch/x86/kvm/vmx/hyperv.h
+++ b/arch/x86/kvm/vmx/hyperv.h
@@ -37,6 +37,11 @@ static inline bool nested_vmx_is_evmptr12_set(struct vcpu_vmx *vmx)
return evmptr_is_set(vmx->nested.hv_evmcs_vmptr);
}
+static inline struct hv_enlightened_vmcs *nested_vmx_evmcs(struct vcpu_vmx *vmx)
+{
+ return vmx->nested.hv_evmcs;
+}
+
static inline bool guest_cpuid_has_evmcs(struct kvm_vcpu *vcpu)
{
/*
@@ -75,6 +80,11 @@ static inline bool nested_vmx_is_evmptr12_set(struct vcpu_vmx *vmx)
{
return false;
}
+
+static inline struct hv_enlightened_vmcs *nested_vmx_evmcs(struct vcpu_vmx *vmx)
+{
+ return NULL;
+}
#endif
#endif /* __KVM_X86_VMX_HYPERV_H */