Changeset 59602 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Feb 8, 2016 2:17:50 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.