KVM
Classes | Macros | Functions | Variables
hyperv_evmcs.h File Reference
#include <asm/hyperv-tlfs.h>
#include "capabilities.h"
#include "vmcs12.h"
Include dependency graph for hyperv_evmcs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  evmcs_field
 

Macros

#define KVM_EVMCS_VERSION   1
 
#define EVMCS1_SUPPORTED_PINCTRL
 
#define EVMCS1_SUPPORTED_EXEC_CTRL
 
#define EVMCS1_SUPPORTED_2NDEXEC
 
#define EVMCS1_SUPPORTED_3RDEXEC   (0ULL)
 
#define EVMCS1_SUPPORTED_VMEXIT_CTRL
 
#define EVMCS1_SUPPORTED_VMENTRY_CTRL
 
#define EVMCS1_SUPPORTED_VMFUNC   (0)
 

Functions

static __always_inline int evmcs_field_offset (unsigned long field, u16 *clean_field)
 
static u64 evmcs_read_any (struct hv_enlightened_vmcs *evmcs, unsigned long field, u16 offset)
 

Variables

const struct evmcs_field vmcs_field_to_evmcs_1 []
 
const unsigned int nr_evmcs_1_fields
 

Macro Definition Documentation

◆ EVMCS1_SUPPORTED_2NDEXEC

#define EVMCS1_SUPPORTED_2NDEXEC
Value:
(SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE | \
SECONDARY_EXEC_WBINVD_EXITING | \
SECONDARY_EXEC_ENABLE_VPID | \
SECONDARY_EXEC_ENABLE_EPT | \
SECONDARY_EXEC_UNRESTRICTED_GUEST | \
SECONDARY_EXEC_DESC | \
SECONDARY_EXEC_ENABLE_RDTSCP | \
SECONDARY_EXEC_ENABLE_INVPCID | \
SECONDARY_EXEC_ENABLE_XSAVES | \
SECONDARY_EXEC_RDSEED_EXITING | \
SECONDARY_EXEC_RDRAND_EXITING | \
SECONDARY_EXEC_TSC_SCALING | \
SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE | \
SECONDARY_EXEC_PT_USE_GPA | \
SECONDARY_EXEC_PT_CONCEAL_VMX | \
SECONDARY_EXEC_BUS_LOCK_DETECTION | \
SECONDARY_EXEC_NOTIFY_VM_EXITING | \
SECONDARY_EXEC_ENCLS_EXITING)

Definition at line 72 of file hyperv_evmcs.h.

◆ EVMCS1_SUPPORTED_3RDEXEC

#define EVMCS1_SUPPORTED_3RDEXEC   (0ULL)

Definition at line 92 of file hyperv_evmcs.h.

◆ EVMCS1_SUPPORTED_EXEC_CTRL

#define EVMCS1_SUPPORTED_EXEC_CTRL
Value:
(CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR | \
CPU_BASED_HLT_EXITING | \
CPU_BASED_CR3_LOAD_EXITING | \
CPU_BASED_CR3_STORE_EXITING | \
CPU_BASED_UNCOND_IO_EXITING | \
CPU_BASED_MOV_DR_EXITING | \
CPU_BASED_USE_TSC_OFFSETTING | \
CPU_BASED_MWAIT_EXITING | \
CPU_BASED_MONITOR_EXITING | \
CPU_BASED_INVLPG_EXITING | \
CPU_BASED_RDPMC_EXITING | \
CPU_BASED_INTR_WINDOW_EXITING | \
CPU_BASED_CR8_LOAD_EXITING | \
CPU_BASED_CR8_STORE_EXITING | \
CPU_BASED_RDTSC_EXITING | \
CPU_BASED_TPR_SHADOW | \
CPU_BASED_USE_IO_BITMAPS | \
CPU_BASED_MONITOR_TRAP_FLAG | \
CPU_BASED_USE_MSR_BITMAPS | \
CPU_BASED_NMI_WINDOW_EXITING | \
CPU_BASED_PAUSE_EXITING | \
CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)

Definition at line 48 of file hyperv_evmcs.h.

◆ EVMCS1_SUPPORTED_PINCTRL

