Changeset 12989 in vbox for trunk/src/VBox/VMM/PATM
- Timestamp:
- Oct 6, 2008 2:15:39 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 37424
- Location:
- trunk/src/VBox/VMM/PATM
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PATM/CSAM.cpp
r11792 r12989 109 109 * @param pVM The VM to operate on. 110 110 */ 111 CSAMR3DECL(int) CSAMR3Init(PVM pVM)111 VMMR3DECL(int) CSAMR3Init(PVM pVM) 112 112 { 113 113 int rc; … … 255 255 * @param offDelta Relocation delta. 256 256 */ 257 CSAMR3DECL(void) CSAMR3Relocate(PVM pVM, RTGCINTPTR offDelta)257 VMMR3DECL(void) CSAMR3Relocate(PVM pVM, RTGCINTPTR offDelta) 258 258 { 259 259 if (offDelta) … … 283 283 * @param pVM The VM to operate on. 284 284 */ 285 CSAMR3DECL(int) CSAMR3Term(PVM pVM)285 VMMR3DECL(int) CSAMR3Term(PVM pVM) 286 286 { 287 287 int rc; … … 308 308 * @param pVM The VM which is reset. 309 309 */ 310 CSAMR3DECL(int) CSAMR3Reset(PVM pVM)310 VMMR3DECL(int) CSAMR3Reset(PVM pVM) 311 311 { 312 312 /* Clear page bitmaps. */ … … 1521 1521 * @param addr GC address of the page to flush 1522 1522 */ 1523 CSAMR3DECL(int) CSAMR3FlushPage(PVM pVM, RTRCPTR addr)1523 VMMR3DECL(int) CSAMR3FlushPage(PVM pVM, RTRCPTR addr) 1524 1524 { 1525 1525 return csamFlushPage(pVM, addr, true /* remove page record */); … … 1533 1533 * @param addr GC address of the page to flush 1534 1534 */ 1535 CSAMR3DECL(int) CSAMR3RemovePage(PVM pVM, RTRCPTR addr)1535 VMMR3DECL(int) CSAMR3RemovePage(PVM pVM, RTRCPTR addr) 1536 1536 { 1537 1537 PCSAMPAGEREC pPageRec; … … 1706 1706 * @param enmTag Monitor tag 1707 1707 */ 1708 CSAMR3DECL(int) CSAMR3MonitorPage(PVM pVM, RTRCPTR pPageAddrGC, CSAMTAG enmTag)1708 VMMR3DECL(int) CSAMR3MonitorPage(PVM pVM, RTRCPTR pPageAddrGC, CSAMTAG enmTag) 1709 1709 { 1710 1710 PCSAMPAGEREC pPageRec = NULL; … … 1828 1828 * @param enmTag Monitor tag 1829 1829 */ 1830 CSAMR3DECL(int) CSAMR3UnmonitorPage(PVM pVM, RTRCPTR pPageAddrGC, CSAMTAG enmTag)1830 VMMR3DECL(int) CSAMR3UnmonitorPage(PVM pVM, RTRCPTR pPageAddrGC, CSAMTAG enmTag) 1831 1831 { 1832 1832 pPageAddrGC &= PAGE_BASE_GC_MASK; … … 2078 2078 * @param fScanned Mark as scanned or not 2079 2079 */ 2080 CSAMR3DECL(int) CSAMR3MarkCode(PVM pVM, RTRCPTR pInstr, uint32_t opsize, bool fScanned)2080 VMMR3DECL(int) CSAMR3MarkCode(PVM pVM, RTRCPTR pInstr, uint32_t opsize, bool fScanned) 2081 2081 { 2082 2082 PCSAMPAGE pPage = 0; … … 2105 2105 * @param pInstrGC Instruction pointer 2106 2106 */ 2107 CSAMR3DECL(int) CSAMR3CheckCodeEx(PVM pVM, PCPUMCTXCORE pCtxCore, RTRCPTR pInstrGC)2107 VMMR3DECL(int) CSAMR3CheckCodeEx(PVM pVM, PCPUMCTXCORE pCtxCore, RTRCPTR pInstrGC) 2108 2108 { 2109 2109 if (EMIsRawRing0Enabled(pVM) == false || PATMIsPatchGCAddr(pVM, pInstrGC) == true) … … 2131 2131 * @param pInstrGC Instruction pointer (0:32 virtual address) 2132 2132 */ 2133 CSAMR3DECL(int) CSAMR3CheckCode(PVM pVM, RTRCPTR pInstrGC)2133 VMMR3DECL(int) CSAMR3CheckCode(PVM pVM, RTRCPTR pInstrGC) 2134 2134 { 2135 2135 int rc; … … 2236 2236 * @param pVM The VM to operate on. 2237 2237 */ 2238 CSAMR3DECL(int) CSAMR3DoPendingAction(PVM pVM)2238 VMMR3DECL(int) CSAMR3DoPendingAction(PVM pVM) 2239 2239 { 2240 2240 csamR3FlushDirtyPages(pVM); … … 2253 2253 * @param cGates Number of gates to check 2254 2254 */ 2255 CSAMR3DECL(int) CSAMR3CheckGates(PVM pVM, uint32_t iGate, uint32_t cGates)2255 VMMR3DECL(int) CSAMR3CheckGates(PVM pVM, uint32_t iGate, uint32_t cGates) 2256 2256 { 2257 2257 uint16_t cbIDT; … … 2473 2473 * @param GCPtrCall Call address 2474 2474 */ 2475 CSAMR3DECL(int) CSAMR3RecordCallAddress(PVM pVM, RTRCPTR GCPtrCall)2475 VMMR3DECL(int) CSAMR3RecordCallAddress(PVM pVM, RTRCPTR GCPtrCall) 2476 2476 { 2477 2477 for (unsigned i=0;i<RT_ELEMENTS(pVM->csam.s.pvCallInstruction);i++) … … 2497 2497 * @param pVM The VM to operate on. 2498 2498 */ 2499 CSAMR3DECL(int) CSAMR3IsEnabled(PVM pVM)2499 VMMR3DECL(int) CSAMR3IsEnabled(PVM pVM) 2500 2500 { 2501 2501 return pVM->fCSAMEnabled; -
trunk/src/VBox/VMM/PATM/CSAMInternal.h
r9344 r12989 29 29 #include <VBox/log.h> 30 30 31 #if !defined(IN_CSAM_R3) && !defined(IN_CSAM_R0) && !defined(IN_CSAM_GC) 32 # error "Not in CSAM! This is an internal header!" 33 #endif 34 35 /** Page flags. 31 32 33 /** @name Page flags. 36 34 * These are placed in the three bits available for system programs in 37 35 * the page entries. … … 282 280 283 281 __BEGIN_DECLS 284 CSAMGCDECL(int) CSAMGCCodePageWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange);282 VMMRCDECL(int) CSAMGCCodePageWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange); 285 283 __END_DECLS 286 284 -
trunk/src/VBox/VMM/PATM/PATM.cpp
r12855 r12989 106 106 * @param pVM The VM to operate on. 107 107 */ 108 PATMR3DECL(int) PATMR3Init(PVM pVM)108 VMMR3DECL(int) PATMR3Init(PVM pVM) 109 109 { 110 110 int rc; … … 279 279 * @param pVM The VM handle. 280 280 */ 281 PATMR3DECL(int) PATMR3InitFinalize(PVM pVM)281 VMMR3DECL(int) PATMR3InitFinalize(PVM pVM) 282 282 { 283 283 /* The GC state, stack and statistics must be read/write for the guest (supervisor only of course). */ … … 410 410 * @param pVM The VM. 411 411 */ 412 PATMR3DECL(void) PATMR3Relocate(PVM pVM)412 VMMR3DECL(void) PATMR3Relocate(PVM pVM) 413 413 { 414 414 RTRCPTR GCPtrNew = MMHyperHC2GC(pVM, pVM->patm.s.pGCStateHC); … … 467 467 * @param pVM The VM to operate on. 468 468 */ 469 PATMR3DECL(int) PATMR3Term(PVM pVM)469 VMMR3DECL(int) PATMR3Term(PVM pVM) 470 470 { 471 471 /* Memory was all allocated from the two MM heaps and requires no freeing. */ … … 480 480 * @param pVM The VM which is reset. 481 481 */ 482 PATMR3DECL(int) PATMR3Reset(PVM pVM)482 VMMR3DECL(int) PATMR3Reset(PVM pVM) 483 483 { 484 484 Log(("PATMR3Reset\n")); … … 877 877 * @param pcb Size of the patch memory block 878 878 */ 879 PATMR3DECL(void *) PATMR3QueryPatchMemHC(PVM pVM, uint32_t *pcb)879 VMMR3DECL(void *) PATMR3QueryPatchMemHC(PVM pVM, uint32_t *pcb) 880 880 { 881 881 if (pcb) … … 894 894 * @param pcb Size of the patch memory block 895 895 */ 896 PATMR3DECL(RTRCPTR) PATMR3QueryPatchMemGC(PVM pVM, uint32_t *pcb)896 VMMR3DECL(RTRCPTR) PATMR3QueryPatchMemGC(PVM pVM, uint32_t *pcb) 897 897 { 898 898 if (pcb) … … 910 910 * @param pVM The VM to operate on. 911 911 */ 912 PATMR3DECL(PPATMGCSTATE) PATMR3QueryGCStateHC(PVM pVM)912 VMMR3DECL(PPATMGCSTATE) PATMR3QueryGCStateHC(PVM pVM) 913 913 { 914 914 return pVM->patm.s.pGCStateHC; … … 923 923 * @param pAddrGC Guest context address 924 924 */ 925 PATMR3DECL(bool) PATMR3IsPatchHCAddr(PVM pVM, R3PTRTYPE(uint8_t *) pAddrHC)925 VMMR3DECL(bool) PATMR3IsPatchHCAddr(PVM pVM, R3PTRTYPE(uint8_t *) pAddrHC) 926 926 { 927 927 return (pAddrHC >= pVM->patm.s.pPatchMemHC && pAddrHC < pVM->patm.s.pPatchMemHC + pVM->patm.s.cbPatchMem) ? true : false; … … 936 936 * @param fAllowPatching Allow/disallow patching 937 937 */ 938 PATMR3DECL(int) PATMR3AllowPatching(PVM pVM, uint32_t fAllowPatching)938 VMMR3DECL(int) PATMR3AllowPatching(PVM pVM, uint32_t fAllowPatching) 939 939 { 940 940 pVM->fPATMEnabled = (fAllowPatching) ? true : false; … … 949 949 * @param pAddrGC GC pointer 950 950 */ 951 PATMR3DECL(R3PTRTYPE(void *)) PATMR3GCPtrToHCPtr(PVM pVM, RTRCPTR pAddrGC)951 VMMR3DECL(R3PTRTYPE(void *)) PATMR3GCPtrToHCPtr(PVM pVM, RTRCPTR pAddrGC) 952 952 { 953 953 if (pVM->patm.s.pPatchMemGC <= pAddrGC && pVM->patm.s.pPatchMemGC + pVM->patm.s.cbPatchMem > pAddrGC) … … 964 964 * @param pVM The VM to operate on. 965 965 */ 966 PATMR3DECL(int) PATMR3IsEnabled(PVM pVM)966 VMMR3DECL(int) PATMR3IsEnabled(PVM pVM) 967 967 { 968 968 return pVM->fPATMEnabled; … … 2241 2241 * 2242 2242 */ 2243 PATMR3DECL(int) PATMR3DetectConflict(PVM pVM, RTRCPTR pInstrGC, RTRCPTR pConflictGC)2243 VMMR3DECL(int) PATMR3DetectConflict(PVM pVM, RTRCPTR pInstrGC, RTRCPTR pConflictGC) 2244 2244 { 2245 2245 PPATCHINFO pTargetPatch = PATMFindActivePatchByEntrypoint(pVM, pConflictGC, true /* include patch hints */); … … 2650 2650 * 2651 2651 */ 2652 PATMR3DECL(int) PATMR3PatchBlock(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC,2652 VMMR3DECL(int) PATMR3PatchBlock(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, 2653 2653 uint32_t uOpcode, uint32_t uOpSize, PPATMPATCHREC pPatchRec) 2654 2654 { … … 3375 3375 * 3376 3376 */ 3377 PATMR3DECL(int) PATMR3DuplicateFunctionRequest(PVM pVM, PCPUMCTX pCtx)3377 VMMR3DECL(int) PATMR3DuplicateFunctionRequest(PVM pVM, PCPUMCTX pCtx) 3378 3378 { 3379 3379 RTRCPTR pBranchTarget, pPage; … … 3758 3758 * 3759 3759 */ 3760 PATMR3DECL(int) PATMR3PatchInstrInt3(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, DISCPUSTATE *pCpu, PPATCHINFO pPatch)3760 VMMR3DECL(int) PATMR3PatchInstrInt3(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, DISCPUSTATE *pCpu, PPATCHINFO pPatch) 3761 3761 { 3762 3762 uint8_t ASMInt3 = 0xCC; … … 3934 3934 * @param flags Patch flags 3935 3935 */ 3936 PATMR3DECL(int) PATMR3AddHint(PVM pVM, RTRCPTR pInstrGC, uint32_t flags)3936 VMMR3DECL(int) PATMR3AddHint(PVM pVM, RTRCPTR pInstrGC, uint32_t flags) 3937 3937 { 3938 3938 Assert(pInstrGC); … … 3953 3953 * @note returns failure if patching is not allowed or possible 3954 3954 */ 3955 PATMR3DECL(int) PATMR3InstallPatch(PVM pVM, RTRCPTR pInstrGC, uint64_t flags)3955 VMMR3DECL(int) PATMR3InstallPatch(PVM pVM, RTRCPTR pInstrGC, uint64_t flags) 3956 3956 { 3957 3957 DISCPUSTATE cpu; … … 4680 4680 * 4681 4681 */ 4682 PATMR3DECL(int) PATMR3PatchWrite(PVM pVM, RTRCPTR GCPtr, uint32_t cbWrite)4682 VMMR3DECL(int) PATMR3PatchWrite(PVM pVM, RTRCPTR GCPtr, uint32_t cbWrite) 4683 4683 { 4684 4684 RTRCUINTPTR pWritePageStart, pWritePageEnd, pPage; … … 4854 4854 /** @note Currently only called by CSAMR3FlushPage; optimization to avoid having to double check if the physical address has changed 4855 4855 */ 4856 PATMR3DECL(int) PATMR3FlushPage(PVM pVM, RTRCPTR addr)4856 VMMR3DECL(int) PATMR3FlushPage(PVM pVM, RTRCPTR addr) 4857 4857 { 4858 4858 addr &= PAGE_BASE_GC_MASK; … … 4886 4886 * @param pInstrGC Guest context pointer to instruction 4887 4887 */ 4888 PATMR3DECL(bool) PATMR3HasBeenPatched(PVM pVM, RTRCPTR pInstrGC)4888 VMMR3DECL(bool) PATMR3HasBeenPatched(PVM pVM, RTRCPTR pInstrGC) 4889 4889 { 4890 4890 PPATMPATCHREC pPatchRec; … … 4904 4904 * 4905 4905 */ 4906 PATMR3DECL(int) PATMR3QueryOpcode(PVM pVM, RTRCPTR pInstrGC, uint8_t *pByte)4906 VMMR3DECL(int) PATMR3QueryOpcode(PVM pVM, RTRCPTR pInstrGC, uint8_t *pByte) 4907 4907 { 4908 4908 PPATMPATCHREC pPatchRec; … … 4948 4948 * 4949 4949 */ 4950 PATMR3DECL(int) PATMR3DisablePatch(PVM pVM, RTRCPTR pInstrGC)4950 VMMR3DECL(int) PATMR3DisablePatch(PVM pVM, RTRCPTR pInstrGC) 4951 4951 { 4952 4952 PPATMPATCHREC pPatchRec; … … 5202 5202 * 5203 5203 */ 5204 PATMR3DECL(int) PATMR3EnablePatch(PVM pVM, RTRCPTR pInstrGC)5204 VMMR3DECL(int) PATMR3EnablePatch(PVM pVM, RTRCPTR pInstrGC) 5205 5205 { 5206 5206 PPATMPATCHREC pPatchRec; … … 5552 5552 * @param pPatchAddr Guest context patch address (if true) 5553 5553 */ 5554 PATMR3DECL(bool) PATMR3IsInsidePatchJump(PVM pVM, RTRCPTR pAddr, PRTGCPTR32 pPatchAddr)5554 VMMR3DECL(bool) PATMR3IsInsidePatchJump(PVM pVM, RTRCPTR pAddr, PRTGCPTR32 pPatchAddr) 5555 5555 { 5556 5556 RTRCPTR addr; … … 5583 5583 * 5584 5584 */ 5585 PATMR3DECL(int) PATMR3RemovePatch(PVM pVM, RTRCPTR pInstrGC)5585 VMMR3DECL(int) PATMR3RemovePatch(PVM pVM, RTRCPTR pInstrGC) 5586 5586 { 5587 5587 PPATMPATCHREC pPatchRec; … … 5609 5609 * 5610 5610 */ 5611 PATMR3DECL(int) PATMR3MarkDirtyPatch(PVM pVM, PPATCHINFO pPatch)5611 VMMR3DECL(int) PATMR3MarkDirtyPatch(PVM pVM, PPATCHINFO pPatch) 5612 5612 { 5613 5613 if (pPatch->pPatchBlockOffset) … … 5704 5704 * 5705 5705 */ 5706 PATMR3DECL(RTRCPTR) PATMR3GuestGCPtrToPatchGCPtr(PVM pVM, RCPTRTYPE(uint8_t*) pInstrGC)5706 VMMR3DECL(RTRCPTR) PATMR3GuestGCPtrToPatchGCPtr(PVM pVM, RCPTRTYPE(uint8_t*) pInstrGC) 5707 5707 { 5708 5708 PPATMPATCHREC pPatchRec = (PPATMPATCHREC)RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC, false); … … 5723 5723 * 5724 5724 */ 5725 PATMR3DECL(RTRCPTR) PATMR3PatchToGCPtr(PVM pVM, RTRCPTR pPatchGC, PATMTRANSSTATE *pEnmState)5725 VMMR3DECL(RTRCPTR) PATMR3PatchToGCPtr(PVM pVM, RTRCPTR pPatchGC, PATMTRANSSTATE *pEnmState) 5726 5726 { 5727 5727 PPATMPATCHREC pPatchRec; … … 5789 5789 * @param pAddrGC Guest context address 5790 5790 */ 5791 PATMR3DECL(RTRCPTR) PATMR3QueryPatchGCPtr(PVM pVM, RTRCPTR pAddrGC)5791 VMMR3DECL(RTRCPTR) PATMR3QueryPatchGCPtr(PVM pVM, RTRCPTR pAddrGC) 5792 5792 { 5793 5793 PPATMPATCHREC pPatchRec; … … 5983 5983 * @param ppNewEip GC pointer to new instruction 5984 5984 */ 5985 PATMR3DECL(int) PATMR3HandleTrap(PVM pVM, PCPUMCTX pCtx, RTRCPTR pEip, RTGCPTR *ppNewEip)5985 VMMR3DECL(int) PATMR3HandleTrap(PVM pVM, PCPUMCTX pCtx, RTRCPTR pEip, RTGCPTR *ppNewEip) 5986 5986 { 5987 5987 PPATMPATCHREC pPatch = 0; … … 6105 6105 { 6106 6106 /* Invalidated patch or first instruction overwritten. 6107 * We can ignore the fPIF state in this case. 6107 * We can ignore the fPIF state in this case. 6108 6108 */ 6109 6109 /* Reset the PATM stack. */ … … 6113 6113 6114 6114 pVM->patm.s.pGCStateHC->fPIF = 1; 6115 6115 6116 6116 /* continue at the original instruction */ 6117 6117 *ppNewEip = pNewEip - SELMToFlat(pVM, DIS_SELREG_CS, CPUMCTX2CORE(pCtx), 0); … … 6264 6264 * @param pVM The VM to operate on. 6265 6265 */ 6266 PATMR3DECL(int) PATMR3HandleMonitoredPage(PVM pVM)6266 VMMR3DECL(int) PATMR3HandleMonitoredPage(PVM pVM) 6267 6267 { 6268 6268 RTRCPTR addr = pVM->patm.s.pvFaultMonitor; -
trunk/src/VBox/VMM/PATM/PATMInternal.h
r12855 r12989 33 33 #include <VBox/log.h> 34 34 35 #if !defined(IN_PATM_R3) && !defined(IN_PATM_R0) && !defined(IN_PATM_GC)36 # error "Not in PATM! This is an internal header!"37 #endif38 35 39 36 … … 639 636 * 640 637 */ 641 PATMDECL(PPATMPATCHREC) PATMQueryFunctionPatch(PVM pVM, RTRCPTR pInstrGC);638 VMMDECL(PPATMPATCHREC) PATMQueryFunctionPatch(PVM pVM, RTRCPTR pInstrGC); 642 639 643 640 … … 668 665 * @param fPatchFlags Patch flags 669 666 */ 670 PATMDECL(const char *) patmGetInstructionString(uint32_t opcode, uint32_t fPatchFlags);667 VMMDECL(const char *) patmGetInstructionString(uint32_t opcode, uint32_t fPatchFlags); 671 668 672 669 … … 731 728 * (If it's a EIP range this's the EIP, if not it's pvFault.) 732 729 */ 733 PATMGCDECL(int) PATMGCMonitorPage(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange);730 VMMRCDECL(int) PATMGCMonitorPage(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange); 734 731 735 732 /** … … 758 755 * 759 756 */ 760 PATMR3DECL(int) PATMR3PatchBlock(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC,757 VMMR3DECL(int) PATMR3PatchBlock(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, 761 758 uint32_t uOpcode, uint32_t uOpSize, PPATMPATCHREC pPatchRec); 762 759 … … 775 772 * 776 773 */ 777 PATMR3DECL(int) PATMR3PatchInstrInt3(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, DISCPUSTATE *pCpu, PPATCHINFO pPatch);774 VMMR3DECL(int) PATMR3PatchInstrInt3(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, DISCPUSTATE *pCpu, PPATCHINFO pPatch); 778 775 779 776 /** … … 787 784 * 788 785 */ 789 PATMR3DECL(int) PATMR3MarkDirtyPatch(PVM pVM, PPATCHINFO pPatch);786 VMMR3DECL(int) PATMR3MarkDirtyPatch(PVM pVM, PPATCHINFO pPatch); 790 787 791 788 /** -
trunk/src/VBox/VMM/PATM/VMMAll/CSAMAll.cpp
r9344 r12989 53 53 * @param pvFault Fault address 54 54 */ 55 CSAMDECL(int) CSAMExecFault(PVM pVM, RTRCPTR pvFault)55 VMMDECL(int) CSAMExecFault(PVM pVM, RTRCPTR pvFault) 56 56 { 57 57 if(!CSAMIsEnabled(pVM)) … … 80 80 * @param pPage GC page address 81 81 */ 82 CSAMDECL(bool) CSAMIsPageScanned(PVM pVM, RTRCPTR pPage)82 VMMDECL(bool) CSAMIsPageScanned(PVM pVM, RTRCPTR pPage) 83 83 { 84 84 int pgdir, bit; … … 108 108 * 109 109 */ 110 CSAMDECL(int) CSAMMarkPage(PVM pVM, RTRCPTR pPage, bool fScanned)110 VMMDECL(int) CSAMMarkPage(PVM pVM, RTRCPTR pPage, bool fScanned) 111 111 { 112 112 int pgdir, bit; … … 177 177 * @param GCPtr GC pointer of page 178 178 */ 179 CSAMDECL(bool) CSAMDoesPageNeedScanning(PVM pVM, RTRCPTR GCPtr)179 VMMDECL(bool) CSAMDoesPageNeedScanning(PVM pVM, RTRCPTR GCPtr) 180 180 { 181 181 if(!CSAMIsEnabled(pVM)) … … 200 200 * @param GCPtr GC pointer of page 201 201 */ 202 CSAMDECL(void) CSAMMarkPossibleCodePage(PVM pVM, RTRCPTR GCPtr)202 VMMDECL(void) CSAMMarkPossibleCodePage(PVM pVM, RTRCPTR GCPtr) 203 203 { 204 204 if (pVM->csam.s.cPossibleCodePages < RT_ELEMENTS(pVM->csam.s.pvPossibleCodePage)) … … 217 217 * @param pVM The VM to operate on. 218 218 */ 219 CSAMDECL(int) CSAMEnableScanning(PVM pVM)219 VMMDECL(int) CSAMEnableScanning(PVM pVM) 220 220 { 221 221 pVM->fCSAMEnabled = true; … … 229 229 * @param pVM The VM to operate on. 230 230 */ 231 CSAMDECL(int) CSAMDisableScanning(PVM pVM)231 VMMDECL(int) CSAMDisableScanning(PVM pVM) 232 232 { 233 233 pVM->fCSAMEnabled = false; … … 247 247 * @param GCPtr GC pointer of page table entry 248 248 */ 249 CSAMDECL(bool) CSAMIsKnownDangerousInstr(PVM pVM, RTRCPTR GCPtr)249 VMMDECL(bool) CSAMIsKnownDangerousInstr(PVM pVM, RTRCPTR GCPtr) 250 250 { 251 251 for (uint32_t i=0;i<pVM->csam.s.cDangerousInstr;i++) -
trunk/src/VBox/VMM/PATM/VMMAll/PATMAll.cpp
r9344 r12989 50 50 * @see pg_raw 51 51 */ 52 PATMDECL(void) PATMRawEnter(PVM pVM, PCPUMCTXCORE pCtxCore)52 VMMDECL(void) PATMRawEnter(PVM pVM, PCPUMCTXCORE pCtxCore) 53 53 { 54 54 bool fPatchCode = PATMIsPatchGCAddr(pVM, (RTRCPTR)pCtxCore->eip); … … 124 124 * @see @ref pg_raw 125 125 */ 126 PATMDECL(void) PATMRawLeave(PVM pVM, PCPUMCTXCORE pCtxCore, int rawRC)126 VMMDECL(void) PATMRawLeave(PVM pVM, PCPUMCTXCORE pCtxCore, int rawRC) 127 127 { 128 128 bool fPatchCode = PATMIsPatchGCAddr(pVM, (RTRCPTR)pCtxCore->eip); … … 216 216 * @param pCtxCore The context core. 217 217 */ 218 PATMDECL(uint32_t) PATMRawGetEFlags(PVM pVM, PCCPUMCTXCORE pCtxCore)218 VMMDECL(uint32_t) PATMRawGetEFlags(PVM pVM, PCCPUMCTXCORE pCtxCore) 219 219 { 220 220 uint32_t efl = pCtxCore->eflags.u32; … … 232 232 * @param efl The new EFLAGS value. 233 233 */ 234 PATMDECL(void) PATMRawSetEFlags(PVM pVM, PCPUMCTXCORE pCtxCore, uint32_t efl)234 VMMDECL(void) PATMRawSetEFlags(PVM pVM, PCPUMCTXCORE pCtxCore, uint32_t efl) 235 235 { 236 236 pVM->patm.s.CTXSUFF(pGCState)->uVMFlags = efl & PATM_VIRTUAL_FLAGS_MASK; … … 246 246 * @param pAddrGC Guest context address 247 247 */ 248 PATMDECL(bool) PATMShouldUseRawMode(PVM pVM, RTRCPTR pAddrGC)248 VMMDECL(bool) PATMShouldUseRawMode(PVM pVM, RTRCPTR pAddrGC) 249 249 { 250 250 return ( PATMIsEnabled(pVM) … … 258 258 * @param pVM The VM to operate on. 259 259 */ 260 PATMDECL(RCPTRTYPE(PPATMGCSTATE)) PATMQueryGCState(PVM pVM)260 VMMDECL(RCPTRTYPE(PPATMGCSTATE)) PATMQueryGCState(PVM pVM) 261 261 { 262 262 return pVM->patm.s.pGCStateGC; … … 270 270 * @param pAddrGC Guest context address 271 271 */ 272 PATMDECL(bool) PATMIsPatchGCAddr(PVM pVM, RTRCPTR pAddrGC)272 VMMDECL(bool) PATMIsPatchGCAddr(PVM pVM, RTRCPTR pAddrGC) 273 273 { 274 274 return (PATMIsEnabled(pVM) && pAddrGC >= pVM->patm.s.pPatchMemGC && pAddrGC < (RTRCPTR)((RTRCUINTPTR)pVM->patm.s.pPatchMemGC + pVM->patm.s.cbPatchMem)) ? true : false; … … 283 283 * @param pCachedData GC pointer to cached data 284 284 */ 285 PATMDECL(int) PATMSetMMIOPatchInfo(PVM pVM, RTGCPHYS GCPhys, RTRCPTR pCachedData)285 VMMDECL(int) PATMSetMMIOPatchInfo(PVM pVM, RTGCPHYS GCPhys, RTRCPTR pCachedData) 286 286 { 287 287 pVM->patm.s.mmio.GCPhys = GCPhys; … … 299 299 * @param pVM The VM handle. 300 300 */ 301 PATMDECL(bool) PATMAreInterruptsEnabled(PVM pVM)301 VMMDECL(bool) PATMAreInterruptsEnabled(PVM pVM) 302 302 { 303 303 PCPUMCTX pCtx = 0; … … 319 319 * @param pCtxCore CPU context 320 320 */ 321 PATMDECL(bool) PATMAreInterruptsEnabledByCtxCore(PVM pVM, PCPUMCTXCORE pCtxCore)321 VMMDECL(bool) PATMAreInterruptsEnabledByCtxCore(PVM pVM, PCPUMCTXCORE pCtxCore) 322 322 { 323 323 if (PATMIsEnabled(pVM)) … … 337 337 * 338 338 */ 339 PATMDECL(PPATMPATCHREC) PATMQueryFunctionPatch(PVM pVM, RTRCPTR pInstrGC)339 VMMDECL(PPATMPATCHREC) PATMQueryFunctionPatch(PVM pVM, RTRCPTR pInstrGC) 340 340 { 341 341 PPATMPATCHREC pRec; … … 361 361 * @param pSize Original instruction size (out, optional) 362 362 */ 363 PATMDECL(bool) PATMIsInt3Patch(PVM pVM, RTRCPTR pInstrGC, uint32_t *pOpcode, uint32_t *pSize)363 VMMDECL(bool) PATMIsInt3Patch(PVM pVM, RTRCPTR pInstrGC, uint32_t *pOpcode, uint32_t *pSize) 364 364 { 365 365 PPATMPATCHREC pRec; … … 387 387 * @param pCpu Disassembly context 388 388 */ 389 PATMDECL(int) PATMSysCall(PVM pVM, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu)389 VMMDECL(int) PATMSysCall(PVM pVM, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu) 390 390 { 391 391 PCPUMCTX pCtx; … … 466 466 * @param pRelBranchPatch Relative duplicated function address 467 467 */ 468 PATMDECL(int) PATMAddBranchToLookupCache(PVM pVM, RTRCPTR pJumpTableGC, RTRCPTR pBranchTarget, RTRCUINTPTR pRelBranchPatch)468 VMMDECL(int) PATMAddBranchToLookupCache(PVM pVM, RTRCPTR pJumpTableGC, RTRCPTR pBranchTarget, RTRCUINTPTR pRelBranchPatch) 469 469 { 470 470 PPATCHJUMPTABLE pJumpTable; … … 532 532 * @param fPatchFlags Patch flags 533 533 */ 534 PATMDECL(const char *) patmGetInstructionString(uint32_t opcode, uint32_t fPatchFlags)534 VMMDECL(const char *) patmGetInstructionString(uint32_t opcode, uint32_t fPatchFlags) 535 535 { 536 536 const char *pszInstr = NULL; -
trunk/src/VBox/VMM/PATM/VMMGC/CSAMGC.cpp
r12305 r12989 63 63 * (If it's a EIP range this's the EIP, if not it's pvFault.) 64 64 */ 65 CSAMGCDECL(int) CSAMGCCodePageWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange)65 VMMRCDECL(int) CSAMGCCodePageWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 66 66 { 67 67 PPATMGCSTATE pPATMGCState; … … 79 79 Assert(pPATMGCState->fPIF || fPatchCode); 80 80 /** When patch code is executing instructions that must complete, then we must *never* interrupt it. */ 81 if (!pPATMGCState->fPIF && fPatchCode) 81 if (!pPATMGCState->fPIF && fPatchCode) 82 82 { 83 83 Log(("CSAMGCCodePageWriteHandler: fPIF=0 -> stack fault in patch generated code at %VGv!\n", pRegFrame->eip)); … … 95 95 96 96 uint32_t cpl; 97 97 98 98 if (pRegFrame->eflags.Bits.u1VM) 99 99 cpl = 3; -
trunk/src/VBox/VMM/PATM/VMMGC/PATMGC.cpp
r12855 r12989 63 63 * (If it's a EIP range this's the EIP, if not it's pvFault.) 64 64 */ 65 PATMGCDECL(int) PATMGCMonitorPage(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange)65 VMMRCDECL(int) PATMGCMonitorPage(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) 66 66 { 67 67 pVM->patm.s.pvFaultMonitor = (RTRCPTR)pvFault; … … 81 81 * 82 82 */ 83 PATMGCDECL(int) PATMGCHandleWriteToPatchPage(PVM pVM, PCPUMCTXCORE pRegFrame, RTRCPTR GCPtr, uint32_t cbWrite)83 VMMRCDECL(int) PATMGCHandleWriteToPatchPage(PVM pVM, PCPUMCTXCORE pRegFrame, RTRCPTR GCPtr, uint32_t cbWrite) 84 84 { 85 85 RTGCUINTPTR pWritePageStart, pWritePageEnd; … … 155 155 * @param pCtxCore The relevant core context. 156 156 */ 157 PATMDECL(int) PATMGCHandleIllegalInstrTrap(PVM pVM, PCPUMCTXCORE pRegFrame)157 VMMDECL(int) PATMGCHandleIllegalInstrTrap(PVM pVM, PCPUMCTXCORE pRegFrame) 158 158 { 159 159 PPATMPATCHREC pRec; … … 286 286 if (VBOX_SUCCESS(rc)) 287 287 { 288 STAM_COUNTER_INC(&pVM->patm.s.StatEmulIret); 288 STAM_COUNTER_INC(&pVM->patm.s.StatEmulIret); 289 289 290 290 /* We are no longer executing PATM code; set PIF again. */ … … 293 293 /* does not return */ 294 294 } 295 else 296 STAM_COUNTER_INC(&pVM->patm.s.StatEmulIretFailed); 295 else 296 STAM_COUNTER_INC(&pVM->patm.s.StatEmulIretFailed); 297 297 return rc; 298 298 } … … 443 443 * @param pCtxCore The relevant core context. 444 444 */ 445 PATMDECL(int) PATMHandleInt3PatchTrap(PVM pVM, PCPUMCTXCORE pRegFrame)445 VMMDECL(int) PATMHandleInt3PatchTrap(PVM pVM, PCPUMCTXCORE pRegFrame) 446 446 { 447 447 PPATMPATCHREC pRec;
Note:
See TracChangeset
for help on using the changeset viewer.