- Timestamp:
- Dec 4, 2008 4:32:35 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMGC/HWACCMGCA.asm
r14993 r14997 179 179 cli 180 180 181 ; Have to sync half the guest state as we can't access most of the 64 bits state. Sigh 182 ; VMCSWRITE VMX_VMCS64_GUEST_CS_BASE, [rsi + CPUMCTX.csHid.u64Base] 183 ; VMCSWRITE VMX_VMCS64_GUEST_DS_BASE, [rsi + CPUMCTX.dsHid.u64Base] 184 ; VMCSWRITE VMX_VMCS64_GUEST_ES_BASE, [rsi + CPUMCTX.esHid.u64Base] 185 ; VMCSWRITE VMX_VMCS64_GUEST_FS_BASE, [rsi + CPUMCTX.fsHid.u64Base] 186 ; VMCSWRITE VMX_VMCS64_GUEST_GS_BASE, [rsi + CPUMCTX.gsHid.u64Base] 187 ; VMCSWRITE VMX_VMCS64_GUEST_SS_BASE, [rsi + CPUMCTX.ssHid.u64Base] 188 ; VMCSWRITE VMX_VMCS64_GUEST_LDTR_BASE, [rsi + CPUMCTX.ldtrHid.u64Base] 189 ; VMCSWRITE VMX_VMCS64_GUEST_GDTR_BASE, [rsi + CPUMCTX.gdtrHid.u64Base] 190 ; VMCSWRITE VMX_VMCS64_GUEST_IDTR_BASE, [rsi + CPUMCTX.idtrHid.u64Base] 191 ; VMCSWRITE VMX_VMCS64_GUEST_TR_BASE, [rsi + CPUMCTX.trHid.u64Base] 192 ; 193 ; VMCSWRITE VMX_VMCS64_GUEST_SYSENTER_EIP, [rsi + CPUMCTX.SysEnter.eip] 194 ; VMCSWRITE VMX_VMCS64_GUEST_SYSENTER_ESP, [rsi + CPUMCTX.SysEnter.esp] 195 ; 196 ; VMCSWRITE VMX_VMCS64_GUEST_RIP, [rsi + CPUMCTX.eip] 197 ; VMCSWRITE VMX_VMCS64_GUEST_RSP, [rsi + CPUMCTX.esp] 198 199 181 200 ;/* First we have to save some final CPU context registers. */ 182 lea rax, [.vmlaunch64_done wrt rip] 201 lea rax, [.vmlaunch64_done wrt rip] 183 202 push rax 184 203 mov rax, VMX_VMCS_HOST_RIP ;/* return address (too difficult to continue after VMLAUNCH?) */ -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r14946 r14997 1132 1132 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_LDTR, 0); 1133 1133 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_LIMIT, 0); 1134 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_LDTR_BASE,0);1134 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_LDTR_BASE, 0); 1135 1135 /* Note: vmlaunch will fail with 0 or just 0x02. No idea why. */ 1136 1136 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS, 0x82 /* present, LDT */); … … 1140 1140 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_LDTR, pCtx->ldtr); 1141 1141 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_LIMIT, pCtx->ldtrHid.u32Limit); 1142 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_LDTR_BASE,pCtx->ldtrHid.u64Base);1142 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_LDTR_BASE, pCtx->ldtrHid.u64Base); 1143 1143 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS, pCtx->ldtrHid.Attr.u); 1144 1144 } … … 1160 1160 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_TR, 0); 1161 1161 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_TR_LIMIT, HWACCM_VTX_TSS_SIZE); 1162 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_TR_BASE,GCPhys /* phys = virt in this mode */);1162 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_TR_BASE, GCPhys /* phys = virt in this mode */); 1163 1163 1164 1164 X86DESCATTR attr; … … 1174 1174 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_TR, pCtx->tr); 1175 1175 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_TR_LIMIT, pCtx->trHid.u32Limit); 1176 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_TR_BASE,pCtx->trHid.u64Base);1176 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_TR_BASE, pCtx->trHid.u64Base); 1177 1177 1178 1178 val = pCtx->trHid.Attr.u; … … 1193 1193 { 1194 1194 rc = VMXWriteVMCS(VMX_VMCS32_GUEST_GDTR_LIMIT, pCtx->gdtr.cbGdt); 1195 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_GDTR_BASE,pCtx->gdtr.pGdt);1195 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_GDTR_BASE, pCtx->gdtr.pGdt); 1196 1196 AssertRC(rc); 1197 1197 } … … 1200 1200 { 1201 1201 rc = VMXWriteVMCS(VMX_VMCS32_GUEST_IDTR_LIMIT, pCtx->idtr.cbIdt); 1202 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_IDTR_BASE,pCtx->idtr.pIdt);1202 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_IDTR_BASE, pCtx->idtr.pIdt); 1203 1203 AssertRC(rc); 1204 1204 } … … 1208 1208 */ 1209 1209 rc = VMXWriteVMCS(VMX_VMCS32_GUEST_SYSENTER_CS, pCtx->SysEnter.cs); 1210 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_SYSENTER_EIP,pCtx->SysEnter.eip);1211 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_SYSENTER_ESP,pCtx->SysEnter.esp);1210 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_SYSENTER_EIP, pCtx->SysEnter.eip); 1211 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_SYSENTER_ESP, pCtx->SysEnter.esp); 1212 1212 AssertRC(rc); 1213 1213 … … 1259 1259 val &= ~(X86_CR0_CD|X86_CR0_NW); 1260 1260 1261 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_CR0,val);1261 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_CR0, val); 1262 1262 Log2(("Guest CR0 %08x\n", val)); 1263 1263 /* CR0 flags owned by the host; if the guests attempts to change them, then … … 1330 1330 #endif /* HWACCM_VMX_EMULATE_REALMODE */ 1331 1331 1332 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_CR4,val);1332 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_CR4, val); 1333 1333 Log2(("Guest CR4 %08x\n", val)); 1334 1334 /* CR4 flags owned by the host; if the guests attempts to change them, then … … 1393 1393 1394 1394 /* Save our shadow CR3 register. */ 1395 rc = VMXWriteVMCS(VMX_VMCS _GUEST_CR3, val);1395 rc = VMXWriteVMCS(VMX_VMCS64_GUEST_CR3, val); 1396 1396 AssertRC(rc); 1397 1397 } … … 1408 1408 1409 1409 /* Resync DR7 */ 1410 rc = VMXWriteVMCS(VMX_VMCS _GUEST_DR7, pCtx->dr[7]);1410 rc = VMXWriteVMCS(VMX_VMCS64_GUEST_DR7, pCtx->dr[7]); 1411 1411 AssertRC(rc); 1412 1412 … … 1438 1438 1439 1439 /* EIP, ESP and EFLAGS */ 1440 rc = VMXWriteVMCS(VMX_VMCS _GUEST_RIP,pCtx->rip);1441 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_RSP,pCtx->rsp);1440 rc = VMXWriteVMCS(VMX_VMCS64_GUEST_RIP, pCtx->rip); 1441 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_RSP, pCtx->rsp); 1442 1442 AssertRC(rc); 1443 1443 … … 1510 1510 #endif 1511 1511 /* Unconditionally update these as wrmsr might have changed them. */ 1512 rc = VMXWriteVMCS(VMX_VMCS _GUEST_FS_BASE, pCtx->fsHid.u64Base);1513 AssertRC(rc); 1514 rc = VMXWriteVMCS(VMX_VMCS _GUEST_GS_BASE, pCtx->gsHid.u64Base);1512 rc = VMXWriteVMCS(VMX_VMCS64_GUEST_FS_BASE, pCtx->fsHid.u64Base); 1513 AssertRC(rc); 1514 rc = VMXWriteVMCS(VMX_VMCS64_GUEST_GS_BASE, pCtx->gsHid.u64Base); 1515 1515 AssertRC(rc); 1516 1516 } … … 1543 1543 1544 1544 /* Let's first sync back eip, esp, and eflags. */ 1545 rc = VMXReadVMCS(VMX_VMCS _GUEST_RIP, &val);1545 rc = VMXReadVMCS(VMX_VMCS64_GUEST_RIP, &val); 1546 1546 AssertRC(rc); 1547 1547 pCtx->rip = val; 1548 rc = VMXReadVMCS(VMX_VMCS _GUEST_RSP, &val);1548 rc = VMXReadVMCS(VMX_VMCS64_GUEST_RSP, &val); 1549 1549 AssertRC(rc); 1550 1550 pCtx->rsp = val; … … 1566 1566 1567 1567 /* Control registers. */ 1568 VMXReadVMCS(VMX_VMCS_CTRL_CR0_READ_SHADOW, &valShadow);1569 VMXReadVMCS(VMX_VMCS _GUEST_CR0, &val);1568 VMXReadVMCS(VMX_VMCS_CTRL_CR0_READ_SHADOW, &valShadow); 1569 VMXReadVMCS(VMX_VMCS64_GUEST_CR0, &val); 1570 1570 val = (valShadow & pVCpu->hwaccm.s.vmx.cr0_mask) | (val & ~pVCpu->hwaccm.s.vmx.cr0_mask); 1571 1571 CPUMSetGuestCR0(pVM, val); 1572 1572 1573 VMXReadVMCS(VMX_VMCS_CTRL_CR4_READ_SHADOW, &valShadow);1574 VMXReadVMCS(VMX_VMCS _GUEST_CR4, &val);1573 VMXReadVMCS(VMX_VMCS_CTRL_CR4_READ_SHADOW, &valShadow); 1574 VMXReadVMCS(VMX_VMCS64_GUEST_CR4, &val); 1575 1575 val = (valShadow & pVCpu->hwaccm.s.vmx.cr4_mask) | (val & ~pVCpu->hwaccm.s.vmx.cr4_mask); 1576 1576 CPUMSetGuestCR4(pVM, val); … … 1584 1584 CPUMSetGuestCR2(pVM, ASMGetCR2()); 1585 1585 1586 VMXReadVMCS(VMX_VMCS _GUEST_CR3, &val);1586 VMXReadVMCS(VMX_VMCS64_GUEST_CR3, &val); 1587 1587 1588 1588 if (val != pCtx->cr3) … … 1596 1596 1597 1597 /* Sync back DR7 here. */ 1598 VMXReadVMCS(VMX_VMCS _GUEST_DR7, &val);1598 VMXReadVMCS(VMX_VMCS64_GUEST_DR7, &val); 1599 1599 pCtx->dr[7] = val; 1600 1600 … … 1612 1612 VMXReadVMCS(VMX_VMCS32_GUEST_SYSENTER_CS, &val); 1613 1613 pCtx->SysEnter.cs = val; 1614 VMXReadVMCS(VMX_VMCS _GUEST_SYSENTER_EIP, &val);1614 VMXReadVMCS(VMX_VMCS64_GUEST_SYSENTER_EIP, &val); 1615 1615 pCtx->SysEnter.eip = val; 1616 VMXReadVMCS(VMX_VMCS _GUEST_SYSENTER_ESP, &val);1616 VMXReadVMCS(VMX_VMCS64_GUEST_SYSENTER_ESP, &val); 1617 1617 pCtx->SysEnter.esp = val; 1618 1618 … … 1622 1622 VMXReadVMCS(VMX_VMCS32_GUEST_GDTR_LIMIT, &val); 1623 1623 pCtx->gdtr.cbGdt = val; 1624 VMXReadVMCS(VMX_VMCS _GUEST_GDTR_BASE, &val);1624 VMXReadVMCS(VMX_VMCS64_GUEST_GDTR_BASE, &val); 1625 1625 pCtx->gdtr.pGdt = val; 1626 1626 1627 1627 VMXReadVMCS(VMX_VMCS32_GUEST_IDTR_LIMIT, &val); 1628 1628 pCtx->idtr.cbIdt = val; 1629 VMXReadVMCS(VMX_VMCS _GUEST_IDTR_BASE, &val);1629 VMXReadVMCS(VMX_VMCS64_GUEST_IDTR_BASE, &val); 1630 1630 pCtx->idtr.pIdt = val; 1631 1631 … … 2337 2337 2338 2338 /* Resync DR7 */ 2339 rc = VMXWriteVMCS(VMX_VMCS _GUEST_DR7, pCtx->dr[7]);2339 rc = VMXWriteVMCS(VMX_VMCS64_GUEST_DR7, pCtx->dr[7]); 2340 2340 AssertRC(rc); 2341 2341 … … 2872 2872 2873 2873 /* Resync DR7 */ 2874 rc = VMXWriteVMCS(VMX_VMCS _GUEST_DR7, pCtx->dr[7]);2874 rc = VMXWriteVMCS(VMX_VMCS64_GUEST_DR7, pCtx->dr[7]); 2875 2875 AssertRC(rc); 2876 2876 … … 3020 3020 Log(("VMX_EXIT_ERR_INVALID_GUEST_STATE\n")); 3021 3021 3022 VMXReadVMCS(VMX_VMCS _GUEST_RIP, &val);3022 VMXReadVMCS(VMX_VMCS64_GUEST_RIP, &val); 3023 3023 Log(("Old eip %RGv new %RGv\n", (RTGCPTR)pCtx->rip, (RTGCPTR)val)); 3024 3024 3025 VMXReadVMCS(VMX_VMCS _GUEST_CR0, &val);3025 VMXReadVMCS(VMX_VMCS64_GUEST_CR0, &val); 3026 3026 Log(("VMX_VMCS_GUEST_CR0 %RX64\n", val)); 3027 3027 3028 VMXReadVMCS(VMX_VMCS _GUEST_CR3, &val);3028 VMXReadVMCS(VMX_VMCS64_GUEST_CR3, &val); 3029 3029 Log(("VMX_VMCS_GUEST_CR3 %RGp\n", val)); 3030 3030 3031 VMXReadVMCS(VMX_VMCS _GUEST_CR4, &val);3031 VMXReadVMCS(VMX_VMCS64_GUEST_CR4, &val); 3032 3032 Log(("VMX_VMCS_GUEST_CR4 %RX64\n", val)); 3033 3033 … … 3044 3044 VMX_LOG_SELREG(LDTR, "LDTR"); 3045 3045 3046 VMXReadVMCS(VMX_VMCS _GUEST_GDTR_BASE, &val);3046 VMXReadVMCS(VMX_VMCS64_GUEST_GDTR_BASE, &val); 3047 3047 Log(("VMX_VMCS_GUEST_GDTR_BASE %RGv\n", val)); 3048 VMXReadVMCS(VMX_VMCS _GUEST_IDTR_BASE, &val);3048 VMXReadVMCS(VMX_VMCS64_GUEST_IDTR_BASE, &val); 3049 3049 Log(("VMX_VMCS_GUEST_IDTR_BASE %RGv\n", val)); 3050 3050 #endif /* VBOX_STRICT */ … … 3301 3301 ASMGetGDTR(&gdtr); 3302 3302 3303 VMXReadVMCS(VMX_VMCS _GUEST_RIP, &val);3303 VMXReadVMCS(VMX_VMCS64_GUEST_RIP, &val); 3304 3304 Log(("Old eip %RGv new %RGv\n", (RTGCPTR)pCtx->rip, (RTGCPTR)val)); 3305 3305 VMXReadVMCS(VMX_VMCS_CTRL_PIN_EXEC_CONTROLS, &val); -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.h
r14875 r14997 155 155 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_##REG, pCtx->reg); \ 156 156 rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_##REG##_LIMIT, pCtx->reg##Hid.u32Limit); \ 157 rc |= VMXWriteVMCS(VMX_VMCS _GUEST_##REG##_BASE, pCtx->reg##Hid.u64Base); \157 rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_##REG##_BASE, pCtx->reg##Hid.u64Base); \ 158 158 if ((pCtx->eflags.u32 & X86_EFL_VM)) \ 159 159 val = pCtx->reg##Hid.Attr.u; \ … … 181 181 VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_LIMIT, &val); \ 182 182 pCtx->reg##Hid.u32Limit = val; \ 183 VMXReadVMCS(VMX_VMCS _GUEST_##REG##_BASE, &val);\183 VMXReadVMCS(VMX_VMCS64_GUEST_##REG##_BASE, &val); \ 184 184 pCtx->reg##Hid.u64Base = val; \ 185 185 VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &val); \ … … 193 193 VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_LIMIT, &val); \ 194 194 Log(("%s Limit %x\n", szSelReg, val)); \ 195 VMXReadVMCS(VMX_VMCS _GUEST_##REG##_BASE, &val);\195 VMXReadVMCS(VMX_VMCS64_GUEST_##REG##_BASE, &val); \ 196 196 Log(("%s Base %RX64\n", szSelReg, val)); \ 197 197 VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &val); \
Note:
See TracChangeset
for help on using the changeset viewer.