#define EVMCS1_SUPPORTED_PINCTRL
Value:
(PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR | \
PIN_BASED_EXT_INTR_MASK | \
PIN_BASED_NMI_EXITING | \
PIN_BASED_VIRTUAL_NMIS)

Definition at line 42 of file hyperv_evmcs.h.

◆ EVMCS1_SUPPORTED_VMENTRY_CTRL

#define EVMCS1_SUPPORTED_VMENTRY_CTRL
Value:
(VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR | \
VM_ENTRY_LOAD_DEBUG_CONTROLS | \
VM_ENTRY_IA32E_MODE | \
VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | \
VM_ENTRY_LOAD_IA32_PAT | \
VM_ENTRY_LOAD_IA32_EFER | \
VM_ENTRY_LOAD_BNDCFGS | \
VM_ENTRY_PT_CONCEAL_PIP | \
VM_ENTRY_LOAD_IA32_RTIT_CTL)

Definition at line 108 of file hyperv_evmcs.h.

◆ EVMCS1_SUPPORTED_VMEXIT_CTRL

#define EVMCS1_SUPPORTED_VMEXIT_CTRL
Value:
(VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR | \
VM_EXIT_SAVE_DEBUG_CONTROLS | \
VM_EXIT_ACK_INTR_ON_EXIT | \
VM_EXIT_HOST_ADDR_SPACE_SIZE | \
VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL | \
VM_EXIT_SAVE_IA32_PAT | \
VM_EXIT_LOAD_IA32_PAT | \
VM_EXIT_SAVE_IA32_EFER | \
VM_EXIT_LOAD_IA32_EFER | \
VM_EXIT_CLEAR_BNDCFGS | \
VM_EXIT_PT_CONCEAL_PIP | \
VM_EXIT_CLEAR_IA32_RTIT_CTL)

Definition at line 94 of file hyperv_evmcs.h.

◆ EVMCS1_SUPPORTED_VMFUNC

#define EVMCS1_SUPPORTED_VMFUNC   (0)

Definition at line 119 of file hyperv_evmcs.h.

◆ KVM_EVMCS_VERSION

#define KVM_EVMCS_VERSION   1

Definition at line 14 of file hyperv_evmcs.h.

Function Documentation

◆ evmcs_field_offset()

static __always_inline int evmcs_field_offset ( unsigned long  field,
u16 *  clean_field 
)
static

Definition at line 129 of file hyperv_evmcs.h.

131 {
132  const struct evmcs_field *evmcs_field;
133  unsigned int index = ROL16(field, 6);
134 
135  if (unlikely(index >= nr_evmcs_1_fields))
136  return -ENOENT;
137 
139 
140  /*
141  * Use offset=0 to detect holes in eVMCS. This offset belongs to
142  * 'revision_id' but this field has no encoding and is supposed to
143  * be accessed directly.
144  */
145  if (unlikely(!evmcs_field->offset))
146  return -ENOENT;
147 
148  if (clean_field)
150 
151  return evmcs_field->offset;
152 }
const unsigned int nr_evmcs_1_fields
Definition: hyperv_evmcs.c:315
const struct evmcs_field vmcs_field_to_evmcs_1[]
Definition: hyperv_evmcs.c:13
#define ROL16(val, n)
Definition: vmcs.h:14
Here is the caller graph for this function:

◆ evmcs_read_any()

static u64 evmcs_read_any ( struct hv_enlightened_vmcs *  evmcs,
unsigned long  field,
u16  offset 
)
inlinestatic

Definition at line 154 of file hyperv_evmcs.h.

156 {
157  /*
158  * vmcs12_read_any() doesn't care whether the supplied structure
159  * is 'struct vmcs12' or 'struct hv_enlightened_vmcs' as it takes
160  * the exact offset of the required field, use it for convenience
161  * here.
162  */
163  return vmcs12_read_any((void *)evmcs, field, offset);
164 }
static u64 vmcs12_read_any(struct vmcs12 *vmcs12, unsigned long field, u16 offset)
Definition: vmcs12.h:385
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ nr_evmcs_1_fields

const unsigned int nr_evmcs_1_fields
extern

Definition at line 315 of file hyperv_evmcs.c.

◆ vmcs_field_to_evmcs_1

const struct evmcs_field vmcs_field_to_evmcs_1[]
extern

Definition at line 1 of file hyperv_evmcs.c.