Changeset 59602 in vbox
- Timestamp:
- Feb 8, 2016 2:17:50 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/hm_vmx.h
r58978 r59602 1160 1160 * @{ 1161 1161 */ 1162 #define VMX_VMCS16_GUEST_FIELD_VPID 0x0 1163 #define VMX_VMCS16_GUEST_FIELD_ES 0x800 1164 #define VMX_VMCS16_GUEST_FIELD_CS 0x802 1165 #define VMX_VMCS16_GUEST_FIELD_SS 0x804 1166 #define VMX_VMCS16_GUEST_FIELD_DS 0x806 1167 #define VMX_VMCS16_GUEST_FIELD_FS 0x808 1168 #define VMX_VMCS16_GUEST_FIELD_GS 0x80A 1169 #define VMX_VMCS16_GUEST_FIELD_LDTR 0x80C 1170 #define VMX_VMCS16_GUEST_FIELD_TR 0x80E 1162 #define VMX_VMCS16_VPID 0x000 1163 #define VMX_VMCS16_POSTED_INTR_NOTIF_VECTOR 0x002 1164 #define VMX_VMCS16_EPTP_INDEX 0x004 1165 #define VMX_VMCS16_GUEST_ES_SEL 0x800 1166 #define VMX_VMCS16_GUEST_CS_SEL 0x802 1167 #define VMX_VMCS16_GUEST_SS_SEL 0x804 1168 #define VMX_VMCS16_GUEST_DS_SEL 0x806 1169 #define VMX_VMCS16_GUEST_FS_SEL 0x808 1170 #define VMX_VMCS16_GUEST_GS_SEL 0x80A 1171 #define VMX_VMCS16_GUEST_LDTR_SEL 0x80C 1172 #define VMX_VMCS16_GUEST_TR_SEL 0x80E 1173 #define VMX_VMCS16_GUEST_INTR_STATUS 0x810 1171 1174 /** @} */ 1172 1175 … … 1174 1177 * @{ 1175 1178 */ 1176 #define VMX_VMCS16_HOST_ FIELD_ES0xC001177 #define VMX_VMCS16_HOST_ FIELD_CS0xC021178 #define VMX_VMCS16_HOST_ FIELD_SS0xC041179 #define VMX_VMCS16_HOST_ FIELD_DS0xC061180 #define VMX_VMCS16_HOST_F IELD_FS0xC081181 #define VMX_VMCS16_HOST_ FIELD_GS0xC0A1182 #define VMX_VMCS16_HOST_ FIELD_TR0xC0C1179 #define VMX_VMCS16_HOST_ES_SEL 0xC00 1180 #define VMX_VMCS16_HOST_CS_SEL 0xC02 1181 #define VMX_VMCS16_HOST_SS_SEL 0xC04 1182 #define VMX_VMCS16_HOST_DS_SEL 0xC06 1183 #define VMX_VMCS16_HOST_FS_SEL 0xC08 1184 #define VMX_VMCS16_HOST_GS_SEL 0xC0A 1185 #define VMX_VMCS16_HOST_TR_SEL 0xC0C 1183 1186 /** @} */ 1184 1187 … … 1186 1189 * @{ 1187 1190 */ 1188 #define VMX_VMCS64_HOST_ FIELD_PAT_FULL0x2C001189 #define VMX_VMCS64_HOST_ FIELD_PAT_HIGH0x2C011190 #define VMX_VMCS64_HOST_ FIELD_EFER_FULL0x2C021191 #define VMX_VMCS64_HOST_ FIELD_EFER_HIGH0x2C031191 #define VMX_VMCS64_HOST_PAT_FULL 0x2C00 1192 #define VMX_VMCS64_HOST_PAT_HIGH 0x2C01 1193 #define VMX_VMCS64_HOST_EFER_FULL 0x2C02 1194 #define VMX_VMCS64_HOST_EFER_HIGH 0x2C03 1192 1195 #define VMX_VMCS64_HOST_PERF_GLOBAL_CTRL_FULL 0x2C04 /**< MSR IA32_PERF_GLOBAL_CTRL */ 1193 1196 #define VMX_VMCS64_HOST_PERF_GLOBAL_CTRL_HIGH 0x2C05 /**< MSR IA32_PERF_GLOBAL_CTRL */ … … 1230 1233 1231 1234 /** Optional (VMX_VMCS_CTRL_PROC_EXEC2_VMFUNC) */ 1235 #define VMX_VMCS64_CTRL_POSTED_INTR_DESC_FULL 0x2016 1236 #define VMX_VMCS64_CTRL_POSTED_INTR_DESC_HIGH 0x2017 1237 1238 /** Optional (VMX_VMCS_CTRL_PROC_EXEC2_VMFUNC) */ 1232 1239 #define VMX_VMCS64_CTRL_VMFUNC_CTRLS_FULL 0x2018 1233 1240 #define VMX_VMCS64_CTRL_VMFUNC_CTRLS_HIGH 0x2019 1234 1241 1235 1242 /** Extended page table pointer. */ 1236 #define VMX_VMCS64_CTRL_EPTP_FULL 0x201a 1237 #define VMX_VMCS64_CTRL_EPTP_HIGH 0x201b 1243 #define VMX_VMCS64_CTRL_EPTP_FULL 0x201A 1244 #define VMX_VMCS64_CTRL_EPTP_HIGH 0x201B 1245 1246 /** EOI-exit bitmap 0. */ 1247 #define VMX_VMCS64_CTRL_EOI_BITMAP_0_FULL 0x201C 1248 #define VMX_VMCS64_CTRL_EOI_BITMAP_0_HIGH 0x201D 1249 1250 /** EOI-exit bitmap 1. */ 1251 #define VMX_VMCS64_CTRL_EOI_BITMAP_1_FULL 0x201E 1252 #define VMX_VMCS64_CTRL_EOI_BITMAP_1_HIGH 0x201F 1253 1254 /** EOI-exit bitmap 2. */ 1255 #define VMX_VMCS64_CTRL_EOI_BITMAP_2_FULL 0x2020 1256 #define VMX_VMCS64_CTRL_EOI_BITMAP_2_HIGH 0x2021 1257 1258 /** EOI-exit bitmap 3. */ 1259 #define VMX_VMCS64_CTRL_EOI_BITMAP_3_FULL 0x2022 1260 #define VMX_VMCS64_CTRL_EOI_BITMAP_3_HIGH 0x2023 1238 1261 1239 1262 /** Extended page table pointer lists. */ 1240 1263 #define VMX_VMCS64_CTRL_EPTP_LIST_FULL 0x2024 1241 1264 #define VMX_VMCS64_CTRL_EPTP_LIST_HIGH 0x2025 1265 1266 /** VM-read bitmap. */ 1267 #define VMX_VMCS64_CTRL_VMREAD_BITMAP_FULL 0x2026 1268 #define VMX_VMCS64_CTRL_VMREAD_BITMAP_HIGH 0x2027 1269 1270 /** VM-write bitmap. */ 1271 #define VMX_VMCS64_CTRL_VMWRITE_BITMAP_FULL 0x2028 1272 #define VMX_VMCS64_CTRL_VMWRITE_BITMAP_HIGH 0x2029 1273 1274 /** Virtualization-exception information address. */ 1275 #define VMX_VMCS64_CTRL_VIRTXCPT_INFO_ADDR_FULL 0x202A 1276 #define VMX_VMCS64_CTRL_VIRTXCPT_INFO_ADDR_HIGH 0x202B 1277 1278 /** XSS-exiting bitmap. */ 1279 #define VMX_VMCS64_CTRL_XSS_EXITING_BITMAP_FULL 0x202C 1280 #define VMX_VMCS64_CTRL_XSS_EXITING_BITMAP_HIGH 0x202D 1281 1282 /** TSC multiplier. */ 1283 #define VMX_VMCS64_CTRL_TSC_MULTIPLIER_FULL 0x2032 1284 #define VMX_VMCS64_CTRL_TSC_MULTIPLIER_HIGH 0x2033 1242 1285 1243 1286 /** VM-exit guest physical address. */ -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r59214 r59602 1665 1665 { 1666 1666 uint64_t u64Val; 1667 int rc = VMXReadVmcs64(VMX_VMCS64_HOST_ FIELD_EFER_FULL, &u64Val);1667 int rc = VMXReadVmcs64(VMX_VMCS64_HOST_EFER_FULL, &u64Val); 1668 1668 AssertRC(rc); 1669 1669 … … 2001 2001 2002 2002 /* Update VMCS with the VPID. */ 2003 int rc = VMXWriteVmcs32(VMX_VMCS16_ GUEST_FIELD_VPID, pVCpu->hm.s.uCurrentAsid);2003 int rc = VMXWriteVmcs32(VMX_VMCS16_VPID, pVCpu->hm.s.uCurrentAsid); 2004 2004 AssertRC(rc); 2005 2005 … … 2138 2138 ("Cpu[%u] pVCpu->uCurrentAsid=%u\n", pCpu->idCpu, pVCpu->hm.s.uCurrentAsid)); 2139 2139 2140 int rc = VMXWriteVmcs32(VMX_VMCS16_ GUEST_FIELD_VPID, pVCpu->hm.s.uCurrentAsid);2140 int rc = VMXWriteVmcs32(VMX_VMCS16_VPID, pVCpu->hm.s.uCurrentAsid); 2141 2141 AssertRC(rc); 2142 2142 } … … 2927 2927 2928 2928 /* Write these host selector fields into the host-state area in the VMCS. */ 2929 rc = VMXWriteVmcs32(VMX_VMCS16_HOST_ FIELD_CS, uSelCS);2930 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_ FIELD_SS, uSelSS);2929 rc = VMXWriteVmcs32(VMX_VMCS16_HOST_CS_SEL, uSelCS); 2930 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_SS_SEL, uSelSS); 2931 2931 #if HC_ARCH_BITS == 64 2932 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_ FIELD_DS, uSelDS);2933 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_ FIELD_ES, uSelES);2934 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_F IELD_FS, uSelFS);2935 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_ FIELD_GS, uSelGS);2932 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_DS_SEL, uSelDS); 2933 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_ES_SEL, uSelES); 2934 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_FS_SEL, uSelFS); 2935 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_GS_SEL, uSelGS); 2936 2936 #else 2937 2937 NOREF(uSelDS); … … 2940 2940 NOREF(uSelGS); 2941 2941 #endif 2942 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_ FIELD_TR, uSelTR);2942 rc |= VMXWriteVmcs32(VMX_VMCS16_HOST_TR_SEL, uSelTR); 2943 2943 AssertRCReturn(rc, rc); 2944 2944 … … 3093 3093 if (pVM->hm.s.vmx.fSupportsVmcsEfer) 3094 3094 { 3095 rc = VMXWriteVmcs64(VMX_VMCS64_HOST_ FIELD_EFER_FULL, pVM->hm.s.vmx.u64HostEfer);3095 rc = VMXWriteVmcs64(VMX_VMCS64_HOST_EFER_FULL, pVM->hm.s.vmx.u64HostEfer); 3096 3096 AssertRCReturn(rc, rc); 3097 3097 } … … 4430 4430 } 4431 4431 #endif 4432 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_ FIELD_CS, VMX_VMCS32_GUEST_CS_LIMIT, VMX_VMCS_GUEST_CS_BASE,4432 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_CS_SEL, VMX_VMCS32_GUEST_CS_LIMIT, VMX_VMCS_GUEST_CS_BASE, 4433 4433 VMX_VMCS32_GUEST_CS_ACCESS_RIGHTS, &pMixedCtx->cs); 4434 4434 AssertRCReturn(rc, rc); 4435 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_ FIELD_SS, VMX_VMCS32_GUEST_SS_LIMIT, VMX_VMCS_GUEST_SS_BASE,4435 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_SS_SEL, VMX_VMCS32_GUEST_SS_LIMIT, VMX_VMCS_GUEST_SS_BASE, 4436 4436 VMX_VMCS32_GUEST_SS_ACCESS_RIGHTS, &pMixedCtx->ss); 4437 4437 AssertRCReturn(rc, rc); 4438 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_ FIELD_DS, VMX_VMCS32_GUEST_DS_LIMIT, VMX_VMCS_GUEST_DS_BASE,4438 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_DS_SEL, VMX_VMCS32_GUEST_DS_LIMIT, VMX_VMCS_GUEST_DS_BASE, 4439 4439 VMX_VMCS32_GUEST_DS_ACCESS_RIGHTS, &pMixedCtx->ds); 4440 4440 AssertRCReturn(rc, rc); 4441 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_ FIELD_ES, VMX_VMCS32_GUEST_ES_LIMIT, VMX_VMCS_GUEST_ES_BASE,4441 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_ES_SEL, VMX_VMCS32_GUEST_ES_LIMIT, VMX_VMCS_GUEST_ES_BASE, 4442 4442 VMX_VMCS32_GUEST_ES_ACCESS_RIGHTS, &pMixedCtx->es); 4443 4443 AssertRCReturn(rc, rc); 4444 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_F IELD_FS, VMX_VMCS32_GUEST_FS_LIMIT, VMX_VMCS_GUEST_FS_BASE,4444 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_FS_SEL, VMX_VMCS32_GUEST_FS_LIMIT, VMX_VMCS_GUEST_FS_BASE, 4445 4445 VMX_VMCS32_GUEST_FS_ACCESS_RIGHTS, &pMixedCtx->fs); 4446 4446 AssertRCReturn(rc, rc); 4447 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_ FIELD_GS, VMX_VMCS32_GUEST_GS_LIMIT, VMX_VMCS_GUEST_GS_BASE,4447 rc = hmR0VmxWriteSegmentReg(pVCpu, VMX_VMCS16_GUEST_GS_SEL, VMX_VMCS32_GUEST_GS_LIMIT, VMX_VMCS_GUEST_GS_BASE, 4448 4448 VMX_VMCS32_GUEST_GS_ACCESS_RIGHTS, &pMixedCtx->gs); 4449 4449 AssertRCReturn(rc, rc); … … 4516 4516 || (u32AccessRights & RT_BIT(15))); /* Granularity MB1. */ 4517 4517 4518 rc = VMXWriteVmcs32(VMX_VMCS16_GUEST_ FIELD_TR,u16Sel);4518 rc = VMXWriteVmcs32(VMX_VMCS16_GUEST_TR_SEL, u16Sel); 4519 4519 rc |= VMXWriteVmcs32(VMX_VMCS32_GUEST_TR_LIMIT, u32Limit); 4520 4520 rc |= VMXWriteVmcsGstN(VMX_VMCS_GUEST_TR_BASE, u64Base); … … 4554 4554 u32Access = pMixedCtx->ldtr.Attr.u; 4555 4555 4556 rc = VMXWriteVmcs32(VMX_VMCS16_GUEST_ FIELD_LDTR,pMixedCtx->ldtr.Sel);4556 rc = VMXWriteVmcs32(VMX_VMCS16_GUEST_LDTR_SEL, pMixedCtx->ldtr.Sel); 4557 4557 rc |= VMXWriteVmcs32(VMX_VMCS32_GUEST_LDTR_LIMIT, pMixedCtx->ldtr.u32Limit); 4558 4558 rc |= VMXWriteVmcsGstN(VMX_VMCS_GUEST_LDTR_BASE, pMixedCtx->ldtr.u64Base); … … 4925 4925 rc = VMXReadVmcs32(VMX_VMCS_GUEST_RFLAGS, &u32Val); AssertRC(rc); 4926 4926 Log4(("Old Guest Rflags %#RX32 New %#RX32\n", pCtx->eflags.u32, u32Val)); 4927 rc = VMXReadVmcs32(VMX_VMCS16_ GUEST_FIELD_VPID, &u32Val);AssertRC(rc);4928 Log4(("VMX_VMCS16_ GUEST_FIELD_VPID%u\n", u32Val));4927 rc = VMXReadVmcs32(VMX_VMCS16_VPID, &u32Val); AssertRC(rc); 4928 Log4(("VMX_VMCS16_VPID %u\n", u32Val)); 4929 4929 4930 4930 /* Host bits. */ … … 4939 4939 PCX86DESCHC pDesc; 4940 4940 ASMGetGDTR(&HostGdtr); 4941 rc = VMXReadVmcs32(VMX_VMCS16_HOST_ FIELD_CS, &u32Val); AssertRC(rc);4941 rc = VMXReadVmcs32(VMX_VMCS16_HOST_CS_SEL, &u32Val); AssertRC(rc); 4942 4942 Log4(("Host CS %#08x\n", u32Val)); 4943 4943 if (u32Val < HostGdtr.cbGdt) … … 4947 4947 } 4948 4948 4949 rc = VMXReadVmcs32(VMX_VMCS16_HOST_ FIELD_DS, &u32Val); AssertRC(rc);4949 rc = VMXReadVmcs32(VMX_VMCS16_HOST_DS_SEL, &u32Val); AssertRC(rc); 4950 4950 Log4(("Host DS %#08x\n", u32Val)); 4951 4951 if (u32Val < HostGdtr.cbGdt) … … 4955 4955 } 4956 4956 4957 rc = VMXReadVmcs32(VMX_VMCS16_HOST_ FIELD_ES, &u32Val); AssertRC(rc);4957 rc = VMXReadVmcs32(VMX_VMCS16_HOST_ES_SEL, &u32Val); AssertRC(rc); 4958 4958 Log4(("Host ES %#08x\n", u32Val)); 4959 4959 if (u32Val < HostGdtr.cbGdt) … … 4963 4963 } 4964 4964 4965 rc = VMXReadVmcs32(VMX_VMCS16_HOST_F IELD_FS, &u32Val); AssertRC(rc);4965 rc = VMXReadVmcs32(VMX_VMCS16_HOST_FS_SEL, &u32Val); AssertRC(rc); 4966 4966 Log4(("Host FS %#08x\n", u32Val)); 4967 4967 if (u32Val < HostGdtr.cbGdt) … … 4971 4971 } 4972 4972 4973 rc = VMXReadVmcs32(VMX_VMCS16_HOST_ FIELD_GS, &u32Val); AssertRC(rc);4973 rc = VMXReadVmcs32(VMX_VMCS16_HOST_GS_SEL, &u32Val); AssertRC(rc); 4974 4974 Log4(("Host GS %#08x\n", u32Val)); 4975 4975 if (u32Val < HostGdtr.cbGdt) … … 4979 4979 } 4980 4980 4981 rc = VMXReadVmcs32(VMX_VMCS16_HOST_ FIELD_SS, &u32Val); AssertRC(rc);4981 rc = VMXReadVmcs32(VMX_VMCS16_HOST_SS_SEL, &u32Val); AssertRC(rc); 4982 4982 Log4(("Host SS %#08x\n", u32Val)); 4983 4983 if (u32Val < HostGdtr.cbGdt) … … 4987 4987 } 4988 4988 4989 rc = VMXReadVmcs32(VMX_VMCS16_HOST_ FIELD_TR, &u32Val); AssertRC(rc);4989 rc = VMXReadVmcs32(VMX_VMCS16_HOST_TR_SEL, &u32Val); AssertRC(rc); 4990 4990 Log4(("Host TR %#08x\n", u32Val)); 4991 4991 if (u32Val < HostGdtr.cbGdt) … … 6349 6349 if (pSelReg->Attr.u & X86DESCATTR_UNUSABLE) 6350 6350 { 6351 Assert(idxSel != VMX_VMCS16_GUEST_ FIELD_TR); /* TR is the only selector that can never be unusable. */6351 Assert(idxSel != VMX_VMCS16_GUEST_TR_SEL); /* TR is the only selector that can never be unusable. */ 6352 6352 6353 6353 /* Masking off: X86DESCATTR_P, X86DESCATTR_LIMIT_HIGH, and X86DESCATTR_AVL. The latter two are really irrelevant. */ … … 6368 6368 #ifdef VMX_USE_CACHED_VMCS_ACCESSES 6369 6369 # define VMXLOCAL_READ_SEG(Sel, CtxSel) \ 6370 hmR0VmxReadSegmentReg(pVCpu, VMX_VMCS16_GUEST_ FIELD_##Sel, VMX_VMCS32_GUEST_##Sel##_LIMIT, \6370 hmR0VmxReadSegmentReg(pVCpu, VMX_VMCS16_GUEST_##Sel##_SEL, VMX_VMCS32_GUEST_##Sel##_LIMIT, \ 6371 6371 VMX_VMCS_GUEST_##Sel##_BASE_CACHE_IDX, VMX_VMCS32_GUEST_##Sel##_ACCESS_RIGHTS, &pMixedCtx->CtxSel) 6372 6372 #else 6373 6373 # define VMXLOCAL_READ_SEG(Sel, CtxSel) \ 6374 hmR0VmxReadSegmentReg(pVCpu, VMX_VMCS16_GUEST_ FIELD_##Sel, VMX_VMCS32_GUEST_##Sel##_LIMIT, \6374 hmR0VmxReadSegmentReg(pVCpu, VMX_VMCS16_GUEST_##Sel##_SEL, VMX_VMCS32_GUEST_##Sel##_LIMIT, \ 6375 6375 VMX_VMCS_GUEST_##Sel##_BASE, VMX_VMCS32_GUEST_##Sel##_ACCESS_RIGHTS, &pMixedCtx->CtxSel) 6376 6376 #endif
Note:
See TracChangeset
for help on using the changeset viewer.