Changeset 33540 in vbox for trunk/src/VBox/VMM/PATM
- Timestamp:
- Oct 28, 2010 9:27:05 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 67140
- Location:
- trunk/src/VBox/VMM/PATM
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PATM/CSAM.cpp
r32431 r33540 230 230 231 231 /* 232 * Register save and load state notifi cators.232 * Register save and load state notifiers. 233 233 */ 234 234 rc = SSMR3RegisterInternal(pVM, "CSAM", 0, CSAM_SSM_VERSION, sizeof(pVM->csam.s) + PAGE_SIZE*16, -
trunk/src/VBox/VMM/PATM/CSAMInternal.h
r30500 r33540 186 186 /* Set when the IDT gates have been checked for the first time. */ 187 187 bool fGatesChecked; 188 bool Alignment1[HC_ARCH_BITS == 32 ? 6 : 2]; /**< Align the stats on an 8-byte bound rary. */188 bool Alignment1[HC_ARCH_BITS == 32 ? 6 : 2]; /**< Align the stats on an 8-byte boundary. */ 189 189 190 190 STAMCOUNTER StatNrTraps; -
trunk/src/VBox/VMM/PATM/PATM.cpp
r31438 r33540 168 168 169 169 /* 170 * Register save and load state notifi cators.170 * Register save and load state notifiers. 171 171 */ 172 172 rc = SSMR3RegisterInternal(pVM, "PATM", 0, PATM_SSM_VERSION, sizeof(pVM->patm.s) + PATCH_MEMORY_SIZE + PAGE_SIZE + PATM_STACK_TOTAL_SIZE + PAGE_SIZE, … … 1307 1307 else 1308 1308 { 1309 /* No unconditi nal jumps or calls without fixed displacements. */1309 /* No unconditional jumps or calls without fixed displacements. */ 1310 1310 if ( (pCpu->pCurInstr->optype & OPTYPE_CONTROLFLOW) 1311 1311 && (pCpu->pCurInstr->opcode == OP_JMP || pCpu->pCurInstr->opcode == OP_CALL) … … 1463 1463 else 1464 1464 { 1465 // no unconditi nal jumps or calls without fixed displacements1465 // no unconditional jumps or calls without fixed displacements 1466 1466 if ( (pCpu->pCurInstr->optype & OPTYPE_CONTROLFLOW) 1467 1467 && (pCpu->pCurInstr->opcode == OP_JMP || pCpu->pCurInstr->opcode == OP_CALL) … … 5552 5552 { 5553 5553 PPATMPATCHREC pPatchRec = (PPATMPATCHREC)RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC, false); 5554 /* if the patch is enabled, the pointer is not i ndentical to the privileged patch ptr and it lies within 5 bytes of this priv instr ptr, then we've got a hit! */5554 /* if the patch is enabled, the pointer is not identical to the privileged patch ptr and it lies within 5 bytes of this priv instr ptr, then we've got a hit! */ 5555 5555 if (pPatchRec) 5556 5556 { -
trunk/src/VBox/VMM/PATM/PATMA.asm
r28800 r33540 735 735 PATMPopf32_Ok: 736 736 ; Note: we don't allow popf instructions to change the current IOPL; we simply ignore such changes (!!!) 737 ; In this particular patch it's rather unlikely the pushf was included, so we have no way to check if the flags on the stack were correctly sync hed737 ; In this particular patch it's rather unlikely the pushf was included, so we have no way to check if the flags on the stack were correctly synced 738 738 ; PATMPopf32Replacement_NoExit is different, because it's only used in IDT and function patches 739 739 or dword [ss:PATM_VMFLAGS], X86_EFL_IF … … 1232 1232 1233 1233 ; if interrupts are pending, then we must go back to the host context to handle them! 1234 ; Note: This is very important as pending pic interrupts can be overrid en by apic interrupts if we don't check early enough (Fedora 5 boot)1234 ; Note: This is very important as pending pic interrupts can be overridden by apic interrupts if we don't check early enough (Fedora 5 boot) 1235 1235 ; @@todo fix this properly, so we can dispatch pending interrupts in GC 1236 1236 test dword [ss:PATM_VM_FORCEDACTIONS], VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC -
trunk/src/VBox/VMM/PATM/PATMA.h
r28800 r33540 36 36 #define PATM_CPUID_EXT_PTR 0xF1ABCD0a 37 37 #define PATM_CPUID_DEF_PTR 0xF1ABCD0b 38 #define PATM_STACKBASE 0xF1ABCD0c /** Stack to store our private patch return add esses */38 #define PATM_STACKBASE 0xF1ABCD0c /** Stack to store our private patch return addresses */ 39 39 #define PATM_STACKBASE_GUEST 0xF1ABCD0d /** Stack to store guest return addresses */ 40 40 #define PATM_STACKPTR 0xF1ABCD0e -
trunk/src/VBox/VMM/PATM/PATMA.mac
r28800 r33540 35 35 %define PATM_CPUID_EXT_PTR 0xF1ABCD0a 36 36 %define PATM_CPUID_DEF_PTR 0xF1ABCD0b 37 %define PATM_STACKBASE 0xF1ABCD0c ;/** Stack to store our private patch return add esses */37 %define PATM_STACKBASE 0xF1ABCD0c ;/** Stack to store our private patch return addresses */ 38 38 %define PATM_STACKBASE_GUEST 0xF1ABCD0d ;/** Stack to store guest return addresses */ 39 39 %define PATM_STACKPTR 0xF1ABCD0e -
trunk/src/VBox/VMM/PATM/PATMInternal.h
r30572 r33540 233 233 int32_t nrCalls; 234 234 235 /** Last original guest instruction pointer; used for disass mebly log. */235 /** Last original guest instruction pointer; used for disassembly log. */ 236 236 RTRCPTR pLastDisasmInstrGC; 237 237 … … 312 312 /* First opcode byte, that's overwritten when a patch is marked dirty. */ 313 313 uint8_t bDirtyOpcode; 314 uint8_t Alignment2[7]; /**< Align the structure size on a 8-byte bound rary. */314 uint8_t Alignment2[7]; /**< Align the structure size on a 8-byte boundary. */ 315 315 } PATCHINFO, *PPATCHINFO; 316 316 … … 454 454 RTGCPHYS GCPhys; 455 455 RTRCPTR pCachedData; 456 RTRCPTR Alignment0; /**< Align the structure size on a 8-byte bound rary. */456 RTRCPTR Alignment0; /**< Align the structure size on a 8-byte boundary. */ 457 457 } mmio; 458 458 … … 463 463 uint32_t cPatches; 464 464 #if HC_ARCH_BITS == 64 465 uint32_t Alignment0; /**< Align the structure size on a 8-byte bound rary. */465 uint32_t Alignment0; /**< Align the structure size on a 8-byte boundary. */ 466 466 #endif 467 467 } savedstate; … … 524 524 STAMCOUNTER StatFunctionLookupInsert; 525 525 uint32_t StatU32FunctionMaxSlotsUsed; 526 uint32_t Alignment0; /**< Align the structure size on a 8-byte bound rary. */526 uint32_t Alignment0; /**< Align the structure size on a 8-byte boundary. */ 527 527 } PATM, *PPATM; 528 528 … … 707 707 * #PF Virtual Handler callback for Guest access a page monitored by PATM 708 708 * 709 * @returns VBox status code (appropri tate for trap handling and GC return).709 * @returns VBox status code (appropriate for trap handling and GC return). 710 710 * @param pVM VM Handle. 711 711 * @param uErrorCode CPU Error code. … … 714 714 * @param pvRange The base address of the handled virtual range. 715 715 * @param offRange The offset of the access into this range. 716 * (If it's a EIP range this 's the EIP, if not it's pvFault.)716 * (If it's a EIP range this is the EIP, if not it's pvFault.) 717 717 */ 718 718 VMMRCDECL(int) PATMGCMonitorPage(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange); -
trunk/src/VBox/VMM/PATM/PATMPatch.cpp
r28800 r33540 214 214 break; 215 215 216 case PATM_CALLTARGET: /* relative to patch address; no fixup requir d */216 case PATM_CALLTARGET: /* relative to patch address; no fixup required */ 217 217 Assert(pCallInfo && pAsmRecord->uReloc[i] >= PATM_NO_FIXUP); 218 218 -
trunk/src/VBox/VMM/PATM/VMMAll/PATMAll.cpp
r28800 r33540 41 41 * 42 42 * This function is called from CPUMRawEnter(). It doesn't have to update the 43 * IF and IOPL eflags bits, the caller will enforce those to set and 0 re pectively.43 * IF and IOPL eflags bits, the caller will enforce those to set and 0 respectively. 44 44 * 45 45 * @param pVM VM handle. … … 289 289 * 290 290 * @returns true if it's enabled. 291 * @returns false if it's di abled.291 * @returns false if it's disabled. 292 292 * 293 293 * @param pVM The VM handle. … … 304 304 * 305 305 * @returns true if it's enabled. 306 * @returns false if it's di abled.306 * @returns false if it's disabled. 307 307 * 308 308 * @param pVM The VM handle. -
trunk/src/VBox/VMM/PATM/VMMGC/CSAMGC.cpp
r30326 r33540 58 58 * @param pvRange The base address of the handled virtual range. 59 59 * @param offRange The offset of the access into this range. 60 * (If it's a EIP range this 's the EIP, if not it's pvFault.)60 * (If it's a EIP range this is the EIP, if not it's pvFault.) 61 61 */ 62 62 VMMRCDECL(int) CSAMGCCodePageWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange) -
trunk/src/VBox/VMM/PATM/VMMGC/PATMGC.cpp
r31636 r33540 48 48 * \#PF Virtual Handler callback for Guest access a page monitored by PATM 49 49 * 50 * @returns VBox status code (appropri tate for trap handling and GC return).50 * @returns VBox status code (appropriate for trap handling and GC return). 51 51 * @param pVM VM Handle. 52 52 * @param uErrorCode CPU Error code. … … 55 55 * @param pvRange The base address of the handled virtual range. 56 56 * @param offRange The offset of the access into this range. 57 * (If it's a EIP range this 's the EIP, if not it's pvFault.)57 * (If it's a EIP range this is the EIP, if not it's pvFault.) 58 58 */ 59 59 VMMRCDECL(int) PATMGCMonitorPage(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange)
Note:
See TracChangeset
for help on using the changeset viewer.