Changeset 20071 in vbox
- Timestamp:
- May 27, 2009 12:07:38 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
include/VBox/em.h (modified) (1 diff)
-
src/VBox/VMM/EM.cpp (modified) (11 diffs)
-
src/VBox/VMM/PGMPhys.cpp (modified) (2 diffs)
-
src/recompiler/VBoxREMWrapper.cpp (modified) (2 diffs)
-
src/recompiler/VBoxRecompiler.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/em.h
r19693 r20071 183 183 184 184 VMMR3DECL(void) EMR3ReleaseOwnedLocks(PVM pVM); 185 VMMR3DECL(void) EMR3RemUnlock(PVM pVM); 186 VMMR3DECL(void) EMR3RemLock(PVM pVM); 185 187 186 188 /** -
trunk/src/VBox/VMM/EM.cpp
r20040 r20071 109 109 static int emR3SingleStepExecRem(PVM pVM, uint32_t cIterations); 110 110 static EMSTATE emR3Reschedule(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx); 111 static void emR3RemLock(PVM pVM);112 static void emR3RemUnlock(PVM pVM);113 111 114 112 /** … … 872 870 * @param pVM VM handle. 873 871 */ 874 static void emR3RemLock(PVM pVM)872 VMMR3DECL(void) EMR3RemLock(PVM pVM) 875 873 { 876 874 int rc = PDMCritSectEnter(&pVM->em.s.CritSectREM, VERR_SEM_BUSY); … … 883 881 * @param pVM VM handle. 884 882 */ 885 static void emR3RemUnlock(PVM pVM)883 VMMR3DECL(void) EMR3RemUnlock(PVM pVM) 886 884 { 887 885 PDMCritSectLeave(&pVM->em.s.CritSectREM); … … 901 899 LogFlow(("emR3RemStep: cs:eip=%04x:%08x\n", CPUMGetGuestCS(pVCpu), CPUMGetGuestEIP(pVCpu))); 902 900 903 emR3RemLock(pVM);901 EMR3RemLock(pVM); 904 902 905 903 /* … … 912 910 REMR3StateBack(pVM, pVCpu); 913 911 } 914 emR3RemUnlock(pVM);912 EMR3RemUnlock(pVM); 915 913 916 914 LogFlow(("emR3RemStep: returns %Rrc cs:eip=%04x:%08x\n", rc, CPUMGetGuestCS(pVCpu), CPUMGetGuestEIP(pVCpu))); … … 954 952 955 953 /* Big lock, but you are not supposed to own any lock when coming in here. */ 956 emR3RemLock(pVM);954 EMR3RemLock(pVM); 957 955 958 956 /* … … 1077 1075 STAM_PROFILE_STOP(&pVCpu->em.s.StatREMSync, e); 1078 1076 } 1079 emR3RemUnlock(pVM);1077 EMR3RemUnlock(pVM); 1080 1078 1081 1079 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatREMTotal, a); … … 1482 1480 STAM_PROFILE_START(&pVCpu->em.s.StatREMEmu, a); 1483 1481 Log(("EMINS: %04x:%RGv RSP=%RGv\n", pCtx->cs, (RTGCPTR)pCtx->rip, (RTGCPTR)pCtx->rsp)); 1484 emR3RemLock(pVM);1482 EMR3RemLock(pVM); 1485 1483 /* Flush the recompiler TLB if the VCPU has changed. */ 1486 1484 if (pVM->em.s.idLastRemCpu != pVCpu->idCpu) … … 1489 1487 1490 1488 rc = REMR3EmulateInstruction(pVM, pVCpu); 1491 emR3RemUnlock(pVM);1489 EMR3RemUnlock(pVM); 1492 1490 STAM_PROFILE_STOP(&pVCpu->em.s.StatREMEmu, a); 1493 1491 … … 2497 2495 case VERR_REM_FLUSHED_PAGES_OVERFLOW: 2498 2496 Assert((pCtx->ss & X86_SEL_RPL) != 1); 2499 emR3RemLock(pVM);2497 EMR3RemLock(pVM); 2500 2498 REMR3ReplayInvalidatedPages(pVM, pVCpu); 2501 emR3RemUnlock(pVM);2499 EMR3RemUnlock(pVM); 2502 2500 rc = VINF_SUCCESS; 2503 2501 break; … … 3450 3448 if (VM_FF_IS_PENDING_EXCEPT(pVM, VM_FF_REM_HANDLER_NOTIFY, VM_FF_PGM_NO_MEMORY)) 3451 3449 { 3452 emR3RemLock(pVM);3450 EMR3RemLock(pVM); 3453 3451 REMR3ReplayHandlerNotifications(pVM); 3454 emR3RemUnlock(pVM);3452 EMR3RemUnlock(pVM); 3455 3453 } 3456 3454 -
trunk/src/VBox/VMM/PGMPhys.cpp
r19861 r20071 1841 1841 } 1842 1842 GMMR3FreePagesCleanup(pReq); 1843 pgmUnlock(pVM); 1843 1844 } 1844 1845 else … … 1846 1847 /* link in the ram range */ 1847 1848 pgmR3PhysLinkRamRange(pVM, &pCur->RamRange, pRamPrev); 1849 pgmUnlock(pVM); 1848 1850 REMR3NotifyPhysRamRegister(pVM, GCPhys, pCur->RamRange.cb, REM_NOTIFY_PHYS_RAM_FLAGS_MMIO2); 1849 1851 } 1850 1852 1851 pgmUnlock(pVM);1852 1853 1853 1854 return VINF_SUCCESS; -
trunk/src/recompiler/VBoxREMWrapper.cpp
r20002 r20071 1107 1107 { "DISInstr", (void *)(uintptr_t)&DISInstr, &g_aArgsDISInstr[0], RT_ELEMENTS(g_aArgsDISInstr), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL }, 1108 1108 { "EMR3FatalError", (void *)(uintptr_t)&EMR3FatalError, &g_aArgsEMR3FatalError[0], RT_ELEMENTS(g_aArgsEMR3FatalError), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1109 { "EMR3RemLock", (void *)(uintptr_t)&EMR3RemLock, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1110 { "EMR3RemUnlock", (void *)(uintptr_t)&EMR3RemUnlock, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1109 1111 { "HWACCMR3CanExecuteGuest", (void *)(uintptr_t)&HWACCMR3CanExecuteGuest, &g_aArgsHWACCMR3CanExecuteGuest[0], RT_ELEMENTS(g_aArgsHWACCMR3CanExecuteGuest), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1110 1112 { "IOMIOPortRead", (void *)(uintptr_t)&IOMIOPortRead, &g_aArgsIOMIOPortRead[0], RT_ELEMENTS(g_aArgsIOMIOPortRead), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, … … 1150 1152 { "PGMR3PhysWriteU64", (void *)(uintptr_t)&PGMR3PhysWriteU64, &g_aArgsPGMR3PhysWriteU64[0], RT_ELEMENTS(g_aArgsPGMR3PhysWriteU32), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1151 1153 { "PGMR3PhysTlbGCPhys2Ptr", (void *)(uintptr_t)&PGMR3PhysTlbGCPhys2Ptr, &g_aArgsPGMR3PhysTlbGCPhys2Ptr[0], RT_ELEMENTS(g_aArgsPGMR3PhysTlbGCPhys2Ptr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1154 { "PGMIsLockOwner", (void *)(uintptr_t)&PGMIsLockOwner, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL }, 1152 1155 { "SSMR3GetGCPtr", (void *)(uintptr_t)&SSMR3GetGCPtr, &g_aArgsSSMR3GetGCPtr[0], RT_ELEMENTS(g_aArgsSSMR3GetGCPtr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1153 1156 { "SSMR3GetMem", (void *)(uintptr_t)&SSMR3GetMem, &g_aArgsSSMR3GetMem[0], RT_ELEMENTS(g_aArgsSSMR3GetMem), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, -
trunk/src/recompiler/VBoxRecompiler.c
r20002 r20071 2839 2839 Assert(RT_ALIGN_Z(cb, PAGE_SIZE) == cb); 2840 2840 AssertMsg(fFlags == REM_NOTIFY_PHYS_RAM_FLAGS_RAM || fFlags == REM_NOTIFY_PHYS_RAM_FLAGS_MMIO2, ("#x\n", fFlags)); 2841 Assert(!PGMIsLockOwner(pVM)); 2842 2843 EMR3RemLock(pVM); 2841 2844 2842 2845 /* … … 2861 2864 Assert(pVM->rem.s.fIgnoreAll); 2862 2865 pVM->rem.s.fIgnoreAll = false; 2866 EMR3RemUnlock(pVM); 2863 2867 } 2864 2868 … … 2886 2890 Assert(cb); 2887 2891 Assert(RT_ALIGN_Z(cb, PAGE_SIZE) == cb); 2888 2892 Assert(!PGMIsLockOwner(pVM)); 2893 2894 EMR3RemLock(pVM); 2889 2895 /* 2890 2896 * Register the rom. … … 2897 2903 Assert(pVM->rem.s.fIgnoreAll); 2898 2904 pVM->rem.s.fIgnoreAll = false; 2905 EMR3RemUnlock(pVM); 2899 2906 } 2900 2907 … … 2918 2925 Assert(cb); 2919 2926 Assert(RT_ALIGN_Z(cb, PAGE_SIZE) == cb); 2927 Assert(!PGMIsLockOwner(pVM)); 2928 2929 EMR3RemLock(pVM); 2920 2930 2921 2931 /* … … 2929 2939 Assert(pVM->rem.s.fIgnoreAll); 2930 2940 pVM->rem.s.fIgnoreAll = false; 2941 EMR3RemUnlock(pVM); 2931 2942 } 2932 2943 … … 2951 2962 Assert(RT_ALIGN_T(GCPhys, PAGE_SIZE, RTGCPHYS) == GCPhys); 2952 2963 Assert(RT_ALIGN_T(cb, PAGE_SIZE, RTGCPHYS) == cb); 2953 2964 Assert(!PGMIsLockOwner(pVM)); 2965 2966 EMR3RemLock(pVM); 2954 2967 if (pVM->rem.s.cHandlerNotifications) 2955 2968 REMR3ReplayHandlerNotifications(pVM); … … 2965 2978 Assert(pVM->rem.s.fIgnoreAll); 2966 2979 pVM->rem.s.fIgnoreAll = false; 2980 EMR3RemUnlock(pVM); 2967 2981 } 2968 2982 … … 2983 2997 enmType, GCPhys, cb, fHasHCHandler, fRestoreAsRAM, MMR3PhysGetRamSize(pVM))); 2984 2998 VM_ASSERT_EMT(pVM); 2999 Assert(!PGMIsLockOwner(pVM)); 3000 3001 EMR3RemLock(pVM); 2985 3002 2986 3003 if (pVM->rem.s.cHandlerNotifications) … … 3010 3027 Assert(pVM->rem.s.fIgnoreAll); 3011 3028 pVM->rem.s.fIgnoreAll = false; 3029 EMR3RemUnlock(pVM); 3012 3030 } 3013 3031 … … 3030 3048 VM_ASSERT_EMT(pVM); 3031 3049 AssertReleaseMsg(enmType != PGMPHYSHANDLERTYPE_MMIO, ("enmType=%d\n", enmType)); 3050 Assert(!PGMIsLockOwner(pVM)); 3051 3052 EMR3RemLock(pVM); 3032 3053 3033 3054 if (pVM->rem.s.cHandlerNotifications) … … 3062 3083 pVM->rem.s.fIgnoreAll = false; 3063 3084 } 3085 EMR3RemUnlock(pVM); 3064 3086 } 3065 3087
Note:
See TracChangeset
for help on using the changeset viewer.

