typedef enum {
+ /* 16 bit control field */
+ VMCS_VPID = 0x00000000,
+ /* 16 bit guest state */
VMCS_GUEST_ES_SELECTOR = 0x00000800,
VMCS_GUEST_CS_SELECTOR = 0x00000802,
VMCS_GUEST_SS_SELECTOR = 0x00000804,
VMCS_VAPIC_ADDR_HIGH = 0x00002013,
VMCS_APIC_ACCESS_ADDR = 0x00002014,
VMCS_APIC_ACCESS_ADDR_HIGH = 0x00002015,
+ VMCS_EPT_PTR = 0x0000201A,
+ VMCS_EPT_PTR_HIGH = 0x0000201B,
+ /* 64 bit read only data field */
+ VMCS_GUEST_PHYS_ADDR = 0x00002400,
+ VMCS_GUEST_PHYS_ADDR_HIGH = 0x00002401,
/* 64 bit guest state fields */
VMCS_LINK_PTR = 0x00002800,
VMCS_LINK_PTR_HIGH = 0x00002801,
- VMCS_GUEST_DBG_CTL = 0x00002802,
- VMCS_GUEST_DBG_CTL_HIGH = 0x00002803,
+ VMCS_GUEST_DBG_CTL = 0x00002802,
+ VMCS_GUEST_DBG_CTL_HIGH = 0x00002803,
+ VMCS_GUEST_PAT = 0x00002804,
+ VMCS_GUEST_PAT_HIGH = 0x00002805,
VMCS_GUEST_EFER = 0x00002806,
VMCS_GUEST_EFER_HIGH = 0x00002807,
VMCS_GUEST_PERF_GLOBAL_CTRL = 0x00002808,
VMCS_GUEST_PERF_GLOBAL_CTRL_HIGH = 0x00002809,
-
+ VMCS_GUEST_PDPTE0 = 0x0000280A,
+ VMCS_GUEST_PDPTE0_HIGH = 0x0000280B,
+ VMCS_GUEST_PDPTE1 = 0x0000280C,
+ VMCS_GUEST_PDPTE1_HIGH = 0x0000280D,
+ VMCS_GUEST_PDPTE2 = 0x0000280E,
+ VMCS_GUEST_PDPTE2_HIGH = 0x0000280F,
+ VMCS_GUEST_PDPTE3 = 0x00002810,
+ VMCS_GUEST_PDPTE3_HIGH = 0x00002811,
+ /* 64 bit host state fields */
+ VMCS_HOST_PAT = 0x00002c00,
+ VMCS_HOST_PAT_HIGH = 0x00002c01,
+ VMCS_HOST_EFER = 0x00002c02,
+ VMCS_HOST_EFER_HIGH = 0x00002c03,
VMCS_HOST_PERF_GLOBAL_CTRL = 0x00002c04,
VMCS_HOST_PERF_GLOBAL_CTRL_HIGH = 0x00002c05,
/* 32 bit control fields */
VMCS_ENTRY_INSTR_LEN = 0x0000401A,
VMCS_TPR_THRESHOLD = 0x0000401C,
VMCS_SEC_PROC_CTRLS = 0x0000401e,
+ VMCS_PLE_GAP = 0x00004020,
+ VMCS_PLE_WINDOW = 0x00004022,
/* 32 bit Read Only data fields */
VMCS_INSTR_ERR = 0x00004400,
VMCS_EXIT_REASON = 0x00004402,
VMCS_IDT_VECTOR_INFO = 0x00004408,
VMCS_IDT_VECTOR_ERR = 0x0000440A,
VMCS_EXIT_INSTR_LEN = 0x0000440C,
- VMCS_EXIT_INSTR_INFO = 0x0000440E,
+ VMCS_EXIT_INSTR_INFO = 0x0000440E,
/* 32 bit Guest state fields */
VMCS_GUEST_ES_LIMIT = 0x00004800,
VMCS_GUEST_CS_LIMIT = 0x00004802,
VMCS_GUEST_ACTIVITY_STATE = 0x00004826,
VMCS_GUEST_SMBASE = 0x00004828,
VMCS_GUEST_SYSENTER_CS = 0x0000482A,
+ VMCS_PREEMPT_TIMER = 0x0000482E,
/* 32 bit host state field */
VMCS_HOST_SYSENTER_CS = 0x00004C00,
/* Natural Width Control Fields */
#define SYSENTER_ESP_MSR 0x00000175
#define SYSENTER_EIP_MSR 0x00000176
- // SYSENTER CS MSR
+ // SYSENTER CS MSR
v3_get_msr(SYSENTER_CS_MSR, &(tmp_msr.hi), &(tmp_msr.lo));
vmx_ret |= check_vmcs_write(VMCS_HOST_SYSENTER_CS, tmp_msr.lo);
print_entry_ctrls();
print_exit_info();
-
-
-
}
if (enc->access_type == 1) {
return 4;
} else {
-#ifdef __V3_64BIT__
- return 8;
-#else
- return 4;
-#endif
+ return sizeof(addr_t);
}
}
case 2:
-
+static const char VMCS_VPID_STR[] = "VPID";
static const char VMCS_GUEST_ES_SELECTOR_STR[] = "GUEST_ES_SELECTOR";
static const char VMCS_GUEST_CS_SELECTOR_STR[] = "GUEST_CS_SELECTOR";
static const char VMCS_GUEST_SS_SELECTOR_STR[] = "GUEST_SS_SELECTOR";
static const char VMCS_VAPIC_ADDR_HIGH_STR[] = "VAPIC_PAGE_ADDR_HIGH";
static const char VMCS_APIC_ACCESS_ADDR_STR[] = "APIC_ACCESS_ADDR";
static const char VMCS_APIC_ACCESS_ADDR_HIGH_STR[] = "APIC_ACCESS_ADDR_HIGH";
+static const char VMCS_EPT_PTR_STR[] = "VMCS_EPT_PTR";
+static const char VMCS_EPT_PTR_HIGH_STR[] = "VMCS_EPT_PTR_HIGH";
+static const char VMCS_GUEST_PHYS_ADDR_STR[] = "VMCS_GUEST_PHYS_ADDR";
+static const char VMCS_GUEST_PHYS_ADDR_HIGH_STR[] = "VMCS_GUEST_PHYS_ADDR_HIGH";
static const char VMCS_LINK_PTR_STR[] = "VMCS_LINK_PTR";
static const char VMCS_LINK_PTR_HIGH_STR[] = "VMCS_LINK_PTR_HIGH";
static const char VMCS_GUEST_DBG_CTL_STR[] = "GUEST_DEBUG_CTL";
static const char VMCS_GUEST_DBG_CTL_HIGH_STR[] = "GUEST_DEBUG_CTL_HIGH";
+static const char VMCS_GUEST_PAT_STR[] = "GUEST_PAT";
+static const char VMCS_GUEST_PAT_HIGH_STR[] = "GUEST_PAT_HIGH";
+static const char VMCS_GUEST_EFER_STR[] = "GUEST_EFER";
+static const char VMCS_GUEST_EFER_HIGH_STR[] = "GUEST_EFER_HIGH";
static const char VMCS_GUEST_PERF_GLOBAL_CTRL_STR[] = "GUEST_PERF_GLOBAL_CTRL";
static const char VMCS_GUEST_PERF_GLOBAL_CTRL_HIGH_STR[] = "GUEST_PERF_GLOBAL_CTRL_HIGH";
+static const char VMCS_GUEST_PDPTE0_STR[] = "GUEST_PDPTE0";
+static const char VMCS_GUEST_PDPTE0_HIGH_STR[] = "GUEST_PDPTE0_HIGH";
+static const char VMCS_GUEST_PDPTE1_STR[] = "GUEST_PDPTE1";
+static const char VMCS_GUEST_PDPTE1_HIGH_STR[] = "GUEST_PDPTE1_HIGH";
+static const char VMCS_GUEST_PDPTE2_STR[] = "GUEST_PDPTE2";
+static const char VMCS_GUEST_PDPTE2_HIGH_STR[] = "GUEST_PDPTE2_HIGH";
+static const char VMCS_GUEST_PDPTE3_STR[] = "GUEST_PDPTE3";
+static const char VMCS_GUEST_PDPTE3_HIGH_STR[] = "GUEST_PDPTE3_HIGH";
+static const char VMCS_HOST_PAT_STR[] = "HOST_PAT";
+static const char VMCS_HOST_PAT_HIGH_STR[] = "HOST_PAT_HIGH";
+static const char VMCS_HOST_EFER_STR[] = "VMCS_HOST_EFER";
+static const char VMCS_HOST_EFER_HIGH_STR[] = "VMCS_HOST_EFER_HIGH";
static const char VMCS_HOST_PERF_GLOBAL_CTRL_STR[] = "HOST_PERF_GLOBAL_CTRL";
static const char VMCS_HOST_PERF_GLOBAL_CTRL_HIGH_STR[] = "HOST_PERF_GLOBAL_CTRL_HIGH";
static const char VMCS_PIN_CTRLS_STR[] = "PIN_VM_EXEC_CTRLS";
static const char VMCS_ENTRY_INSTR_LEN_STR[] = "VM_ENTRY_INSTR_LENGTH";
static const char VMCS_TPR_THRESHOLD_STR[] = "TPR_THRESHOLD";
static const char VMCS_SEC_PROC_CTRLS_STR[] = "VMCS_SEC_PROC_CTRLS";
+static const char VMCS_PLE_GAP_STR[] = "PLE_GAP";
+static const char VMCS_PLE_WINDOW_STR[] = "PLE_WINDOW";
static const char VMCS_INSTR_ERR_STR[] = "VM_INSTR_ERROR";
static const char VMCS_EXIT_REASON_STR[] = "EXIT_REASON";
static const char VMCS_EXIT_INT_INFO_STR[] = "VM_EXIT_INT_INFO";
static const char VMCS_GUEST_ACTIVITY_STATE_STR[] = "GUEST_ACTIVITY_STATE";
static const char VMCS_GUEST_SMBASE_STR[] = "GUEST_SMBASE";
static const char VMCS_GUEST_SYSENTER_CS_STR[] = "GUEST_SYSENTER_CS";
+static const char VMCS_PREEMPT_TIMER_STR[] = "PREEMPT_TIMER";
static const char VMCS_HOST_SYSENTER_CS_STR[] = "HOST_SYSENTER_CS";
static const char VMCS_CR0_MASK_STR[] = "CR0_GUEST_HOST_MASK";
static const char VMCS_CR4_MASK_STR[] = "CR4_GUEST_HOST_MASK";
const char * v3_vmcs_field_to_str(vmcs_field_t field) {
switch (field) {
+ case VMCS_VPID:
+ return VMCS_VPID_STR;
case VMCS_GUEST_ES_SELECTOR:
return VMCS_GUEST_ES_SELECTOR_STR;
case VMCS_GUEST_CS_SELECTOR:
return VMCS_APIC_ACCESS_ADDR_STR;
case VMCS_APIC_ACCESS_ADDR_HIGH:
return VMCS_APIC_ACCESS_ADDR_HIGH_STR;
+ case VMCS_EPT_PTR:
+ return VMCS_EPT_PTR_STR;
+ case VMCS_EPT_PTR_HIGH:
+ return VMCS_EPT_PTR_HIGH_STR;
+ case VMCS_GUEST_PHYS_ADDR:
+ return VMCS_GUEST_PHYS_ADDR_STR;
+ case VMCS_GUEST_PHYS_ADDR_HIGH:
+ return VMCS_GUEST_PHYS_ADDR_HIGH_STR;
case VMCS_LINK_PTR:
return VMCS_LINK_PTR_STR;
case VMCS_LINK_PTR_HIGH:
return VMCS_GUEST_DBG_CTL_STR;
case VMCS_GUEST_DBG_CTL_HIGH:
return VMCS_GUEST_DBG_CTL_HIGH_STR;
- case VMCS_GUEST_PERF_GLOBAL_CTRL:
+ case VMCS_GUEST_PAT:
+ return VMCS_GUEST_PAT_STR;
+ case VMCS_GUEST_PAT_HIGH:
+ return VMCS_GUEST_PAT_HIGH_STR;
+ case VMCS_GUEST_EFER:
+ return VMCS_GUEST_EFER_STR;
+ case VMCS_GUEST_EFER_HIGH:
+ return VMCS_GUEST_EFER_HIGH_STR;
+ case VMCS_GUEST_PERF_GLOBAL_CTRL:
return VMCS_GUEST_PERF_GLOBAL_CTRL_STR;
case VMCS_GUEST_PERF_GLOBAL_CTRL_HIGH:
return VMCS_GUEST_PERF_GLOBAL_CTRL_HIGH_STR;
+ case VMCS_GUEST_PDPTE0:
+ return VMCS_GUEST_PDPTE0_STR;
+ case VMCS_GUEST_PDPTE0_HIGH:
+ return VMCS_GUEST_PDPTE0_HIGH_STR;
+ case VMCS_GUEST_PDPTE1:
+ return VMCS_GUEST_PDPTE1_STR;
+ case VMCS_GUEST_PDPTE1_HIGH:
+ return VMCS_GUEST_PDPTE1_HIGH_STR;
+ case VMCS_GUEST_PDPTE2:
+ return VMCS_GUEST_PDPTE2_STR;
+ case VMCS_GUEST_PDPTE2_HIGH:
+ return VMCS_GUEST_PDPTE2_HIGH_STR;
+ case VMCS_GUEST_PDPTE3:
+ return VMCS_GUEST_PDPTE3_STR;
+ case VMCS_GUEST_PDPTE3_HIGH:
+ return VMCS_GUEST_PDPTE3_HIGH_STR;
+ case VMCS_HOST_PAT:
+ return VMCS_HOST_PAT_STR;
+ case VMCS_HOST_PAT_HIGH:
+ return VMCS_HOST_PAT_HIGH_STR;
+ case VMCS_HOST_EFER:
+ return VMCS_HOST_EFER_STR;
+ case VMCS_HOST_EFER_HIGH:
+ return VMCS_HOST_EFER_HIGH_STR;
case VMCS_HOST_PERF_GLOBAL_CTRL:
return VMCS_HOST_PERF_GLOBAL_CTRL_STR;
case VMCS_HOST_PERF_GLOBAL_CTRL_HIGH:
return VMCS_TPR_THRESHOLD_STR;
case VMCS_SEC_PROC_CTRLS:
return VMCS_SEC_PROC_CTRLS_STR;
+ case VMCS_PLE_GAP:
+ return VMCS_PLE_GAP_STR;
+ case VMCS_PLE_WINDOW:
+ return VMCS_PLE_WINDOW_STR;
case VMCS_INSTR_ERR:
return VMCS_INSTR_ERR_STR;
case VMCS_EXIT_REASON:
return VMCS_GUEST_SMBASE_STR;
case VMCS_GUEST_SYSENTER_CS:
return VMCS_GUEST_SYSENTER_CS_STR;
- case VMCS_HOST_SYSENTER_CS:
+ case VMCS_PREEMPT_TIMER:
+ return VMCS_PREEMPT_TIMER_STR;
+ case VMCS_HOST_SYSENTER_CS:
return VMCS_HOST_SYSENTER_CS_STR;
case VMCS_CR0_MASK:
return VMCS_CR0_MASK_STR;