Changeset 81153 in vbox for trunk/src/VBox
- Timestamp:
- Oct 8, 2019 1:59:03 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 133787
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/Config.kmk
r80309 r81153 46 46 #endif 47 47 # part of global DEFS 48 #ifdef VBOX_WITH_REM49 # VMM_COMMON_DEFS += VBOX_WITH_REM50 #endif51 48 ifdef VBOX_WITH_MULTI_CORE 52 49 VMM_COMMON_DEFS += VBOX_WITH_MULTI_CORE -
trunk/src/VBox/VMM/Makefile.kmk
r80938 r81153 225 225 VMMAll/PDMAllNetShaper.cpp 226 226 endif 227 ifdef VBOX_WITH_REM228 VBoxVMM_SOURCES += \229 VMMAll/REMAll.cpp230 endif231 227 232 228 ifdef VBOX_WITH_NATIVE_NEM … … 545 541 VMMAll/PDMAllNetShaper.cpp 546 542 endif 547 ifdef VBOX_WITH_REM548 VMMR0_SOURCES += \549 VMMAll/REMAll.cpp550 endif551 543 VMMR0_SOURCES.amd64 = \ 552 544 VMMR0/VMMR0JmpA-amd64.asm -
trunk/src/VBox/VMM/VMMAll/APICAll.cpp
r81150 r81153 3026 3026 } 3027 3027 #elif defined(IN_RING3) 3028 # ifdef VBOX_WITH_REM3029 REMR3NotifyInterruptSet(pVCpu->CTX_SUFF(pVM), pVCpu);3030 # endif3031 3028 if (enmType != PDMAPICIRQ_HARDWARE) 3032 3029 VMR3NotifyCpuFFU(pVCpu->pUVCpu, VMNOTIFYFF_FLAGS_DONE_REM | VMNOTIFYFF_FLAGS_POKE); … … 3057 3054 break; 3058 3055 } 3059 3060 #if defined(IN_RING3) && defined(VBOX_WITH_REM)3061 REMR3NotifyInterruptClear(pVCpu->CTX_SUFF(pVM), pVCpu);3062 #endif3063 3056 } 3064 3057 -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r80333 r81153 888 888 889 889 /** 890 * Locks REM execution to a single VCPU.891 *892 * @param pVM The cross context VM structure.893 */894 VMMDECL(void) EMRemLock(PVM pVM)895 {896 #ifdef VBOX_WITH_REM897 if (!PDMCritSectIsInitialized(&pVM->em.s.CritSectREM))898 return; /* early init */899 900 Assert(!PGMIsLockOwner(pVM));901 Assert(!IOMIsLockWriteOwner(pVM));902 int rc = PDMCritSectEnter(&pVM->em.s.CritSectREM, VERR_SEM_BUSY);903 AssertRCSuccess(rc);904 #else905 RT_NOREF(pVM);906 #endif907 }908 909 910 /**911 * Unlocks REM execution912 *913 * @param pVM The cross context VM structure.914 */915 VMMDECL(void) EMRemUnlock(PVM pVM)916 {917 #ifdef VBOX_WITH_REM918 if (!PDMCritSectIsInitialized(&pVM->em.s.CritSectREM))919 return; /* early init */920 921 PDMCritSectLeave(&pVM->em.s.CritSectREM);922 #else923 RT_NOREF(pVM);924 #endif925 }926 927 928 /**929 * Check if this VCPU currently owns the REM lock.930 *931 * @returns bool owner/not owner932 * @param pVM The cross context VM structure.933 */934 VMMDECL(bool) EMRemIsLockOwner(PVM pVM)935 {936 #ifdef VBOX_WITH_REM937 if (!PDMCritSectIsInitialized(&pVM->em.s.CritSectREM))938 return true; /* early init */939 940 return PDMCritSectIsOwner(&pVM->em.s.CritSectREM);941 #else942 RT_NOREF(pVM);943 return true;944 #endif945 }946 947 948 /**949 * Try to acquire the REM lock.950 *951 * @returns VBox status code952 * @param pVM The cross context VM structure.953 */954 VMM_INT_DECL(int) EMRemTryLock(PVM pVM)955 {956 #ifdef VBOX_WITH_REM957 if (!PDMCritSectIsInitialized(&pVM->em.s.CritSectREM))958 return VINF_SUCCESS; /* early init */959 960 return PDMCritSectTryEnter(&pVM->em.s.CritSectREM);961 #else962 RT_NOREF(pVM);963 return VINF_SUCCESS;964 #endif965 }966 967 968 /**969 890 * @callback_method_impl{FNDISREADBYTES} 970 891 */ … … 1012 933 1013 934 1014 1015 935 /** 1016 936 * Disassembles the current instruction. -
trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
r80333 r81153 850 850 851 851 852 #if defined(IN_RING3) && defined(VBOX_WITH_REM) /* Only used by REM. */853 854 /**855 * Reads a MMIO register.856 *857 * @returns VBox status code.858 *859 * @param pVM The cross context VM structure.860 * @param pVCpu The cross context virtual CPU structure of the calling EMT.861 * @param GCPhys The physical address to read.862 * @param pu32Value Where to store the value read.863 * @param cbValue The size of the register to read in bytes. 1, 2 or 4 bytes.864 */865 VMMDECL(VBOXSTRICTRC) IOMMMIORead(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, uint32_t *pu32Value, size_t cbValue)866 {867 Assert(pVCpu->iom.s.PendingMmioWrite.cbValue == 0);868 /* Take the IOM lock before performing any MMIO. */869 VBOXSTRICTRC rc = IOM_LOCK_SHARED(pVM);870 #ifndef IN_RING3871 if (rc == VERR_SEM_BUSY)872 return VINF_IOM_R3_MMIO_WRITE;873 #endif874 AssertRC(VBOXSTRICTRC_VAL(rc));875 876 /*877 * Lookup the current context range node and statistics.878 */879 PIOMMMIORANGE pRange = iomMmioGetRange(pVM, pVCpu, GCPhys);880 if (!pRange)881 {882 AssertMsgFailed(("Handlers and page tables are out of sync or something! GCPhys=%RGp cbValue=%d\n", GCPhys, cbValue));883 IOM_UNLOCK_SHARED(pVM);884 return VERR_IOM_MMIO_RANGE_NOT_FOUND;885 }886 iomMmioRetainRange(pRange);887 #ifndef VBOX_WITH_STATISTICS888 IOM_UNLOCK_SHARED(pVM);889 890 #else /* VBOX_WITH_STATISTICS */891 PIOMMMIOSTATS pStats = iomMmioGetStats(pVM, pVCpu, GCPhys, pRange);892 if (!pStats)893 {894 iomMmioReleaseRange(pVM, pRange);895 # ifdef IN_RING3896 return VERR_NO_MEMORY;897 # else898 return VINF_IOM_R3_MMIO_READ;899 # endif900 }901 STAM_COUNTER_INC(&pStats->Accesses);902 #endif /* VBOX_WITH_STATISTICS */903 904 if (pRange->CTX_SUFF(pfnReadCallback))905 {906 /*907 * Perform locking.908 */909 PPDMDEVINS pDevIns = pRange->CTX_SUFF(pDevIns);910 rc = PDMCritSectEnter(pDevIns->CTX_SUFF(pCritSectRo), VINF_IOM_R3_MMIO_WRITE);911 if (rc != VINF_SUCCESS)912 {913 iomMmioReleaseRange(pVM, pRange);914 return rc;915 }916 917 /*918 * Perform the read and deal with the result.919 */920 STAM_PROFILE_START(&pStats->CTX_SUFF_Z(ProfRead), a);921 if ( (cbValue == 4 && !(GCPhys & 3))922 || (pRange->fFlags & IOMMMIO_FLAGS_READ_MODE) == IOMMMIO_FLAGS_READ_PASSTHRU923 || (cbValue == 8 && !(GCPhys & 7)) )924 rc = pRange->CTX_SUFF(pfnReadCallback)(pRange->CTX_SUFF(pDevIns), pRange->CTX_SUFF(pvUser), GCPhys,925 pu32Value, (unsigned)cbValue);926 else927 rc = iomMMIODoComplicatedRead(pVM, pRange, GCPhys, pu32Value, (unsigned)cbValue);928 STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfRead), a);929 switch (VBOXSTRICTRC_VAL(rc))930 {931 case VINF_SUCCESS:932 Log4(("IOMMMIORead: GCPhys=%RGp *pu32=%08RX32 cb=%d rc=VINF_SUCCESS\n", GCPhys, *pu32Value, cbValue));933 PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo));934 iomMmioReleaseRange(pVM, pRange);935 return rc;936 #ifndef IN_RING3937 case VINF_IOM_R3_MMIO_READ:938 case VINF_IOM_R3_MMIO_READ_WRITE:939 STAM_COUNTER_INC(&pStats->CTX_MID_Z(Read,ToR3));940 #endif941 default:942 Log4(("IOMMMIORead: GCPhys=%RGp *pu32=%08RX32 cb=%d rc=%Rrc\n", GCPhys, *pu32Value, cbValue, VBOXSTRICTRC_VAL(rc)));943 PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo));944 iomMmioReleaseRange(pVM, pRange);945 return rc;946 947 case VINF_IOM_MMIO_UNUSED_00:948 iomMMIODoRead00s(pu32Value, cbValue);949 Log4(("IOMMMIORead: GCPhys=%RGp *pu32=%08RX32 cb=%d rc=%Rrc\n", GCPhys, *pu32Value, cbValue, VBOXSTRICTRC_VAL(rc)));950 PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo));951 iomMmioReleaseRange(pVM, pRange);952 return VINF_SUCCESS;953 954 case VINF_IOM_MMIO_UNUSED_FF:955 iomMMIODoReadFFs(pu32Value, cbValue);956 Log4(("IOMMMIORead: GCPhys=%RGp *pu32=%08RX32 cb=%d rc=%Rrc\n", GCPhys, *pu32Value, cbValue, VBOXSTRICTRC_VAL(rc)));957 PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo));958 iomMmioReleaseRange(pVM, pRange);959 return VINF_SUCCESS;960 }961 /* not reached */962 }963 #ifndef IN_RING3964 if (pRange->pfnReadCallbackR3)965 {966 STAM_COUNTER_INC(&pStats->CTX_MID_Z(Read,ToR3));967 iomMmioReleaseRange(pVM, pRange);968 return VINF_IOM_R3_MMIO_READ;969 }970 #endif971 972 /*973 * Unassigned memory - this is actually not supposed t happen...974 */975 STAM_PROFILE_START(&pStats->CTX_SUFF_Z(ProfRead), a); /** @todo STAM_PROFILE_ADD_ZERO_PERIOD */976 STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfRead), a);977 iomMMIODoReadFFs(pu32Value, cbValue);978 Log4(("IOMMMIORead: GCPhys=%RGp *pu32=%08RX32 cb=%d rc=VINF_SUCCESS\n", GCPhys, *pu32Value, cbValue));979 iomMmioReleaseRange(pVM, pRange);980 return VINF_SUCCESS;981 }982 983 984 /**985 * Writes to a MMIO register.986 *987 * @returns VBox status code.988 *989 * @param pVM The cross context VM structure.990 * @param pVCpu The cross context virtual CPU structure of the calling EMT.991 * @param GCPhys The physical address to write to.992 * @param u32Value The value to write.993 * @param cbValue The size of the register to read in bytes. 1, 2 or 4 bytes.994 */995 VMMDECL(VBOXSTRICTRC) IOMMMIOWrite(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, uint32_t u32Value, size_t cbValue)996 {997 Assert(pVCpu->iom.s.PendingMmioWrite.cbValue == 0);998 /* Take the IOM lock before performing any MMIO. */999 VBOXSTRICTRC rc = IOM_LOCK_SHARED(pVM);1000 #ifndef IN_RING31001 if (rc == VERR_SEM_BUSY)1002 return VINF_IOM_R3_MMIO_WRITE;1003 #endif1004 AssertRC(VBOXSTRICTRC_VAL(rc));1005 1006 /*1007 * Lookup the current context range node.1008 */1009 PIOMMMIORANGE pRange = iomMmioGetRange(pVM, pVCpu, GCPhys);1010 if (!pRange)1011 {1012 AssertMsgFailed(("Handlers and page tables are out of sync or something! GCPhys=%RGp cbValue=%d\n", GCPhys, cbValue));1013 IOM_UNLOCK_SHARED(pVM);1014 return VERR_IOM_MMIO_RANGE_NOT_FOUND;1015 }1016 iomMmioRetainRange(pRange);1017 #ifndef VBOX_WITH_STATISTICS1018 IOM_UNLOCK_SHARED(pVM);1019 1020 #else /* VBOX_WITH_STATISTICS */1021 PIOMMMIOSTATS pStats = iomMmioGetStats(pVM, pVCpu, GCPhys, pRange);1022 if (!pStats)1023 {1024 iomMmioReleaseRange(pVM, pRange);1025 # ifdef IN_RING31026 return VERR_NO_MEMORY;1027 # else1028 return VINF_IOM_R3_MMIO_WRITE;1029 # endif1030 }1031 STAM_COUNTER_INC(&pStats->Accesses);1032 #endif /* VBOX_WITH_STATISTICS */1033 1034 if (pRange->CTX_SUFF(pfnWriteCallback))1035 {1036 /*1037 * Perform locking.1038 */1039 PPDMDEVINS pDevIns = pRange->CTX_SUFF(pDevIns);1040 rc = PDMCritSectEnter(pDevIns->CTX_SUFF(pCritSectRo), VINF_IOM_R3_MMIO_READ);1041 if (rc != VINF_SUCCESS)1042 {1043 iomMmioReleaseRange(pVM, pRange);1044 return rc;1045 }1046 1047 /*1048 * Perform the write.1049 */1050 STAM_PROFILE_START(&pStats->CTX_SUFF_Z(ProfWrite), a);1051 if ( (cbValue == 4 && !(GCPhys & 3))1052 || (pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) == IOMMMIO_FLAGS_WRITE_PASSTHRU1053 || (cbValue == 8 && !(GCPhys & 7)) )1054 rc = pRange->CTX_SUFF(pfnWriteCallback)(pRange->CTX_SUFF(pDevIns), pRange->CTX_SUFF(pvUser),1055 GCPhys, &u32Value, (unsigned)cbValue);1056 else1057 rc = iomMMIODoComplicatedWrite(pVM, pVCpu, pRange, GCPhys, &u32Value, (unsigned)cbValue);1058 STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfWrite), a);1059 #ifndef IN_RING31060 if ( rc == VINF_IOM_R3_MMIO_WRITE1061 || rc == VINF_IOM_R3_MMIO_READ_WRITE)1062 STAM_COUNTER_INC(&pStats->CTX_MID_Z(Write,ToR3));1063 #endif1064 Log4(("IOMMMIOWrite: GCPhys=%RGp u32=%08RX32 cb=%d rc=%Rrc\n", GCPhys, u32Value, cbValue, VBOXSTRICTRC_VAL(rc)));1065 iomMmioReleaseRange(pVM, pRange);1066 PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo));1067 return rc;1068 }1069 #ifndef IN_RING31070 if (pRange->pfnWriteCallbackR3)1071 {1072 STAM_COUNTER_INC(&pStats->CTX_MID_Z(Write,ToR3));1073 iomMmioReleaseRange(pVM, pRange);1074 return VINF_IOM_R3_MMIO_WRITE;1075 }1076 #endif1077 1078 /*1079 * No write handler, nothing to do.1080 */1081 STAM_PROFILE_START(&pStats->CTX_SUFF_Z(ProfWrite), a);1082 STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfWrite), a);1083 Log4(("IOMMMIOWrite: GCPhys=%RGp u32=%08RX32 cb=%d rc=%Rrc\n", GCPhys, u32Value, cbValue, VINF_SUCCESS));1084 iomMmioReleaseRange(pVM, pRange);1085 return VINF_SUCCESS;1086 }1087 1088 #endif /* IN_RING3 - only used by REM. */1089 1090 852 /** 1091 853 * Mapping an MMIO2 page in place of an MMIO page for direct access. -
trunk/src/VBox/VMM/VMMAll/PDMAllQueue.cpp
r81150 r81153 76 76 ASMAtomicBitSet(&pVM->pdm.s.fQueueFlushing, PDM_QUEUE_FLUSH_FLAG_PENDING_BIT); 77 77 #ifdef IN_RING3 78 # ifdef VBOX_WITH_REM79 REMR3NotifyQueuePending(pVM); /** @todo r=bird: we can remove REMR3NotifyQueuePending and let VMR3NotifyFF do the work. */80 # endif81 78 VMR3NotifyGlobalFFU(pVM->pUVM, VMNOTIFYFF_FLAGS_DONE_REM); 82 79 #endif -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r81150 r81153 1218 1218 Log3(("PGMInvalidatePage: GCPtrPage=%RGv\n", GCPtrPage)); 1219 1219 1220 #if !defined(IN_RING3) && defined(VBOX_WITH_REM)1221 /*1222 * Notify the recompiler so it can record this instruction.1223 */1224 REMNotifyInvalidatePage(pVM, GCPtrPage);1225 #endif1226 1220 IEMTlbInvalidatePage(pVCpu, GCPtrPage); 1227 1221 -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r81150 r81153 287 287 pgmUnlock(pVM); 288 288 289 #ifdef VBOX_WITH_REM290 # ifndef IN_RING3291 REMNotifyHandlerPhysicalRegister(pVM, pType->enmKind, GCPhys, GCPhysLast - GCPhys + 1, !!pType->pfnHandlerR3);292 # else293 REMR3NotifyHandlerPhysicalRegister(pVM, pType->enmKind, GCPhys, GCPhysLast - GCPhys + 1, !!pType->pfnHandlerR3);294 # endif295 #endif296 289 if (rc != VINF_SUCCESS) 297 290 Log(("PGMHandlerPhysicalRegisterEx: returns %Rrc (%RGp-%RGp)\n", rc, GCPhys, GCPhysLast)); … … 611 604 const bool fRestoreAsRAM2 = pCurType->pfnHandlerR3 612 605 && pCurType->enmKind != PGMPHYSHANDLERKIND_MMIO; /** @todo this isn't entirely correct. */ 613 #ifdef VBOX_WITH_REM614 # ifndef IN_RING3615 REMNotifyHandlerPhysicalDeregister(pVM, pCurType->enmKind, GCPhysStart, GCPhysLast - GCPhysStart + 1,616 !!pCurType->pfnHandlerR3, fRestoreAsRAM2);617 # else618 REMR3NotifyHandlerPhysicalDeregister(pVM, pCurType->enmKind, GCPhysStart, GCPhysLast - GCPhysStart + 1,619 !!pCurType->pfnHandlerR3, fRestoreAsRAM2);620 # endif621 #endif622 606 /** @todo do we need this notification? */ 623 607 NEMHCNotifyHandlerPhysicalDeregister(pVM, pCurType->enmKind, GCPhysStart, GCPhysLast - GCPhysStart + 1, … … 883 867 RTGCPHYS const cb = GCPhysLast - GCPhys + 1; 884 868 PGMPHYSHANDLERKIND const enmKind = pCurType->enmKind; 885 #ifdef VBOX_WITH_REM886 bool const fHasHCHandler = !!pCurType->pfnHandlerR3;887 #endif888 869 889 870 /* … … 897 878 pgmUnlock(pVM); 898 879 899 #ifdef VBOX_WITH_REM900 # ifndef IN_RING3901 REMNotifyHandlerPhysicalModify(pVM, enmKind, GCPhysCurrent, GCPhys, cb,902 fHasHCHandler, fRestoreAsRAM);903 # else904 REMR3NotifyHandlerPhysicalModify(pVM, enmKind, GCPhysCurrent, GCPhys, cb,905 fHasHCHandler, fRestoreAsRAM);906 # endif907 #endif908 880 PGM_INVL_ALL_VCPU_TLBS(pVM); 909 881 Log(("PGMHandlerPhysicalModify: GCPhysCurrent=%RGp -> GCPhys=%RGp GCPhysLast=%RGp\n", … … 1712 1684 State.cErrors++; 1713 1685 } 1714 1715 # ifdef VBOX_WITH_REM1716 # ifdef IN_RING31717 /* validate that REM is handling it. */1718 if ( !REMR3IsPageAccessHandled(pVM, State.GCPhys)1719 /* ignore shadowed ROM for the time being. */1720 && PGM_PAGE_GET_TYPE(pPage) != PGMPAGETYPE_ROM_SHADOW)1721 {1722 AssertMsgFailed(("ram range vs phys handler REM mismatch. GCPhys=%RGp state=%d %s\n",1723 State.GCPhys, PGM_PAGE_GET_HNDL_PHYS_STATE(pPage), pPhysType->pszDesc));1724 State.cErrors++;1725 }1726 # endif1727 # endif1728 1686 } 1729 1687 else -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r81150 r81153 670 670 Assert(VM_FF_IS_SET(pVM, VM_FF_PGM_NEED_HANDY_PAGES)); 671 671 Assert(VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)); 672 #ifdef IN_RING3 673 # ifdef VBOX_WITH_REM 674 REMR3NotifyFF(pVM); 675 # endif 676 #else 672 #ifndef IN_RING3 677 673 VMCPU_FF_SET(VMMGetCpu(pVM), VMCPU_FF_TO_R3); /* paranoia */ 678 674 #endif -
trunk/src/VBox/VMM/VMMAll/TMAll.cpp
r81150 r81153 291 291 VMCPU_FF_SET(pVCpuDst, VMCPU_FF_TIMER); 292 292 #ifdef IN_RING3 293 # ifdef VBOX_WITH_REM294 REMR3NotifyTimerPending(pVM, pVCpuDst);295 # endif296 293 VMR3NotifyCpuFFU(pVCpuDst->pUVCpu, VMNOTIFYFF_FLAGS_DONE_REM); 297 294 #endif … … 833 830 Log5(("TMAll(%u): FF: %d -> 1\n", __LINE__, VMCPU_FF_IS_SET(pVCpuDst, VMCPU_FF_TIMER))); 834 831 VMCPU_FF_SET(pVCpuDst, VMCPU_FF_TIMER); 835 #if defined(IN_RING3) && defined(VBOX_WITH_REM)836 REMR3NotifyTimerPending(pVM, pVCpuDst);837 #endif838 832 } 839 833 LogFlow(("TMTimerPoll: expire1=%'RU64 <= now=%'RU64\n", u64Expire1, u64Now)); … … 879 873 Log5(("TMAll(%u): FF: %d -> 1\n", __LINE__, VMCPU_FF_IS_SET(pVCpuDst, VMCPU_FF_TIMER))); 880 874 VMCPU_FF_SET(pVCpuDst, VMCPU_FF_TIMER); 881 #if defined(IN_RING3) && defined(VBOX_WITH_REM)882 REMR3NotifyTimerPending(pVM, pVCpuDst);883 #endif884 875 } 885 876 … … 978 969 Log5(("TMAll(%u): FF: %d -> 1\n", __LINE__, VMCPU_FF_IS_SET(pVCpuDst, VMCPU_FF_TIMER))); 979 970 VMCPU_FF_SET(pVCpuDst, VMCPU_FF_TIMER); 980 #if defined(IN_RING3) && defined(VBOX_WITH_REM)981 REMR3NotifyTimerPending(pVM, pVCpuDst);982 #endif983 971 } 984 972 STAM_COUNTER_INC(&pVM->tm.s.StatPollVirtualSync); -
trunk/src/VBox/VMM/VMMAll/TMAllVirtual.cpp
r81150 r81153 251 251 VMCPU_FF_SET(pVCpuDst, VMCPU_FF_TIMER); 252 252 #ifdef IN_RING3 253 # ifdef VBOX_WITH_REM254 REMR3NotifyTimerPending(pVM, pVCpuDst);255 # endif256 253 VMR3NotifyCpuFFU(pVCpuDst->pUVCpu, VMNOTIFYFF_FLAGS_DONE_REM); 257 254 #endif … … 412 409 *pcNsToDeadline = 0; 413 410 #ifdef IN_RING3 414 # ifdef VBOX_WITH_REM415 REMR3NotifyTimerPending(pVM, pVCpuDst);416 # endif417 411 VMR3NotifyCpuFFU(pVCpuDst->pUVCpu, VMNOTIFYFF_FLAGS_DONE_REM); 418 412 #endif … … 498 492 499 493 #ifdef IN_RING3 500 # ifdef VBOX_WITH_REM501 REMR3NotifyTimerPending(pVM, pVCpuDst);502 # endif503 494 VMR3NotifyCpuFFU(pVCpuDst->pUVCpu, VMNOTIFYFF_FLAGS_DONE_REM); 504 495 #endif … … 554 545 VMCPU_FF_SET(pVCpuDst, VMCPU_FF_TIMER); 555 546 #ifdef IN_RING3 556 # ifdef VBOX_WITH_REM557 REMR3NotifyTimerPending(pVM, pVCpuDst);558 # endif559 547 VMR3NotifyCpuFFU(pVCpuDst->pUVCpu, VMNOTIFYFF_FLAGS_DONE_REM /** @todo |VMNOTIFYFF_FLAGS_POKE*/); 560 548 #endif … … 724 712 VMCPU_FF_SET(pVCpuDst, VMCPU_FF_TIMER); 725 713 #ifdef IN_RING3 726 # ifdef VBOX_WITH_REM727 REMR3NotifyTimerPending(pVM, pVCpuDst);728 # endif729 714 VMR3NotifyCpuFFU(pVCpuDst->pUVCpu, VMNOTIFYFF_FLAGS_DONE_REM); 730 715 #endif -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r81150 r81153 6167 6167 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_GUEST_SREG_MASK) 6168 6168 { 6169 #ifdef VBOX_WITH_REM6170 if (!pVM->hm.s.vmx.fUnrestrictedGuest)6171 {6172 Assert(!pVmxTransient->fIsNestedGuest);6173 Assert(pVM->hm.s.vmx.pRealModeTSS);6174 AssertCompile(PGMMODE_REAL < PGMMODE_PROTECTED);6175 if ( pVmcsInfo->fWasInRealMode6176 && PGMGetGuestMode(pVCpu) >= PGMMODE_PROTECTED)6177 {6178 /*6179 * Notify the recompiler must flush its code-cache as the guest -may-6180 * rewrite code it in real-mode (e.g. OpenBSD 4.0).6181 */6182 REMFlushTBs(pVM);6183 Log4Func(("Switch to protected mode detected!\n"));6184 pVmcsInfo->fWasInRealMode = false;6185 }6186 }6187 #endif6188 6169 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_GUEST_CS) 6189 6170 { -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r81031 r81153 741 741 | VM_FF_DBGF | VM_FF_REQUEST | VM_FF_CHECK_VM_STATE 742 742 | VM_FF_RESET | VM_FF_EMT_RENDEZVOUS | VM_FF_PGM_NEED_HANDY_PAGES 743 | VM_FF_PGM_NO_MEMORY | VM_FF_ REM_HANDLER_NOTIFY | VM_FF_DEBUG_SUSPEND;743 | VM_FF_PGM_NO_MEMORY | VM_FF_DEBUG_SUSPEND; 744 744 uint64_t const fCpuFFs = VMCPU_FF_TIMER | VMCPU_FF_PDM_CRITSECT | VMCPU_FF_IEM 745 745 | VMCPU_FF_REQUEST | VMCPU_FF_DBGF | VMCPU_FF_HM_UPDATE_CR3 … … 1228 1228 STAM_COUNTER_INC(&pVM->vmm.s.StatRZCallPGMAllocHandy); 1229 1229 break; 1230 case VMMCALLRING3_REM_REPLAY_HANDLER_NOTIFICATIONS:1231 STAM_COUNTER_INC(&pVM->vmm.s.StatRZCallRemReplay);1232 break;1233 1230 case VMMCALLRING3_VMM_LOGGER_FLUSH: 1234 1231 STAM_COUNTER_INC(&pVM->vmm.s.StatRZCallLogFlush); -
trunk/src/VBox/VMM/VMMR3/DBGF.cpp
r81150 r81153 550 550 551 551 /* 552 * S ync back the state from the REM.552 * Set flag. 553 553 */ 554 554 dbgfR3EventSetStoppedInHyperFlag(pVM, enmEvent); 555 #ifdef VBOX_WITH_REM556 if (!pVM->dbgf.s.fStoppedInHyper)557 REMR3StateUpdate(pVM, pVCpu);558 #endif559 555 560 556 /* -
trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp
r81150 r81153 821 821 int rc = VINF_SUCCESS; 822 822 if (!pBp->fEnabled) 823 #ifdef VBOX_WITH_REM824 rc = REMR3BreakpointSet(pVM, pBp->u.Rem.GCPtr);825 #else826 823 rc = IEMBreakpointSet(pVM, pBp->u.Rem.GCPtr); 827 #endif828 824 if (RT_SUCCESS(rc)) 829 825 { … … 850 846 * Now ask REM to set the breakpoint. 851 847 */ 852 #ifdef VBOX_WITH_REM853 int rc = REMR3BreakpointSet(pVM, pAddress->FlatPtr);854 #else855 848 int rc = IEMBreakpointSet(pVM, pAddress->FlatPtr); 856 #endif857 849 if (RT_SUCCESS(rc)) 858 850 { … … 1171 1163 1172 1164 case DBGFBPTYPE_REM: 1173 #ifdef VBOX_WITH_REM1174 rc = REMR3BreakpointClear(pVM, pBp->u.Rem.GCPtr);1175 #else1176 1165 rc = IEMBreakpointClear(pVM, pBp->u.Rem.GCPtr); 1177 #endif1178 1166 break; 1179 1167 … … 1258 1246 1259 1247 case DBGFBPTYPE_REM: 1260 #ifdef VBOX_WITH_REM1261 rc = REMR3BreakpointSet(pVM, pBp->u.Rem.GCPtr);1262 #else1263 1248 rc = IEMBreakpointSet(pVM, pBp->u.Rem.GCPtr); 1264 #endif1265 1249 break; 1266 1250 … … 1341 1325 1342 1326 case DBGFBPTYPE_REM: 1343 #ifdef VBOX_WITH_REM1344 rc = REMR3BreakpointClear(pVM, pBp->u.Rem.GCPtr);1345 #else1346 1327 rc = IEMBreakpointClear(pVM, pBp->u.Rem.GCPtr); 1347 #endif1348 1328 break; 1349 1329 -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r81150 r81153 190 190 } 191 191 192 #ifdef VBOX_WITH_REM193 /*194 * Initialize the REM critical section.195 */196 AssertCompileMemberAlignment(EM, CritSectREM, sizeof(uintptr_t));197 rc = PDMR3CritSectInit(pVM, &pVM->em.s.CritSectREM, RT_SRC_POS, "EM-REM");198 AssertRCReturn(rc, rc);199 #endif200 201 192 /* 202 193 * Saved state. … … 424 415 VMMR3_INT_DECL(int) EMR3Term(PVM pVM) 425 416 { 426 #ifdef VBOX_WITH_REM427 PDMR3CritSectDelete(&pVM->em.s.CritSectREM);428 #else429 417 RT_NOREF(pVM); 430 #endif431 418 return VINF_SUCCESS; 432 419 } … … 834 821 else if (pVCpu->em.s.enmState == EMSTATE_DEBUG_GUEST_NEM) 835 822 rc = VBOXSTRICTRC_TODO(emR3NemSingleInstruction(pVM, pVCpu, 0 /*fFlags*/)); 836 #ifdef VBOX_WITH_REM 823 #ifdef VBOX_WITH_REM /** @todo fix me? */ 837 824 else if (pVCpu->em.s.enmState == EMSTATE_DEBUG_GUEST_REM) 838 825 rc = emR3RemStep(pVM, pVCpu); … … 1005 992 Log3(("emR3RemStep: cs:eip=%04x:%08x\n", CPUMGetGuestCS(pVCpu), CPUMGetGuestEIP(pVCpu))); 1006 993 1007 # ifdef VBOX_WITH_REM1008 EMRemLock(pVM);1009 1010 /*1011 * Switch to REM, step instruction, switch back.1012 */1013 int rc = REMR3State(pVM, pVCpu);1014 if (RT_SUCCESS(rc))1015 {1016 rc = REMR3Step(pVM, pVCpu);1017 REMR3StateBack(pVM, pVCpu);1018 }1019 EMRemUnlock(pVM);1020 1021 # else1022 994 int rc = VBOXSTRICTRC_TODO(IEMExecOne(pVCpu)); NOREF(pVM); 1023 # endif1024 995 1025 996 Log3(("emR3RemStep: returns %Rrc cs:eip=%04x:%08x\n", rc, CPUMGetGuestCS(pVCpu), CPUMGetGuestEIP(pVCpu))); … … 1027 998 } 1028 999 #endif /* VBOX_WITH_REM || DEBUG */ 1029 1030 1031 #ifdef VBOX_WITH_REM1032 /**1033 * emR3RemExecute helper that syncs the state back from REM and leave the REM1034 * critical section.1035 *1036 * @returns false - new fInREMState value.1037 * @param pVM The cross context VM structure.1038 * @param pVCpu The cross context virtual CPU structure.1039 */1040 DECLINLINE(bool) emR3RemExecuteSyncBack(PVM pVM, PVMCPU pVCpu)1041 {1042 STAM_PROFILE_START(&pVCpu->em.s.StatREMSync, a);1043 REMR3StateBack(pVM, pVCpu);1044 STAM_PROFILE_STOP(&pVCpu->em.s.StatREMSync, a);1045 1046 EMRemUnlock(pVM);1047 return false;1048 }1049 #endif1050 1000 1051 1001 … … 1088 1038 */ 1089 1039 *pfFFDone = false; 1090 #ifdef VBOX_WITH_REM1091 bool fInREMState = false;1092 #else1093 1040 uint32_t cLoops = 0; 1094 #endif1095 1041 int rc = VINF_SUCCESS; 1096 1042 for (;;) 1097 1043 { 1098 #ifdef VBOX_WITH_REM1099 /*1100 * Lock REM and update the state if not already in sync.1101 *1102 * Note! Big lock, but you are not supposed to own any lock when1103 * coming in here.1104 */1105 if (!fInREMState)1106 {1107 EMRemLock(pVM);1108 STAM_PROFILE_START(&pVCpu->em.s.StatREMSync, b);1109 1110 /* Flush the recompiler translation blocks if the VCPU has changed,1111 also force a full CPU state resync. */1112 if (pVM->em.s.idLastRemCpu != pVCpu->idCpu)1113 {1114 REMFlushTBs(pVM);1115 CPUMSetChangedFlags(pVCpu, CPUM_CHANGED_ALL);1116 }1117 pVM->em.s.idLastRemCpu = pVCpu->idCpu;1118 1119 rc = REMR3State(pVM, pVCpu);1120 1121 STAM_PROFILE_STOP(&pVCpu->em.s.StatREMSync, b);1122 if (RT_FAILURE(rc))1123 break;1124 fInREMState = true;1125 1126 /*1127 * We might have missed the raising of VMREQ, TIMER and some other1128 * important FFs while we were busy switching the state. So, check again.1129 */1130 if ( VM_FF_IS_ANY_SET(pVM, VM_FF_REQUEST | VM_FF_PDM_QUEUES | VM_FF_DBGF | VM_FF_CHECK_VM_STATE | VM_FF_RESET)1131 || VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_TIMER | VMCPU_FF_REQUEST))1132 {1133 LogFlow(("emR3RemExecute: Skipping run, because FF is set. %#x\n", pVM->fGlobalForcedActions));1134 goto l_REMDoForcedActions;1135 }1136 }1137 #endif1138 1139 1044 /* 1140 1045 * Execute REM. … … 1143 1048 { 1144 1049 STAM_PROFILE_START(&pVCpu->em.s.StatREMExec, c); 1145 #ifdef VBOX_WITH_REM1146 rc = REMR3Run(pVM, pVCpu);1147 #else1148 1050 rc = VBOXSTRICTRC_TODO(IEMExecLots(pVCpu, 8192 /*cMaxInstructions*/, 4095 /*cPollRate*/, NULL /*pcInstructions*/)); 1149 #endif1150 1051 STAM_PROFILE_STOP(&pVCpu->em.s.StatREMExec, c); 1151 1052 } … … 1165 1066 if ( VM_FF_IS_ANY_SET(pVM, VM_FF_HIGH_PRIORITY_POST_MASK) 1166 1067 || VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_HIGH_PRIORITY_POST_MASK)) 1167 {1168 #ifdef VBOX_WITH_REM1169 fInREMState = emR3RemExecuteSyncBack(pVM, pVCpu);1170 #endif1171 1068 rc = VBOXSTRICTRC_TODO(emR3HighPriorityPostForcedActions(pVM, pVCpu, rc)); 1172 }1173 1069 1174 1070 /* … … 1181 1077 if (rc != VINF_REM_INTERRUPED_FF) 1182 1078 { 1183 #ifndef VBOX_WITH_REM1184 1079 /* Try dodge unimplemented IEM trouble by reschduling. */ 1185 1080 if ( rc == VERR_IEM_ASPECT_NOT_IMPLEMENTED … … 1193 1088 } 1194 1089 } 1195 #endif1196 1090 1197 1091 /* … … 1218 1112 || VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_ALL_REM_MASK) ) 1219 1113 { 1220 #ifdef VBOX_WITH_REM1221 l_REMDoForcedActions:1222 if (fInREMState)1223 fInREMState = emR3RemExecuteSyncBack(pVM, pVCpu);1224 #endif1225 1114 STAM_REL_PROFILE_ADV_SUSPEND(&pVCpu->em.s.StatREMTotal, a); 1226 1115 rc = emR3ForcedActions(pVM, pVCpu, rc); … … 1235 1124 } 1236 1125 1237 #ifndef VBOX_WITH_REM1238 1126 /* 1239 1127 * Have to check if we can get back to fast execution mode every so often. … … 1246 1134 return VINF_EM_RESCHEDULE; 1247 1135 } 1248 #endif1249 1136 1250 1137 } /* The Inner Loop, recompiled execution mode version. */ 1251 1252 1253 #ifdef VBOX_WITH_REM1254 /*1255 * Returning. Sync back the VM state if required.1256 */1257 if (fInREMState)1258 fInREMState = emR3RemExecuteSyncBack(pVM, pVCpu);1259 #endif1260 1138 1261 1139 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatREMTotal, a); … … 1894 1772 } 1895 1773 1896 #ifdef VBOX_WITH_REM1897 /* Replay the handler notification changes. */1898 if (VM_FF_IS_PENDING_EXCEPT(pVM, VM_FF_REM_HANDLER_NOTIFY, VM_FF_PGM_NO_MEMORY))1899 {1900 /* Try not to cause deadlocks. */1901 if ( pVM->cCpus == 11902 || ( !PGMIsLockOwner(pVM)1903 && !IOMIsLockWriteOwner(pVM))1904 )1905 {1906 EMRemLock(pVM);1907 REMR3ReplayHandlerNotifications(pVM);1908 EMRemUnlock(pVM);1909 }1910 }1911 #endif1912 1913 1774 /* check that we got them all */ 1914 AssertCompile(VM_FF_NORMAL_PRIORITY_MASK == (VM_FF_REQUEST | VM_FF_PDM_QUEUES | VM_FF_PDM_DMA | VM_FF_ REM_HANDLER_NOTIFY | VM_FF_EMT_RENDEZVOUS));1775 AssertCompile(VM_FF_NORMAL_PRIORITY_MASK == (VM_FF_REQUEST | VM_FF_PDM_QUEUES | VM_FF_PDM_DMA | VM_FF_EMT_RENDEZVOUS)); 1915 1776 } 1916 1777 -
trunk/src/VBox/VMM/VMMR3/EMHM.cpp
r81150 r81153 198 198 STAM_PROFILE_STOP(&pVCpu->em.s.StatIEMEmu, a); 199 199 200 if ( rcStrict == VERR_IEM_ASPECT_NOT_IMPLEMENTED201 || rcStrict == VERR_IEM_INSTR_NOT_IMPLEMENTED)202 {203 #ifdef VBOX_WITH_REM204 STAM_PROFILE_START(&pVCpu->em.s.StatREMEmu, b);205 EMRemLock(pVM);206 /* Flush the recompiler TLB if the VCPU has changed. */207 if (pVM->em.s.idLastRemCpu != pVCpu->idCpu)208 CPUMSetChangedFlags(pVCpu, CPUM_CHANGED_ALL);209 pVM->em.s.idLastRemCpu = pVCpu->idCpu;210 211 rcStrict = REMR3EmulateInstruction(pVM, pVCpu);212 EMRemUnlock(pVM);213 STAM_PROFILE_STOP(&pVCpu->em.s.StatREMEmu, b);214 #else /* !VBOX_WITH_REM */215 NOREF(pVM);216 #endif /* !VBOX_WITH_REM */217 }218 219 200 return VBOXSTRICTRC_TODO(rcStrict); 220 201 } -
trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp
r81150 r81153 202 202 STAM_PROFILE_STOP(&pVCpu->em.s.StatIEMEmu, a); 203 203 204 if ( rcStrict == VERR_IEM_ASPECT_NOT_IMPLEMENTED 205 || rcStrict == VERR_IEM_INSTR_NOT_IMPLEMENTED) 206 { 207 #ifdef VBOX_WITH_REM 208 STAM_PROFILE_START(&pVCpu->em.s.StatREMEmu, b); 209 CPUM_IMPORT_EXTRN_RET(pVCpu, ~CPUMCTX_EXTRN_KEEPER_MASK); 210 EMRemLock(pVM); 211 /* Flush the recompiler TLB if the VCPU has changed. */ 212 if (pVM->em.s.idLastRemCpu != pVCpu->idCpu) 213 CPUMSetChangedFlags(pVCpu, CPUM_CHANGED_ALL); 214 pVM->em.s.idLastRemCpu = pVCpu->idCpu; 215 216 rcStrict = REMR3EmulateInstruction(pVM, pVCpu); 217 EMRemUnlock(pVM); 218 STAM_PROFILE_STOP(&pVCpu->em.s.StatREMEmu, b); 219 #else /* !VBOX_WITH_REM */ 220 NOREF(pVM); 221 #endif /* !VBOX_WITH_REM */ 222 } 204 NOREF(pVM); 223 205 return VBOXSTRICTRC_TODO(rcStrict); 224 206 } -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r81150 r81153 2867 2867 AssertMsg(pVM->pdm.s.pDmac, ("Configuration error: No DMAC controller available. This could be related to init order too!\n")); 2868 2868 VM_FF_SET(pVM, VM_FF_PDM_DMA); 2869 #ifdef VBOX_WITH_REM2870 REMR3NotifyDmaPending(pVM);2871 #endif2872 2869 VMR3NotifyGlobalFFU(pVM->pUVM, VMNOTIFYFF_FLAGS_DONE_REM); 2873 2870 } -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r81150 r81153 1909 1909 rc = NEMR3NotifyPhysRamRegister(pVM, GCPhys, cb); 1910 1910 pgmUnlock(pVM); 1911 #ifdef VBOX_WITH_REM1912 REMR3NotifyPhysRamRegister(pVM, GCPhys, cb, REM_NOTIFY_PHYS_RAM_FLAGS_RAM);1913 #endif1914 1911 return rc; 1915 1912 } … … 3628 3625 pgmUnlock(pVM); 3629 3626 3630 #ifdef VBOX_WITH_REM3631 if (!fRamExists && (pFirstMmio->fFlags & PGMREGMMIORANGE_F_MMIO2)) /** @todo this doesn't look right. */3632 REMR3NotifyPhysRamRegister(pVM, GCPhys, cbRange, REM_NOTIFY_PHYS_RAM_FLAGS_MMIO2);3633 #endif3634 3627 return rc; 3635 3628 } … … 3775 3768 rc = NEMR3NotifyPhysMmioExUnmap(pVM, GCPhysRangeNotify, cbRange, fNemFlags); 3776 3769 pgmUnlock(pVM); 3777 #ifdef VBOX_WITH_REM3778 if ((fOldFlags & (PGMREGMMIORANGE_F_OVERLAPPING | PGMREGMMIORANGE_F_MMIO2)) == PGMREGMMIORANGE_F_MMIO2)3779 REMR3NotifyPhysRamDeregister(pVM, GCPhysRangeNotify, cbRange);3780 #endif3781 3770 return rc; 3782 3771 } … … 4258 4247 if (fFlags & PGMPHYS_ROM_FLAGS_SHADOWED) 4259 4248 { 4260 #ifdef VBOX_WITH_REM4261 REMR3NotifyPhysRomRegister(pVM, GCPhys, cb, NULL, true /* fShadowed */);4262 #endif4263 4249 if (RT_SUCCESS(rc)) 4264 4250 rc = PGMHandlerPhysicalRegister(pVM, GCPhys, GCPhysLast, pVM->pgm.s.hRomPhysHandlerType, … … 4272 4258 pRomNew, MMHyperCCToR0(pVM, pRomNew), MMHyperCCToRC(pVM, pRomNew), 4273 4259 pszDesc); 4274 #ifdef VBOX_WITH_REM4275 REMR3NotifyPhysRomRegister(pVM, GCPhys, cb, NULL, false /* fShadowed */);4276 #endif4277 4260 } 4278 4261 if (RT_SUCCESS(rc)) … … 4709 4692 pVCpu->pgm.s.fA20Enabled = fEnable; 4710 4693 pVCpu->pgm.s.GCPhysA20Mask = ~((RTGCPHYS)!fEnable << 20); 4711 #ifdef VBOX_WITH_REM4712 REMR3A20Set(pVCpu->pVMR3, pVCpu, fEnable);4713 #endif4714 4694 NEMR3NotifySetA20(pVCpu, fEnable); 4715 4695 #ifdef PGM_WITH_A20 … … 4926 4906 CPUMSetChangedFlags(pVM->apCpusR3[idCpu], CPUM_CHANGED_GLOBAL_TLB_FLUSH); 4927 4907 } 4928 #ifdef VBOX_WITH_REM4929 /* Flush REM translation blocks. */4930 REMFlushTBs(pVM);4931 #endif4932 4908 } 4933 4909 } -
trunk/src/VBox/VMM/VMMR3/TM.cpp
r81150 r81153 2106 2106 Log5(("TM(%u): FF: 0 -> 1\n", __LINE__)); 2107 2107 VMCPU_FF_SET(pVCpuDst, VMCPU_FF_TIMER); 2108 #ifdef VBOX_WITH_REM2109 REMR3NotifyTimerPending(pVM, pVCpuDst);2110 #endif2111 2108 VMR3NotifyCpuFFU(pVCpuDst->pUVCpu, VMNOTIFYFF_FLAGS_DONE_REM | VMNOTIFYFF_FLAGS_POKE); 2112 2109 STAM_COUNTER_INC(&pVM->tm.s.StatTimerCallbackSetFF); -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r81150 r81153 860 860 if (RT_SUCCESS(rc)) 861 861 { 862 #ifdef VBOX_WITH_REM 863 rc = REMR3Init(pVM);864 #endif 862 rc = MMR3InitPaging(pVM); 863 if (RT_SUCCESS(rc)) 864 rc = TMR3Init(pVM); 865 865 if (RT_SUCCESS(rc)) 866 866 { 867 rc = MMR3InitPaging(pVM); 868 if (RT_SUCCESS(rc)) 869 rc = TMR3Init(pVM); 867 rc = VMMR3Init(pVM); 870 868 if (RT_SUCCESS(rc)) 871 869 { 872 rc = VMMR3Init(pVM);870 rc = SELMR3Init(pVM); 873 871 if (RT_SUCCESS(rc)) 874 872 { 875 rc = SELMR3Init(pVM);873 rc = TRPMR3Init(pVM); 876 874 if (RT_SUCCESS(rc)) 877 875 { 878 rc = TRPMR3Init(pVM);876 rc = SSMR3RegisterStub(pVM, "CSAM", 0); 879 877 if (RT_SUCCESS(rc)) 880 878 { 881 rc = SSMR3RegisterStub(pVM, " CSAM", 0);879 rc = SSMR3RegisterStub(pVM, "PATM", 0); 882 880 if (RT_SUCCESS(rc)) 883 881 { 884 rc = SSMR3RegisterStub(pVM, "PATM", 0);882 rc = IOMR3Init(pVM); 885 883 if (RT_SUCCESS(rc)) 886 884 { 887 rc = IOMR3Init(pVM);885 rc = EMR3Init(pVM); 888 886 if (RT_SUCCESS(rc)) 889 887 { 890 rc = EMR3Init(pVM);888 rc = IEMR3Init(pVM); 891 889 if (RT_SUCCESS(rc)) 892 890 { 893 rc = IEMR3Init(pVM);891 rc = DBGFR3Init(pVM); 894 892 if (RT_SUCCESS(rc)) 895 893 { 896 rc = DBGFR3Init(pVM); 894 /* GIM must be init'd before PDM, gimdevR3Construct() 895 requires GIM provider to be setup. */ 896 rc = GIMR3Init(pVM); 897 897 if (RT_SUCCESS(rc)) 898 898 { 899 /* GIM must be init'd before PDM, gimdevR3Construct() 900 requires GIM provider to be setup. */ 901 rc = GIMR3Init(pVM); 899 rc = PDMR3Init(pVM); 902 900 if (RT_SUCCESS(rc)) 903 901 { 904 rc = PDMR3Init(pVM); 902 rc = PGMR3InitDynMap(pVM); 903 if (RT_SUCCESS(rc)) 904 rc = MMR3HyperInitFinalize(pVM); 905 if (RT_SUCCESS(rc)) 906 rc = PGMR3InitFinalize(pVM); 907 if (RT_SUCCESS(rc)) 908 rc = TMR3InitFinalize(pVM); 905 909 if (RT_SUCCESS(rc)) 906 910 { 907 rc = PGMR3InitDynMap(pVM); 908 if (RT_SUCCESS(rc)) 909 rc = MMR3HyperInitFinalize(pVM); 910 if (RT_SUCCESS(rc)) 911 rc = PGMR3InitFinalize(pVM); 912 if (RT_SUCCESS(rc)) 913 rc = TMR3InitFinalize(pVM); 914 #ifdef VBOX_WITH_REM 915 if (RT_SUCCESS(rc)) 916 rc = REMR3InitFinalize(pVM); 917 #endif 918 if (RT_SUCCESS(rc)) 919 { 920 PGMR3MemSetup(pVM, false /*fAtReset*/); 921 PDMR3MemSetup(pVM, false /*fAtReset*/); 922 } 923 if (RT_SUCCESS(rc)) 924 rc = vmR3InitDoCompleted(pVM, VMINITCOMPLETED_RING3); 925 if (RT_SUCCESS(rc)) 926 { 927 LogFlow(("vmR3InitRing3: returns %Rrc\n", VINF_SUCCESS)); 928 return VINF_SUCCESS; 929 } 930 931 int rc2 = PDMR3Term(pVM); 932 AssertRC(rc2); 911 PGMR3MemSetup(pVM, false /*fAtReset*/); 912 PDMR3MemSetup(pVM, false /*fAtReset*/); 933 913 } 934 int rc2 = GIMR3Term(pVM); 914 if (RT_SUCCESS(rc)) 915 rc = vmR3InitDoCompleted(pVM, VMINITCOMPLETED_RING3); 916 if (RT_SUCCESS(rc)) 917 { 918 LogFlow(("vmR3InitRing3: returns %Rrc\n", VINF_SUCCESS)); 919 return VINF_SUCCESS; 920 } 921 922 int rc2 = PDMR3Term(pVM); 935 923 AssertRC(rc2); 936 924 } 937 int rc2 = DBGFR3Term(pVM);925 int rc2 = GIMR3Term(pVM); 938 926 AssertRC(rc2); 939 927 } 940 int rc2 = IEMR3Term(pVM);928 int rc2 = DBGFR3Term(pVM); 941 929 AssertRC(rc2); 942 930 } 943 int rc2 = EMR3Term(pVM);931 int rc2 = IEMR3Term(pVM); 944 932 AssertRC(rc2); 945 933 } 946 int rc2 = IOMR3Term(pVM);934 int rc2 = EMR3Term(pVM); 947 935 AssertRC(rc2); 948 936 } 937 int rc2 = IOMR3Term(pVM); 938 AssertRC(rc2); 949 939 } 950 940 } 951 int rc2 = TRPMR3Term(pVM);952 AssertRC(rc2);953 941 } 954 int rc2 = SELMR3Term(pVM);942 int rc2 = TRPMR3Term(pVM); 955 943 AssertRC(rc2); 956 944 } 957 int rc2 = VMMR3Term(pVM);945 int rc2 = SELMR3Term(pVM); 958 946 AssertRC(rc2); 959 947 } 960 int rc2 = TMR3Term(pVM);948 int rc2 = VMMR3Term(pVM); 961 949 AssertRC(rc2); 962 950 } 963 #ifdef VBOX_WITH_REM 964 int rc2 = REMR3Term(pVM); 951 int rc2 = TMR3Term(pVM); 965 952 AssertRC(rc2); 966 #endif967 953 } 968 954 int rc2 = PGMR3Term(pVM); … … 1043 1029 if (enmWhat == VMINITCOMPLETED_RING3) 1044 1030 { 1045 #ifndef VBOX_WITH_REM1046 1031 if (RT_SUCCESS(rc)) 1047 1032 rc = SSMR3RegisterStub(pVM, "rem", 1); 1048 #endif1049 1033 } 1050 1034 if (RT_SUCCESS(rc)) … … 2222 2206 rc = SELMR3Term(pVM); 2223 2207 AssertRC(rc); 2224 #ifdef VBOX_WITH_REM2225 rc = REMR3Term(pVM);2226 AssertRC(rc);2227 #endif2228 2208 rc = HMR3Term(pVM); 2229 2209 AssertRC(rc); … … 2509 2489 if (pVCpu->idCpu == 0) 2510 2490 { 2511 #ifdef VBOX_WITH_REM2512 REMR3Reset(pVM);2513 #endif2514 2491 PDMR3SoftReset(pVM, fResetFlags); 2515 2492 TRPMR3Reset(pVM); … … 2611 2588 SELMR3Reset(pVM); 2612 2589 TRPMR3Reset(pVM); 2613 #ifdef VBOX_WITH_REM2614 REMR3Reset(pVM);2615 #endif2616 2590 IOMR3Reset(pVM); 2617 2591 CPUMR3Reset(pVM); /* This must come *after* PDM (due to APIC base MSR caching). */ -
trunk/src/VBox/VMM/VMMR3/VMEmt.cpp
r81150 r81153 868 868 || enmState == VMCPUSTATE_STARTED_EXEC_NEM_WAIT) 869 869 NEMR3NotifyFF(pUVCpu->pVM, pVCpu, fFlags); 870 #ifdef VBOX_WITH_REM871 else if (enmState == VMCPUSTATE_STARTED_EXEC_REM)872 {873 if (!(fFlags & VMNOTIFYFF_FLAGS_DONE_REM))874 REMR3NotifyFF(pUVCpu->pVM);875 }876 #endif877 870 } 878 871 } … … 1017 1010 || enmState == VMCPUSTATE_STARTED_EXEC_NEM_WAIT) 1018 1011 NEMR3NotifyFF(pUVCpu->pVM, pVCpu, fFlags); 1019 #ifdef VBOX_WITH_REM1020 else if ( !(fFlags & VMNOTIFYFF_FLAGS_DONE_REM)1021 && enmState == VMCPUSTATE_STARTED_EXEC_REM)1022 REMR3NotifyFF(pUVCpu->pVM);1023 #endif1024 1012 } 1025 1013 } -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r81150 r81153 514 514 STAM_REG(pVM, &pVM->vmm.s.StatRZCallPGMMapChunk, STAMTYPE_COUNTER, "/VMM/RZCallR3/PGMMapChunk", STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PGM_MAP_CHUNK calls."); 515 515 STAM_REG(pVM, &pVM->vmm.s.StatRZCallPGMAllocHandy, STAMTYPE_COUNTER, "/VMM/RZCallR3/PGMAllocHandy", STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES calls."); 516 STAM_REG(pVM, &pVM->vmm.s.StatRZCallRemReplay, STAMTYPE_COUNTER, "/VMM/RZCallR3/REMReplay", STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_REM_REPLAY_HANDLER_NOTIFICATIONS calls.");517 516 STAM_REG(pVM, &pVM->vmm.s.StatRZCallLogFlush, STAMTYPE_COUNTER, "/VMM/RZCallR3/VMMLogFlush", STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_VMM_LOGGER_FLUSH calls."); 518 517 STAM_REG(pVM, &pVM->vmm.s.StatRZCallVMSetError, STAMTYPE_COUNTER, "/VMM/RZCallR3/VMSetError", STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_VM_SET_ERROR calls."); … … 2443 2442 } 2444 2443 2445 #ifdef VBOX_WITH_REM2446 /*2447 * Flush REM handler notifications.2448 */2449 case VMMCALLRING3_REM_REPLAY_HANDLER_NOTIFICATIONS:2450 {2451 REMR3ReplayHandlerNotifications(pVM);2452 pVCpu->vmm.s.rcCallRing3 = VINF_SUCCESS;2453 break;2454 }2455 #endif2456 2457 2444 /* 2458 2445 * This is a noop. We just take this route to avoid unnecessary … … 2573 2560 PRINT_FLAG(VM_FF_,PGM_NO_MEMORY); 2574 2561 PRINT_FLAG(VM_FF_,PGM_POOL_FLUSH_PENDING); 2575 PRINT_FLAG(VM_FF_,REM_HANDLER_NOTIFY);2576 2562 PRINT_FLAG(VM_FF_,DEBUG_SUSPEND); 2577 2563 if (f) -
trunk/src/VBox/VMM/include/EMInternal.h
r80018 r81153 160 160 /** Id of the VCPU that last executed code in the recompiler. */ 161 161 VMCPUID idLastRemCpu; 162 163 #ifdef VBOX_WITH_REM164 /** REM critical section.165 * This protects recompiler usage166 */167 PDMCRITSECT CritSectREM;168 #endif169 162 } EM; 170 163 /** Pointer to EM VM instance data. */ -
trunk/src/VBox/VMM/include/VMMInternal.h
r80281 r81153 331 331 STAMCOUNTER StatRZCallPGMMapChunk; 332 332 STAMCOUNTER StatRZCallPGMAllocHandy; 333 STAMCOUNTER StatRZCallRemReplay;334 333 STAMCOUNTER StatRZCallVMSetError; 335 334 STAMCOUNTER StatRZCallVMSetRuntimeError; -
trunk/src/VBox/VMM/testcase/tstAnimate.cpp
r81150 r81153 870 870 RTPrintf("info: powering on the VM...\n"); 871 871 RTLogGroupSettings(NULL, "+REM_DISAS.e.l.f"); 872 #ifdef VBOX_WITH_REM 873 rc = REMR3DisasEnableStepping(pVM, true); 874 #else 875 rc = VERR_NOT_IMPLEMENTED; /** @todo need some EM single-step indicator */ 876 #endif 872 rc = VERR_NOT_IMPLEMENTED; /** @todo need some EM single-step indicator (was REMR3DisasEnableStepping) */ 877 873 if (RT_SUCCESS(rc)) 878 874 { -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r80938 r81153 1452 1452 GEN_CHECK_OFF(VM, dbgf); 1453 1453 GEN_CHECK_OFF(VM, ssm); 1454 #ifdef VBOX_WITH_REM1455 GEN_CHECK_OFF(VM, rem);1456 #endif1457 1454 GEN_CHECK_OFF(VM, gim); 1458 1455 GEN_CHECK_OFF(VM, vm);
Note:
See TracChangeset
for help on using the changeset viewer.