#include <linux/errno.h>
#include <linux/smp.h>
#include "../cpuid.h"
#include "hyperv.h"
#include "nested.h"
#include "vmcs.h"
#include "vmx.h"
#include "trace.h"
Go to the source code of this file.
◆ CC
◆ pr_fmt
#define pr_fmt |
( |
|
fmt | ) |
KBUILD_MODNAME ": " fmt |
◆ evmcs_ctrl_type
Enumerator |
---|
EVMCS_EXIT_CTRLS | |
EVMCS_ENTRY_CTRLS | |
EVMCS_EXEC_CTRL | |
EVMCS_2NDEXEC | |
EVMCS_3RDEXEC | |
EVMCS_PINCTRL | |
EVMCS_VMFUNC | |
NR_EVMCS_CTRLS | |
Definition at line 52 of file hyperv.c.
◆ evmcs_revision
Enumerator |
---|
EVMCSv1_LEGACY | |
NR_EVMCS_REVISIONS | |
Definition at line 47 of file hyperv.c.
◆ evmcs_get_supported_ctls()
Definition at line 87 of file hyperv.c.
static const u32 evmcs_supported_ctrls[NR_EVMCS_CTRLS][NR_EVMCS_REVISIONS]
◆ evmcs_has_perf_global_ctrl()
static bool evmcs_has_perf_global_ctrl |
( |
struct kvm_vcpu * |
vcpu | ) |
|
|
static |
Definition at line 94 of file hyperv.c.
96 struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
105 if (WARN_ON_ONCE(!hv_vcpu))
108 return hv_vcpu->cpuid_cache.nested_ebx & HV_X64_NESTED_EVMCS1_PERF_GLOBAL_CTRL;
◆ nested_enable_evmcs()
int nested_enable_evmcs |
( |
struct kvm_vcpu * |
vcpu, |
|
|
uint16_t * |
vmcs_version |
|
) |
| |
Definition at line 198 of file hyperv.c.
bool enlightened_vmcs_enabled
uint16_t nested_get_evmcs_version(struct kvm_vcpu *vcpu)
static __always_inline struct vcpu_vmx * to_vmx(struct kvm_vcpu *vcpu)
◆ nested_evmcs_check_controls()
int nested_evmcs_check_controls |
( |
struct vmcs12 * |
vmcs12 | ) |
|
Definition at line 161 of file hyperv.c.
u32 cpu_based_vm_exec_control
u32 secondary_vm_exec_control
u32 pin_based_vm_exec_control
static bool nested_evmcs_is_valid_controls(enum evmcs_ctrl_type ctrl_type, u32 val)
◆ nested_evmcs_filter_control_msr()
void nested_evmcs_filter_control_msr |
( |
struct kvm_vcpu * |
vcpu, |
|
|
u32 |
msr_index, |
|
|
u64 * |
pdata |
|
) |
| |
Definition at line 111 of file hyperv.c.
113 u32 ctl_low = (u32)*pdata;
114 u32 ctl_high = (u32)(*pdata >> 32);
122 case MSR_IA32_VMX_EXIT_CTLS:
123 case MSR_IA32_VMX_TRUE_EXIT_CTLS:
126 supported_ctrls &= ~VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL;
127 ctl_high &= supported_ctrls;
129 case MSR_IA32_VMX_ENTRY_CTLS:
130 case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
133 supported_ctrls &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
134 ctl_high &= supported_ctrls;
136 case MSR_IA32_VMX_PROCBASED_CTLS:
137 case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
140 case MSR_IA32_VMX_PROCBASED_CTLS2:
143 case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
144 case MSR_IA32_VMX_PINBASED_CTLS:
147 case MSR_IA32_VMX_VMFUNC:
152 *pdata = ctl_low | ((u64)ctl_high << 32);
static u32 evmcs_get_supported_ctls(enum evmcs_ctrl_type ctrl_type)
static bool evmcs_has_perf_global_ctrl(struct kvm_vcpu *vcpu)
◆ nested_evmcs_is_valid_controls()
static bool nested_evmcs_is_valid_controls |
( |
enum evmcs_ctrl_type |
ctrl_type, |
|
|
u32 |
val |
|
) |
| |
|
static |
◆ nested_evmcs_l2_tlb_flush_enabled()
bool nested_evmcs_l2_tlb_flush_enabled |
( |
struct kvm_vcpu * |
vcpu | ) |
|
Definition at line 211 of file hyperv.c.
213 struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
215 struct hv_enlightened_vmcs *evmcs = vmx->
nested.hv_evmcs;
217 if (!hv_vcpu || !evmcs)
220 if (!evmcs->hv_enlightenments_control.nested_flush_hypercall)
223 return hv_vcpu->vp_assist_page.nested_control.features.directhypercall;
◆ nested_get_evmcs_version()
uint16_t nested_get_evmcs_version |
( |
struct kvm_vcpu * |
vcpu | ) |
|
Definition at line 29 of file hyperv.c.
41 (!vcpu ||
to_vmx(vcpu)->
nested.enlightened_vmcs_enabled))
static __always_inline u32 kvm_cpu_cap_get(unsigned int x86_feature)
#define KVM_EVMCS_VERSION
◆ nested_get_evmptr()
u64 nested_get_evmptr |
( |
struct kvm_vcpu * |
vcpu | ) |
|
Definition at line 16 of file hyperv.c.
18 struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
23 if (unlikely(!hv_vcpu->vp_assist_page.enlighten_vmentry))
26 return hv_vcpu->vp_assist_page.current_nested_vmcs;
int kvm_hv_get_assist_page(struct kvm_vcpu *vcpu)
◆ vmx_hv_inject_synthetic_vmexit_post_tlb_flush()
void vmx_hv_inject_synthetic_vmexit_post_tlb_flush |
( |
struct kvm_vcpu * |
vcpu | ) |
|
Definition at line 226 of file hyperv.c.
void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, u32 exit_intr_info, unsigned long exit_qualification)
◆ evmcs_supported_ctrls
Initial value:= {
},
},
},
},
},
},
},
}
#define EVMCS1_SUPPORTED_2NDEXEC
#define EVMCS1_SUPPORTED_VMFUNC
#define EVMCS1_SUPPORTED_3RDEXEC
#define EVMCS1_SUPPORTED_EXEC_CTRL
#define EVMCS1_SUPPORTED_PINCTRL
#define EVMCS1_SUPPORTED_VMEXIT_CTRL
#define EVMCS1_SUPPORTED_VMENTRY_CTRL
Definition at line 63 of file hyperv.c.