Changeset 14581 in vbox
- Timestamp:
- Nov 25, 2008 4:14:14 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/hwacc_vmx.h
r14580 r14581 644 644 * @{ 645 645 */ 646 #define VMX_VMCS _GUEST_FIELD_VPID 0x0647 #define VMX_VMCS _GUEST_FIELD_ES 0x800648 #define VMX_VMCS _GUEST_FIELD_CS 0x802649 #define VMX_VMCS _GUEST_FIELD_SS 0x804650 #define VMX_VMCS _GUEST_FIELD_DS 0x806651 #define VMX_VMCS _GUEST_FIELD_FS 0x808652 #define VMX_VMCS _GUEST_FIELD_GS 0x80A653 #define VMX_VMCS _GUEST_FIELD_LDTR 0x80C654 #define VMX_VMCS _GUEST_FIELD_TR 0x80E646 #define VMX_VMCS16_GUEST_FIELD_VPID 0x0 647 #define VMX_VMCS16_GUEST_FIELD_ES 0x800 648 #define VMX_VMCS16_GUEST_FIELD_CS 0x802 649 #define VMX_VMCS16_GUEST_FIELD_SS 0x804 650 #define VMX_VMCS16_GUEST_FIELD_DS 0x806 651 #define VMX_VMCS16_GUEST_FIELD_FS 0x808 652 #define VMX_VMCS16_GUEST_FIELD_GS 0x80A 653 #define VMX_VMCS16_GUEST_FIELD_LDTR 0x80C 654 #define VMX_VMCS16_GUEST_FIELD_TR 0x80E 655 655 /** @} */ 656 656 … … 658 658 * @{ 659 659 */ 660 #define VMX_VMCS _HOST_FIELD_ES 0xC00661 #define VMX_VMCS _HOST_FIELD_CS 0xC02662 #define VMX_VMCS _HOST_FIELD_SS 0xC04663 #define VMX_VMCS _HOST_FIELD_DS 0xC06664 #define VMX_VMCS _HOST_FIELD_FS 0xC08665 #define VMX_VMCS _HOST_FIELD_GS 0xC0A666 #define VMX_VMCS _HOST_FIELD_TR 0xC0C660 #define VMX_VMCS16_HOST_FIELD_ES 0xC00 661 #define VMX_VMCS16_HOST_FIELD_CS 0xC02 662 #define VMX_VMCS16_HOST_FIELD_SS 0xC04 663 #define VMX_VMCS16_HOST_FIELD_DS 0xC06 664 #define VMX_VMCS16_HOST_FIELD_FS 0xC08 665 #define VMX_VMCS16_HOST_FIELD_GS 0xC0A 666 #define VMX_VMCS16_HOST_FIELD_TR 0xC0C 667 667 /** @} */ 668 668 … … 925 925 * @{ 926 926 */ 927 #define VMX_VMCS _GUEST_ES_LIMIT 0x4800928 #define VMX_VMCS _GUEST_CS_LIMIT 0x4802929 #define VMX_VMCS _GUEST_SS_LIMIT 0x4804930 #define VMX_VMCS _GUEST_DS_LIMIT 0x4806931 #define VMX_VMCS _GUEST_FS_LIMIT 0x4808932 #define VMX_VMCS _GUEST_GS_LIMIT 0x480A933 #define VMX_VMCS _GUEST_LDTR_LIMIT 0x480C934 #define VMX_VMCS _GUEST_TR_LIMIT 0x480E935 #define VMX_VMCS _GUEST_GDTR_LIMIT 0x4810936 #define VMX_VMCS _GUEST_IDTR_LIMIT 0x4812937 #define VMX_VMCS _GUEST_ES_ACCESS_RIGHTS 0x4814938 #define VMX_VMCS _GUEST_CS_ACCESS_RIGHTS 0x4816939 #define VMX_VMCS _GUEST_SS_ACCESS_RIGHTS 0x4818940 #define VMX_VMCS _GUEST_DS_ACCESS_RIGHTS 0x481A941 #define VMX_VMCS _GUEST_FS_ACCESS_RIGHTS 0x481C942 #define VMX_VMCS _GUEST_GS_ACCESS_RIGHTS 0x481E943 #define VMX_VMCS _GUEST_LDTR_ACCESS_RIGHTS 0x4820944 #define VMX_VMCS _GUEST_TR_ACCESS_RIGHTS 0x4822945 #define VMX_VMCS _GUEST_INTERRUPTIBILITY_STATE 0x4824946 #define VMX_VMCS _GUEST_ACTIVITY_STATE 0x4826947 #define VMX_VMCS _GUEST_SYSENTER_CS 0x482A /**< MSR IA32_SYSENTER_CS */948 #define VMX_VMCS _GUEST_PREEMPTION_TIMER_VALUE 0x482E927 #define VMX_VMCS32_GUEST_ES_LIMIT 0x4800 928 #define VMX_VMCS32_GUEST_CS_LIMIT 0x4802 929 #define VMX_VMCS32_GUEST_SS_LIMIT 0x4804 930 #define VMX_VMCS32_GUEST_DS_LIMIT 0x4806 931 #define VMX_VMCS32_GUEST_FS_LIMIT 0x4808 932 #define VMX_VMCS32_GUEST_GS_LIMIT 0x480A 933 #define VMX_VMCS32_GUEST_LDTR_LIMIT 0x480C 934 #define VMX_VMCS32_GUEST_TR_LIMIT 0x480E 935 #define VMX_VMCS32_GUEST_GDTR_LIMIT 0x4810 936 #define VMX_VMCS32_GUEST_IDTR_LIMIT 0x4812 937 #define VMX_VMCS32_GUEST_ES_ACCESS_RIGHTS 0x4814 938 #define VMX_VMCS32_GUEST_CS_ACCESS_RIGHTS 0x4816 939 #define VMX_VMCS32_GUEST_SS_ACCESS_RIGHTS 0x4818 940 #define VMX_VMCS32_GUEST_DS_ACCESS_RIGHTS 0x481A 941 #define VMX_VMCS32_GUEST_FS_ACCESS_RIGHTS 0x481C 942 #define VMX_VMCS32_GUEST_GS_ACCESS_RIGHTS 0x481E 943 #define VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS 0x4820 944 #define VMX_VMCS32_GUEST_TR_ACCESS_RIGHTS 0x4822 945 #define VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE 0x4824 946 #define VMX_VMCS32_GUEST_ACTIVITY_STATE 0x4826 947 #define VMX_VMCS32_GUEST_SYSENTER_CS 0x482A /**< MSR IA32_SYSENTER_CS */ 948 #define VMX_VMCS32_GUEST_PREEMPTION_TIMER_VALUE 0x482E 949 949 /** @} */ 950 950 … … 977 977 * @{ 978 978 */ 979 #define VMX_VMCS _HOST_SYSENTER_CS0x4C00979 #define VMX_VMCS32_HOST_SYSENTER_CS 0x4C00 980 980 /** @} */ 981 981 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r14580 r14581 816 816 817 817 /* Selector registers. */ 818 rc = VMXWriteVMCS(VMX_VMCS _HOST_FIELD_CS, ASMGetCS());818 rc = VMXWriteVMCS(VMX_VMCS16_HOST_FIELD_CS, ASMGetCS()); 819 819 /* Note: VMX is (again) very picky about the RPL of the selectors here; we'll restore them manually. */ 820 rc |= VMXWriteVMCS(VMX_VMCS _HOST_FIELD_DS, 0);821 rc |= VMXWriteVMCS(VMX_VMCS _HOST_FIELD_ES, 0);820 rc |= VMXWriteVMCS(VMX_VMCS16_HOST_FIELD_DS, 0); 821 rc |= VMXWriteVMCS(VMX_VMCS16_HOST_FIELD_ES, 0); 822 822 #if HC_ARCH_BITS == 32 823 rc |= VMXWriteVMCS(VMX_VMCS _HOST_FIELD_FS, 0);824 rc |= VMXWriteVMCS(VMX_VMCS _HOST_FIELD_GS, 0);825 #endif 826 rc |= VMXWriteVMCS(VMX_VMCS _HOST_FIELD_SS, ASMGetSS());823 rc |= VMXWriteVMCS(VMX_VMCS16_HOST_FIELD_FS, 0); 824 rc |= VMXWriteVMCS(VMX_VMCS16_HOST_FIELD_GS, 0); 825 #endif 826 rc |= VMXWriteVMCS(VMX_VMCS16_HOST_FIELD_SS, ASMGetSS()); 827 827 SelTR = ASMGetTR(); 828 rc |= VMXWriteVMCS(VMX_VMCS _HOST_FIELD_TR, SelTR);828 rc |= VMXWriteVMCS(VMX_VMCS16_HOST_FIELD_TR, SelTR); 829 829 AssertRC(rc); 830 830 Log2(("VMX_VMCS_HOST_FIELD_CS %08x\n", ASMGetCS())); … … 873 873 /* Sysenter MSRs. */ 874 874 /** @todo expensive!! */ 875 rc = VMXWriteVMCS(VMX_VMCS _HOST_SYSENTER_CS, ASMRdMsr_Low(MSR_IA32_SYSENTER_CS));875 rc = VMXWriteVMCS(VMX_VMCS32_HOST_SYSENTER_CS, ASMRdMsr_Low(MSR_IA32_SYSENTER_CS)); 876 876 Log2(("VMX_VMCS_HOST_SYSENTER_CS %08x\n", ASMRdMsr_Low(MSR_IA32_SYSENTER_CS))); 877 877 #if HC_ARCH_BITS == 32 … … 1057 1057 if (pCtx->ldtr == 0) 1058 1058 { 1059 rc = VMXWriteVMCS(VMX_VMCS _GUEST_FIELD_LDTR, 0);1060 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_LDTR_LIMIT, 0);1061 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_LDTR_BASE, 0);1059 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_LDTR, 0); 1060 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_LIMIT, 0); 1061 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_LDTR_BASE, 0); 1062 1062 /* Note: vmlaunch will fail with 0 or just 0x02. No idea why. */ 1063 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_LDTR_ACCESS_RIGHTS, 0x82 /* present, LDT */);1063 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS, 0x82 /* present, LDT */); 1064 1064 } 1065 1065 else 1066 1066 { 1067 rc = VMXWriteVMCS(VMX_VMCS _GUEST_FIELD_LDTR, pCtx->ldtr);1068 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_LDTR_LIMIT, pCtx->ldtrHid.u32Limit);1069 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_LDTR_BASE, pCtx->ldtrHid.u64Base);1070 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_LDTR_ACCESS_RIGHTS, pCtx->ldtrHid.Attr.u);1067 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_LDTR, pCtx->ldtr); 1068 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_LIMIT, pCtx->ldtrHid.u32Limit); 1069 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_LDTR_BASE, pCtx->ldtrHid.u64Base); 1070 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS, pCtx->ldtrHid.Attr.u); 1071 1071 } 1072 1072 AssertRC(rc); … … 1085 1085 AssertRC(rc); 1086 1086 1087 rc = VMXWriteVMCS(VMX_VMCS _GUEST_FIELD_TR, 0);1088 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_TR_LIMIT, HWACCM_VTX_TSS_SIZE);1089 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_TR_BASE, GCPhys /* phys = virt in this mode */);1087 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_TR, 0); 1088 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_TR_LIMIT, HWACCM_VTX_TSS_SIZE); 1089 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_TR_BASE, GCPhys /* phys = virt in this mode */); 1090 1090 1091 1091 X86DESCATTR attr; … … 1099 1099 #endif /* HWACCM_VMX_EMULATE_REALMODE */ 1100 1100 { 1101 rc = VMXWriteVMCS(VMX_VMCS _GUEST_FIELD_TR, pCtx->tr);1102 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_TR_LIMIT, pCtx->trHid.u32Limit);1103 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_TR_BASE, pCtx->trHid.u64Base);1101 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_TR, pCtx->tr); 1102 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_TR_LIMIT, pCtx->trHid.u32Limit); 1103 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_TR_BASE, pCtx->trHid.u64Base); 1104 1104 1105 1105 val = pCtx->trHid.Attr.u; … … 1113 1113 1114 1114 } 1115 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_TR_ACCESS_RIGHTS, val);1115 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_TR_ACCESS_RIGHTS, val); 1116 1116 AssertRC(rc); 1117 1117 } … … 1119 1119 if (pVCpu->hwaccm.s.fContextUseFlags & HWACCM_CHANGED_GUEST_GDTR) 1120 1120 { 1121 rc = VMXWriteVMCS(VMX_VMCS _GUEST_GDTR_LIMIT, pCtx->gdtr.cbGdt);1122 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_GDTR_BASE, pCtx->gdtr.pGdt);1121 rc = VMXWriteVMCS(VMX_VMCS32_GUEST_GDTR_LIMIT, pCtx->gdtr.cbGdt); 1122 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_GDTR_BASE, pCtx->gdtr.pGdt); 1123 1123 AssertRC(rc); 1124 1124 } … … 1126 1126 if (pVCpu->hwaccm.s.fContextUseFlags & HWACCM_CHANGED_GUEST_IDTR) 1127 1127 { 1128 rc = VMXWriteVMCS(VMX_VMCS _GUEST_IDTR_LIMIT, pCtx->idtr.cbIdt);1129 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_IDTR_BASE, pCtx->idtr.pIdt);1128 rc = VMXWriteVMCS(VMX_VMCS32_GUEST_IDTR_LIMIT, pCtx->idtr.cbIdt); 1129 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_IDTR_BASE, pCtx->idtr.pIdt); 1130 1130 AssertRC(rc); 1131 1131 } … … 1134 1134 * Sysenter MSRs (unconditional) 1135 1135 */ 1136 rc = VMXWriteVMCS(VMX_VMCS _GUEST_SYSENTER_CS,pCtx->SysEnter.cs);1136 rc = VMXWriteVMCS(VMX_VMCS32_GUEST_SYSENTER_CS, pCtx->SysEnter.cs); 1137 1137 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_SYSENTER_EIP, pCtx->SysEnter.eip); 1138 1138 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_SYSENTER_ESP, pCtx->SysEnter.esp); … … 1486 1486 1487 1487 /* Take care of instruction fusing (sti, mov ss) */ 1488 rc |= VMXReadVMCS(VMX_VMCS _GUEST_INTERRUPTIBILITY_STATE, &val);1488 rc |= VMXReadVMCS(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE, &val); 1489 1489 uInterruptState = val; 1490 1490 if (uInterruptState != 0) … … 1542 1542 * System MSRs 1543 1543 */ 1544 VMXReadVMCS(VMX_VMCS _GUEST_SYSENTER_CS,&val);1544 VMXReadVMCS(VMX_VMCS32_GUEST_SYSENTER_CS, &val); 1545 1545 pCtx->SysEnter.cs = val; 1546 1546 VMXReadVMCS(VMX_VMCS_GUEST_SYSENTER_EIP, &val); … … 1552 1552 VMX_READ_SELREG(LDTR, ldtr); 1553 1553 1554 VMXReadVMCS(VMX_VMCS _GUEST_GDTR_LIMIT,&val);1554 VMXReadVMCS(VMX_VMCS32_GUEST_GDTR_LIMIT, &val); 1555 1555 pCtx->gdtr.cbGdt = val; 1556 1556 VMXReadVMCS(VMX_VMCS_GUEST_GDTR_BASE, &val); 1557 1557 pCtx->gdtr.pGdt = val; 1558 1558 1559 VMXReadVMCS(VMX_VMCS _GUEST_IDTR_LIMIT,&val);1559 VMXReadVMCS(VMX_VMCS32_GUEST_IDTR_LIMIT, &val); 1560 1560 pCtx->idtr.cbIdt = val; 1561 1561 VMXReadVMCS(VMX_VMCS_GUEST_IDTR_BASE, &val); … … 1698 1698 AssertMsg(pVCpu->hwaccm.s.uCurrentASID >= 1 && pVCpu->hwaccm.s.uCurrentASID < pVM->hwaccm.s.uMaxASID, ("cpu%d VM uCurrentASID = %x\n", pCpu->idCpu, pVCpu->hwaccm.s.uCurrentASID)); 1699 1699 1700 int rc = VMXWriteVMCS(VMX_VMCS _GUEST_FIELD_VPID, pVCpu->hwaccm.s.uCurrentASID);1700 int rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_VPID, pVCpu->hwaccm.s.uCurrentASID); 1701 1701 AssertRC(rc); 1702 1702 … … 1825 1825 VM_FF_CLEAR(pVM, VM_FF_INHIBIT_INTERRUPTS); 1826 1826 /* Irq inhibition is no longer active; clear the corresponding VMX state. */ 1827 rc = VMXWriteVMCS(VMX_VMCS _GUEST_INTERRUPTIBILITY_STATE, 0);1827 rc = VMXWriteVMCS(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE, 0); 1828 1828 AssertRC(rc); 1829 1829 } … … 1832 1832 { 1833 1833 /* Irq inhibition is no longer active; clear the corresponding VMX state. */ 1834 rc = VMXWriteVMCS(VMX_VMCS _GUEST_INTERRUPTIBILITY_STATE, 0);1834 rc = VMXWriteVMCS(VMX_VMCS32_GUEST_INTERRUPTIBILITY_STATE, 0); 1835 1835 AssertRC(rc); 1836 1836 } … … 1946 1946 /* Non-register state Guest Context */ 1947 1947 /** @todo change me according to cpu state */ 1948 rc = VMXWriteVMCS(VMX_VMCS _GUEST_ACTIVITY_STATE, VMX_CMS_GUEST_ACTIVITY_ACTIVE);1948 rc = VMXWriteVMCS(VMX_VMCS32_GUEST_ACTIVITY_STATE, VMX_CMS_GUEST_ACTIVITY_ACTIVE); 1949 1949 AssertRC(rc); 1950 1950 … … 3252 3252 Log(("VMX_VMCS_HOST_CR4 %08x\n", val)); 3253 3253 3254 VMXReadVMCS(VMX_VMCS _HOST_FIELD_CS, &val);3254 VMXReadVMCS(VMX_VMCS16_HOST_FIELD_CS, &val); 3255 3255 Log(("VMX_VMCS_HOST_FIELD_CS %08x\n", val)); 3256 3256 … … 3264 3264 } 3265 3265 3266 VMXReadVMCS(VMX_VMCS _HOST_FIELD_DS, &val);3266 VMXReadVMCS(VMX_VMCS16_HOST_FIELD_DS, &val); 3267 3267 Log(("VMX_VMCS_HOST_FIELD_DS %08x\n", val)); 3268 3268 if (val < gdtr.cbGdt) … … 3272 3272 } 3273 3273 3274 VMXReadVMCS(VMX_VMCS _HOST_FIELD_ES, &val);3274 VMXReadVMCS(VMX_VMCS16_HOST_FIELD_ES, &val); 3275 3275 Log(("VMX_VMCS_HOST_FIELD_ES %08x\n", val)); 3276 3276 if (val < gdtr.cbGdt) … … 3280 3280 } 3281 3281 3282 VMXReadVMCS(VMX_VMCS _HOST_FIELD_FS, &val);3283 Log(("VMX_VMCS _HOST_FIELD_FS %08x\n", val));3282 VMXReadVMCS(VMX_VMCS16_HOST_FIELD_FS, &val); 3283 Log(("VMX_VMCS16_HOST_FIELD_FS %08x\n", val)); 3284 3284 if (val < gdtr.cbGdt) 3285 3285 { … … 3288 3288 } 3289 3289 3290 VMXReadVMCS(VMX_VMCS _HOST_FIELD_GS, &val);3291 Log(("VMX_VMCS _HOST_FIELD_GS %08x\n", val));3290 VMXReadVMCS(VMX_VMCS16_HOST_FIELD_GS, &val); 3291 Log(("VMX_VMCS16_HOST_FIELD_GS %08x\n", val)); 3292 3292 if (val < gdtr.cbGdt) 3293 3293 { … … 3296 3296 } 3297 3297 3298 VMXReadVMCS(VMX_VMCS _HOST_FIELD_SS, &val);3299 Log(("VMX_VMCS _HOST_FIELD_SS %08x\n", val));3298 VMXReadVMCS(VMX_VMCS16_HOST_FIELD_SS, &val); 3299 Log(("VMX_VMCS16_HOST_FIELD_SS %08x\n", val)); 3300 3300 if (val < gdtr.cbGdt) 3301 3301 { … … 3304 3304 } 3305 3305 3306 VMXReadVMCS(VMX_VMCS _HOST_FIELD_TR, &val);3307 Log(("VMX_VMCS _HOST_FIELD_TR %08x\n", val));3306 VMXReadVMCS(VMX_VMCS16_HOST_FIELD_TR, &val); 3307 Log(("VMX_VMCS16_HOST_FIELD_TR %08x\n", val)); 3308 3308 if (val < gdtr.cbGdt) 3309 3309 { … … 3320 3320 Log(("VMX_VMCS_HOST_IDTR_BASE %RHv\n", val)); 3321 3321 3322 VMXReadVMCS(VMX_VMCS _HOST_SYSENTER_CS, &val);3322 VMXReadVMCS(VMX_VMCS32_HOST_SYSENTER_CS, &val); 3323 3323 Log(("VMX_VMCS_HOST_SYSENTER_CS %08x\n", val)); 3324 3324 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.h
r14366 r14581 142 142 #define VMX_WRITE_SELREG(REG, reg) \ 143 143 { \ 144 rc = VMXWriteVMCS(VMX_VMCS _GUEST_FIELD_##REG, pCtx->reg); \145 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_##REG##_LIMIT, pCtx->reg##Hid.u32Limit); \144 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_##REG, pCtx->reg); \ 145 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_##REG##_LIMIT, pCtx->reg##Hid.u32Limit); \ 146 146 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_##REG##_BASE, pCtx->reg##Hid.u64Base); \ 147 147 if ((pCtx->eflags.u32 & X86_EFL_VM)) \ … … 161 161 val = 0x10000; /* Invalid guest state error otherwise. (BIT(16) = Unusable) */ \ 162 162 \ 163 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_##REG##_ACCESS_RIGHTS, val); \163 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, val); \ 164 164 } 165 165 166 166 #define VMX_READ_SELREG(REG, reg) \ 167 167 { \ 168 VMXReadVMCS(VMX_VMCS _GUEST_FIELD_##REG, &val);\168 VMXReadVMCS(VMX_VMCS16_GUEST_FIELD_##REG, &val); \ 169 169 pCtx->reg = val; \ 170 VMXReadVMCS(VMX_VMCS _GUEST_##REG##_LIMIT, &val);\170 VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_LIMIT, &val); \ 171 171 pCtx->reg##Hid.u32Limit = val; \ 172 172 VMXReadVMCS(VMX_VMCS_GUEST_##REG##_BASE, &val); \ 173 173 pCtx->reg##Hid.u64Base = val; \ 174 VMXReadVMCS(VMX_VMCS _GUEST_##REG##_ACCESS_RIGHTS, &val);\174 VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &val); \ 175 175 pCtx->reg##Hid.Attr.u = val; \ 176 176 } … … 178 178 #define VMX_LOG_SELREG(REG, szSelReg) \ 179 179 { \ 180 VMXReadVMCS(VMX_VMCS _GUEST_FIELD_##REG, &val);\180 VMXReadVMCS(VMX_VMCS16_GUEST_FIELD_##REG, &val); \ 181 181 Log(("%s Selector %x\n", szSelReg, val)); \ 182 VMXReadVMCS(VMX_VMCS _GUEST_##REG##_LIMIT, &val);\182 VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_LIMIT, &val); \ 183 183 Log(("%s Limit %x\n", szSelReg, val)); \ 184 184 VMXReadVMCS(VMX_VMCS_GUEST_##REG##_BASE, &val); \ 185 185 Log(("%s Base %RX64\n", szSelReg, val)); \ 186 VMXReadVMCS(VMX_VMCS _GUEST_##REG##_ACCESS_RIGHTS, &val);\186 VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &val); \ 187 187 Log(("%s Attributes %x\n", szSelReg, val)); \ 188 188 }
Note:
See TracChangeset
for help on using the changeset viewer.