Changeset 2224 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Apr 19, 2007 1:18:14 PM (18 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r2218 r2224 509 509 SVM_VMCB *pVMCB; 510 510 bool fForceTLBFlush = false; 511 bool fGuestStateSynced = false; 511 512 512 513 STAM_PROFILE_ADV_START(&pVM->hwaccm.s.StatEntry, x); … … 581 582 goto end; 582 583 } 584 fGuestStateSynced = true; 583 585 584 586 /* All done! Let's start VM execution. */ … … 1347 1349 } 1348 1350 1349 /* Remaining guest CPU context: TR, IDTR, GDTR, LDTR. */ 1350 SVM_READ_SELREG(LDTR, ldtr); 1351 SVM_READ_SELREG(TR, tr); 1352 1353 pCtx->gdtr.cbGdt = pVMCB->guest.GDTR.u32Limit; 1354 pCtx->gdtr.pGdt = pVMCB->guest.GDTR.u64Base; 1355 1356 pCtx->idtr.cbIdt = pVMCB->guest.IDTR.u32Limit; 1357 pCtx->idtr.pIdt = pVMCB->guest.IDTR.u64Base; 1358 1359 /* 1360 * System MSRs 1361 */ 1362 pCtx->SysEnter.cs = pVMCB->guest.u64SysEnterCS; 1363 pCtx->SysEnter.eip = pVMCB->guest.u64SysEnterEIP; 1364 pCtx->SysEnter.esp = pVMCB->guest.u64SysEnterESP; 1351 end: 1352 if (fGuestStateSynced) 1353 { 1354 /* Remaining guest CPU context: TR, IDTR, GDTR, LDTR. */ 1355 SVM_READ_SELREG(LDTR, ldtr); 1356 SVM_READ_SELREG(TR, tr); 1357 1358 pCtx->gdtr.cbGdt = pVMCB->guest.GDTR.u32Limit; 1359 pCtx->gdtr.pGdt = pVMCB->guest.GDTR.u64Base; 1360 1361 pCtx->idtr.cbIdt = pVMCB->guest.IDTR.u32Limit; 1362 pCtx->idtr.pIdt = pVMCB->guest.IDTR.u64Base; 1363 1364 /* 1365 * System MSRs 1366 */ 1367 pCtx->SysEnter.cs = pVMCB->guest.u64SysEnterCS; 1368 pCtx->SysEnter.eip = pVMCB->guest.u64SysEnterEIP; 1369 pCtx->SysEnter.esp = pVMCB->guest.u64SysEnterESP; 1370 } 1365 1371 1366 1372 /* Signal changes for the recompiler. */ 1367 1373 CPUMSetChangedFlags(pVM, CPUM_CHANGED_SYSENTER_MSR | CPUM_CHANGED_LDTR | CPUM_CHANGED_GDTR | CPUM_CHANGED_IDTR | CPUM_CHANGED_TR | CPUM_CHANGED_HIDDEN_SEL_REGS); 1368 1369 end:1370 1374 1371 1375 /* If we executed vmrun and an external irq was pending, then we don't have to do a full sync the next time. */ -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r2218 r2224 780 780 RTGCUINTPTR intInfo = 0; /* shut up buggy gcc 4 */ 781 781 RTGCUINTPTR errCode, instrInfo, uInterruptState; 782 bool fGuestStateSynced = false; 782 783 783 784 Log2(("\nE")); … … 930 931 goto end; 931 932 } 933 fGuestStateSynced = true; 932 934 933 935 /* Non-register state Guest Context */ … … 1632 1634 } 1633 1635 1634 /* Remaining guest CPU context: TR, IDTR, GDTR, LDTR. */ 1635 VMX_READ_SELREG(LDTR, ldtr); 1636 VMX_READ_SELREG(TR, tr); 1637 1638 VMXReadVMCS(VMX_VMCS_GUEST_GDTR_LIMIT, &val); 1639 pCtx->gdtr.cbGdt = val; 1640 VMXReadVMCS(VMX_VMCS_GUEST_GDTR_BASE, &val); 1641 pCtx->gdtr.pGdt = val; 1642 1643 VMXReadVMCS(VMX_VMCS_GUEST_IDTR_LIMIT, &val); 1644 pCtx->idtr.cbIdt = val; 1645 VMXReadVMCS(VMX_VMCS_GUEST_IDTR_BASE, &val); 1646 pCtx->idtr.pIdt = val; 1647 1648 /* 1649 * System MSRs 1650 */ 1651 VMXReadVMCS(VMX_VMCS_GUEST_SYSENTER_CS, &val); 1652 pCtx->SysEnter.cs = val; 1653 VMXReadVMCS(VMX_VMCS_GUEST_SYSENTER_EIP, &val); 1654 pCtx->SysEnter.eip = val; 1655 VMXReadVMCS(VMX_VMCS_GUEST_SYSENTER_ESP, &val); 1656 pCtx->SysEnter.esp = val; 1657 1658 /* Signal changes for the recompiler. */ 1659 CPUMSetChangedFlags(pVM, CPUM_CHANGED_SYSENTER_MSR | CPUM_CHANGED_LDTR | CPUM_CHANGED_GDTR | CPUM_CHANGED_IDTR | CPUM_CHANGED_TR | CPUM_CHANGED_HIDDEN_SEL_REGS); 1636 /** Note: the guest state isn't entirely synced back at this stage. */ 1660 1637 1661 1638 /* Investigate why there was a VM-exit. (part 2) */ … … 1755 1732 } 1756 1733 end: 1734 if (fGuestStateSynced) 1735 { 1736 /* Remaining guest CPU context: TR, IDTR, GDTR, LDTR. */ 1737 VMX_READ_SELREG(LDTR, ldtr); 1738 VMX_READ_SELREG(TR, tr); 1739 1740 VMXReadVMCS(VMX_VMCS_GUEST_GDTR_LIMIT, &val); 1741 pCtx->gdtr.cbGdt = val; 1742 VMXReadVMCS(VMX_VMCS_GUEST_GDTR_BASE, &val); 1743 pCtx->gdtr.pGdt = val; 1744 1745 VMXReadVMCS(VMX_VMCS_GUEST_IDTR_LIMIT, &val); 1746 pCtx->idtr.cbIdt = val; 1747 VMXReadVMCS(VMX_VMCS_GUEST_IDTR_BASE, &val); 1748 pCtx->idtr.pIdt = val; 1749 1750 /* 1751 * System MSRs 1752 */ 1753 VMXReadVMCS(VMX_VMCS_GUEST_SYSENTER_CS, &val); 1754 pCtx->SysEnter.cs = val; 1755 VMXReadVMCS(VMX_VMCS_GUEST_SYSENTER_EIP, &val); 1756 pCtx->SysEnter.eip = val; 1757 VMXReadVMCS(VMX_VMCS_GUEST_SYSENTER_ESP, &val); 1758 pCtx->SysEnter.esp = val; 1759 } 1760 1761 /* Signal changes for the recompiler. */ 1762 CPUMSetChangedFlags(pVM, CPUM_CHANGED_SYSENTER_MSR | CPUM_CHANGED_LDTR | CPUM_CHANGED_GDTR | CPUM_CHANGED_IDTR | CPUM_CHANGED_TR | CPUM_CHANGED_HIDDEN_SEL_REGS); 1757 1763 1758 1764 /* If we executed vmlaunch/vmresume and an external irq was pending, then we don't have to do a full sync the next time. */
Note:
See TracChangeset
for help on using the changeset viewer.