Changeset 48153 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Aug 29, 2013 12:57:00 PM (11 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r48135 r48153 89 89 DECLR0CALLBACKMEMBER(void, pfnThreadCtxCallback,(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit)); 90 90 DECLR0CALLBACKMEMBER(int, pfnSaveHostState,(PVM pVM, PVMCPU pVCpu)); 91 DECLR0CALLBACKMEMBER(int, pfnLoadGuestState,(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx));92 91 DECLR0CALLBACKMEMBER(int, pfnRunGuestCode,(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)); 93 92 DECLR0CALLBACKMEMBER(int, pfnEnableCpu,(PHMGLOBALCPUINFO pCpu, PVM pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage, … … 529 528 g_HvmR0.pfnThreadCtxCallback = VMXR0ThreadCtxCallback; 530 529 g_HvmR0.pfnSaveHostState = VMXR0SaveHostState; 531 g_HvmR0.pfnLoadGuestState = VMXR0LoadGuestState;532 530 g_HvmR0.pfnRunGuestCode = VMXR0RunGuestCode; 533 531 g_HvmR0.pfnEnableCpu = VMXR0EnableCpu; … … 594 592 g_HvmR0.pfnThreadCtxCallback = SVMR0ThreadCtxCallback; 595 593 g_HvmR0.pfnSaveHostState = SVMR0SaveHostState; 596 g_HvmR0.pfnLoadGuestState = SVMR0LoadGuestState;597 594 g_HvmR0.pfnRunGuestCode = SVMR0RunGuestCode; 598 595 g_HvmR0.pfnEnableCpu = SVMR0EnableCpu; … … 658 655 g_HvmR0.pfnThreadCtxCallback = hmR0DummyThreadCtxCallback; 659 656 g_HvmR0.pfnSaveHostState = hmR0DummySaveHostState; 660 g_HvmR0.pfnLoadGuestState = hmR0DummyLoadGuestState;661 657 g_HvmR0.pfnRunGuestCode = hmR0DummyRunGuestCode; 662 658 g_HvmR0.pfnEnableCpu = hmR0DummyEnableCpu; … … 1459 1455 1460 1456 /* Load the host as we may be resuming code after a longjmp and quite 1461 possibly be scheduled on a different CPU. */1457 possibly now be scheduled on a different CPU. */ 1462 1458 rc = g_HvmR0.pfnSaveHostState(pVM, pVCpu); 1463 1459 AssertMsgRCReturn(rc, ("pfnSaveHostState failed. rc=%Rrc pVCpu=%p HostCpuId=%u\n", rc, pVCpu, idCpu), rc); 1464 1465 /** @todo This is not needed to be done here anymore, can fix/optimize later. */1466 rc = g_HvmR0.pfnLoadGuestState(pVM, pVCpu, pCtx);1467 AssertMsgRCReturn(rc, ("pfnLoadGuestState failed. rc=%Rrc pVCpu=%p HostCpuId=%u\n", rc, pVCpu, idCpu), rc);1468 1460 1469 1461 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r48140 r48153 1718 1718 1719 1719 /** 1720 * Loads the guest state on the way from ring-3.1721 *1722 * @returns VBox status code.1723 * @param pVM Pointer to the VM.1724 * @param pVCpu Pointer to the VMCPU.1725 * @param pCtx Pointer to the guest-CPU context.1726 *1727 * @remarks No-long-jump zone!!!1728 */1729 VMMR0DECL(int) SVMR0LoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)1730 {1731 /*1732 * Avoid reloading the guest state on longjmp reentrants and do it lazily just before executing the guest.1733 * This only helps when we get rescheduled more than once to a different host CPU on a longjmp trip before1734 * finally executing guest code.1735 */1736 return VINF_SUCCESS;1737 }1738 1739 1740 /**1741 1720 * Saves the entire guest state from the VMCB into the 1742 1721 * guest-CPU context. Currently there is no residual state left in the CPU that -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.h
r47771 r48153 41 41 VMMR0DECL(void) SVMR0GlobalTerm(void); 42 42 VMMR0DECL(int) SVMR0Enter(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pCpu); 43 VMMR0DECL(int) SVMR0Leave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);44 43 VMMR0DECL(void) SVMR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit); 45 44 VMMR0DECL(int) SVMR0EnableCpu(PHMGLOBALCPUINFO pCpu, PVM pVM, void *pvPageCpu, RTHCPHYS HCPhysCpuPage, bool fEnabledBySystem); … … 50 49 VMMR0DECL(int) SVMR0RunGuestCode(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx); 51 50 VMMR0DECL(int) SVMR0SaveHostState(PVM pVM, PVMCPU pVCpu); 52 VMMR0DECL(int) SVMR0LoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);53 51 54 52 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL) -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r48140 r48153 7200 7200 AssertMsg(!(pVCpu->hm.s.fContextUseFlags & HM_CHANGED_HOST_GUEST_SHARED_STATE), ("fContextUseFlags=%#x\n", 7201 7201 pVCpu->hm.s.fContextUseFlags)); 7202 }7203 7204 7205 /**7206 * Loads the guest state into the VMCS guest-state area.7207 *7208 * @returns VBox status code.7209 * @param pVM Pointer to the VM.7210 * @param pVCpu Pointer to the VMCPU.7211 * @param pMixedCtx Pointer to the guest-CPU context. The data may be7212 * out-of-sync. Make sure to update the required fields7213 * before using them.7214 *7215 * @remarks No-long-jump zone!!!7216 */7217 VMMR0DECL(int) VMXR0LoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)7218 {7219 /*7220 * Avoid reloading the guest state on longjmp reentrants and do it lazily just before executing the guest.7221 * When thread-context hooks are not used: This only helps when we get rescheduled more than once to a7222 * different host CPU on a longjmp trip before finally executing guest code.7223 *7224 * When thread-context hooks are used: We avoid loading the guest state here for the above reason plus7225 * we can avoid doing it while preemption is disabled (which it is here).7226 */7227 return VINF_SUCCESS;7228 7202 } 7229 7203 -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.h
r47771 r48153 30 30 31 31 VMMR0DECL(int) VMXR0Enter(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pCpu); 32 VMMR0DECL(int) VMXR0Leave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);33 32 VMMR0DECL(void) VMXR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit); 34 33 VMMR0DECL(int) VMXR0EnableCpu(PHMGLOBALCPUINFO pCpu, PVM pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys, bool fEnabledBySystem); … … 40 39 VMMR0DECL(int) VMXR0SetupVM(PVM pVM); 41 40 VMMR0DECL(int) VMXR0SaveHostState(PVM pVM, PVMCPU pVCpu); 42 VMMR0DECL(int) VMXR0LoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);43 41 VMMR0DECL(int) VMXR0RunGuestCode(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx); 44 42 DECLASM(int) VMXR0StartVM32(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu);
Note:
See TracChangeset
for help on using the changeset viewer.