Changeset 87345 in vbox
- Timestamp:
- Jan 21, 2021 11:37:30 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r87255 r87345 2629 2629 VMMDECL(bool) CPUMIsHostFPUStateSaved(PVMCPU pVCpu); 2630 2630 VMMDECL(bool) CPUMIsGuestDebugStateActive(PVMCPU pVCpu); 2631 VMMDECL(bool) CPUMIsGuestDebugStateActivePending(PVMCPU pVCpu);2632 2631 VMMDECL(void) CPUMDeactivateGuestDebugState(PVMCPU pVCpu); 2633 2632 VMMDECL(bool) CPUMIsHyperDebugStateActive(PVMCPU pVCpu); 2634 VMMDECL(bool) CPUMIsHyperDebugStateActivePending(PVMCPU pVCpu);2635 2633 VMMDECL(uint32_t) CPUMGetGuestCPL(PVMCPU pVCpu); 2636 2634 VMMDECL(CPUMMODE) CPUMGetGuestMode(PVMCPU pVCpu); -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r82968 r87345 1613 1613 * Checks if we activated the FPU/XMM state of the guest OS. 1614 1614 * 1615 * This differs from CPUMIsGuestFPUStateLoaded() in that it refers to the next 1616 * time we'll be executing guest code, so it may return true for 64-on-32 when 1617 * we still haven't actually loaded the FPU status, just scheduled it to be 1618 * loaded the next time we go thru the world switcher (CPUM_SYNC_FPU_STATE). 1615 * Obsolete: This differs from CPUMIsGuestFPUStateLoaded() in that it refers to 1616 * the next time we'll be executing guest code, so it may return true for 1617 * 64-on-32 when we still haven't actually loaded the FPU status, just scheduled 1618 * it to be loaded the next time we go thru the world switcher 1619 * (CPUM_SYNC_FPU_STATE). 1619 1620 * 1620 1621 * @returns true / false. … … 1623 1624 VMMDECL(bool) CPUMIsGuestFPUStateActive(PVMCPU pVCpu) 1624 1625 { 1625 return RT_BOOL(pVCpu->cpum.s.fUseFlags & (CPUM_USED_FPU_GUEST | CPUM_SYNC_FPU_STATE));1626 return RT_BOOL(pVCpu->cpum.s.fUseFlags & CPUM_USED_FPU_GUEST); 1626 1627 } 1627 1628 … … 1664 1665 1665 1666 /** 1666 * Checks if the guest debug state is to be made active during the world-switch 1667 * (currently only used for the 32->64 switcher case). 1667 * Checks if the hyper debug state is active. 1668 1668 * 1669 1669 * @returns boolean 1670 1670 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 1671 1671 */ 1672 VMMDECL(bool) CPUMIsGuestDebugStateActivePending(PVMCPU pVCpu)1673 {1674 return RT_BOOL(pVCpu->cpum.s.fUseFlags & CPUM_SYNC_DEBUG_REGS_GUEST);1675 }1676 1677 1678 /**1679 * Checks if the hyper debug state is active.1680 *1681 * @returns boolean1682 * @param pVCpu The cross context virtual CPU structure of the calling EMT.1683 */1684 1672 VMMDECL(bool) CPUMIsHyperDebugStateActive(PVMCPU pVCpu) 1685 1673 { 1686 1674 return RT_BOOL(pVCpu->cpum.s.fUseFlags & CPUM_USED_DEBUG_REGS_HYPER); 1687 }1688 1689 1690 /**1691 * Checks if the hyper debug state is to be made active during the world-switch1692 * (currently only used for the 32->64 switcher case).1693 *1694 * @returns boolean1695 * @param pVCpu The cross context virtual CPU structure of the calling EMT.1696 */1697 VMMDECL(bool) CPUMIsHyperDebugStateActivePending(PVMCPU pVCpu)1698 {1699 return RT_BOOL(pVCpu->cpum.s.fUseFlags & CPUM_SYNC_DEBUG_REGS_HYPER);1700 1675 } 1701 1676 -
trunk/src/VBox/VMM/VMMR0/CPUMR0.cpp
r82968 r87345 439 439 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 440 440 Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_USED_FPU_GUEST)); 441 Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_SYNC_FPU_STATE));442 441 443 442 if (!pVM->cpum.s.HostFeatures.fLeakyFxSR) … … 509 508 fSavedGuest = false; 510 509 Assert(!( pVCpu->cpum.s.fUseFlags 511 & (CPUM_USED_FPU_GUEST | CPUM_USED_FPU_HOST | CPUM_ SYNC_FPU_STATE | CPUM_USED_MANUAL_XMM_RESTORE)));510 & (CPUM_USED_FPU_GUEST | CPUM_USED_FPU_HOST | CPUM_USED_MANUAL_XMM_RESTORE))); 512 511 return fSavedGuest; 513 512 } … … 580 579 pVCpu->cpum.s.Guest.dr[6] = ASMGetDR6(); 581 580 } 582 ASMAtomicAndU32(&pVCpu->cpum.s.fUseFlags, ~( CPUM_USED_DEBUG_REGS_GUEST | CPUM_USED_DEBUG_REGS_HYPER 583 | CPUM_SYNC_DEBUG_REGS_GUEST | CPUM_SYNC_DEBUG_REGS_HYPER)); 581 ASMAtomicAndU32(&pVCpu->cpum.s.fUseFlags, ~(CPUM_USED_DEBUG_REGS_GUEST | CPUM_USED_DEBUG_REGS_HYPER)); 584 582 585 583 /* -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r87141 r87345 8214 8214 #endif 8215 8215 CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(pVCpu, true /* save DR6 */); 8216 Assert(!CPUMIsGuestDebugStateActive(pVCpu) && !CPUMIsGuestDebugStateActivePending(pVCpu));8217 Assert(!CPUMIsHyperDebugStateActive(pVCpu) && !CPUMIsHyperDebugStateActivePending(pVCpu));8216 Assert(!CPUMIsGuestDebugStateActive(pVCpu)); 8217 Assert(!CPUMIsHyperDebugStateActive(pVCpu)); 8218 8218 8219 8219 /* Restore host-state bits that VT-x only restores partially. */ -
trunk/src/VBox/VMM/include/CPUMInternal.h
r86218 r87345 104 104 #define CPUM_USED_DEBUG_REGS_GUEST RT_BIT(9) 105 105 106 /** Sync the FPU state on next entry (32->64 switcher only). */107 #define CPUM_SYNC_FPU_STATE RT_BIT(16)108 /** Sync the debug state on next entry (32->64 switcher only). */109 #define CPUM_SYNC_DEBUG_REGS_GUEST RT_BIT(17)110 /** Sync the debug state on next entry (32->64 switcher only).111 * Almost the same as CPUM_USE_DEBUG_REGS_HYPER in the raw-mode switchers. */112 #define CPUM_SYNC_DEBUG_REGS_HYPER RT_BIT(18)113 106 /** Host CPU requires fxsave/fxrstor leaky bit handling. */ 114 107 #define CPUM_USE_FFXSR_LEAKY RT_BIT(19) -
trunk/src/VBox/VMM/include/CPUMInternal.mac
r82968 r87345 63 63 %define CPUM_USED_DEBUG_REGS_HYPER RT_BIT(8) 64 64 %define CPUM_USED_DEBUG_REGS_GUEST RT_BIT(9) 65 %define CPUM_SYNC_FPU_STATE RT_BIT(16)66 %define CPUM_SYNC_DEBUG_REGS_GUEST RT_BIT(17)67 %define CPUM_SYNC_DEBUG_REGS_HYPER RT_BIT(18)68 65 %define CPUM_USE_FFXSR_LEAKY RT_BIT(19) 69 66 %define CPUM_USE_SUPPORTS_LONGMODE RT_BIT(20)
Note:
See TracChangeset
for help on using the changeset viewer.