- Timestamp:
- Apr 12, 2007 1:04:07 PM (18 years ago)
- Location:
- trunk/src/VBox/VMM/PATM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PATM/PATM.cpp
r2030 r2043 1662 1662 Log(("Force recompilation of next instruction for OP_MOV at %VGv\n", pCurInstrGC)); 1663 1663 pPatch->flags |= PATMFL_RECOMPILE_NEXT; 1664 } 1664 /** @todo this could cause a fault (ring 0 selector being loaded in ring 1) */ 1665 } 1666 #if 0 1667 else 1668 if ( (pCpu->param2.flags & USE_REG_SEG) 1669 && (pCpu->param2.base.reg_seg == USE_REG_SS) 1670 && (pCpu->param1.flags & (USE_REG_GEN32|USE_REG_GEN16))) /** @todo memory operand must in theory be handled too */ 1671 { 1672 /* mov GPR, ss */ 1673 rc = patmPatchGenMovFromSS(pVM, pPatch, pCpu); 1674 if (VBOX_SUCCESS(rc)) 1675 rc = VWRN_CONTINUE_RECOMPILE; 1676 break; 1677 } 1678 #endif 1665 1679 } 1666 1680 goto duplicate_instr; -
trunk/src/VBox/VMM/PATM/PATMA.asm
r1914 r2043 2533 2533 DD 0ffffffffh 2534 2534 2535 2536 ; push ss, check and correct RPL 2537 BEGINPROC PATMMovFromSS 2538 PATMMovFromSS_Start: 2539 push ss 2540 push eax 2541 pushfd 2542 mov ax, ss 2543 and ax, 3 2544 cmp ax, 1 2545 jne near PATMMovFromSS_Continue 2546 2547 and dword [esp+8], ~3 ; clear RPL 1 2548 PATMMovFromSS_Continue: 2549 popfd 2550 pop eax 2551 add esp, 2 ; ss popped off as 16 bits value 2552 PATMMovFromSS_Start_End: 2553 ENDPROC PATMMovFromSS 2554 2555 GLOBALNAME PATMMovFromSSRecord 2556 RTCCPTR_DEF PATMMovFromSS_Start 2557 DD 0 2558 DD 0 2559 DD PATMMovFromSS_Start_End - PATMMovFromSS_Start 2560 DD 0 2561 DD 0 2562 DD 0ffffffffh 2563 2564 2565 2566 2535 2567 ; For assertion during init (to make absolutely sure the flags are in sync in vm.mac & vm.h) 2536 2568 GLOBALNAME PATMInterruptFlag -
trunk/src/VBox/VMM/PATM/PATMA.h
r1438 r2043 184 184 extern PATCHASMRECORD PATMClearInhibitIRQContIF0Record; 185 185 186 extern PATCHASMRECORD PATMMovFromSSRecord; 187 186 188 extern uint32_t PATMInterruptFlag; 187 189 #ifdef __cplusplus -
trunk/src/VBox/VMM/PATM/PATMPatch.cpp
r2030 r2043 1278 1278 } 1279 1279 1280 /* 1281 * mov GPR, SS 1282 */ 1283 int patmPatchGenMovFromSS(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu) 1284 { 1285 uint32_t size, offset; 1286 1287 PATCHGEN_PROLOG(pVM, pPatch); 1288 size = patmPatchGenCode(pVM, pPatch, pPB, &PATMSetPIFRecord, 0, false); 1289 PATCHGEN_EPILOG(pPatch, size); 1290 1291 /* pushes ss, checks and corrects RPL */ 1292 PATCHGEN_PROLOG_NODEF(pVM, pPatch); 1293 size = patmPatchGenCode(pVM, pPatch, pPB, &PATMMovFromSSRecord, 0, false); 1294 PATCHGEN_EPILOG(pPatch, size); 1295 1296 /* pop general purpose register */ 1297 PATCHGEN_PROLOG_NODEF(pVM, pPatch); 1298 offset = 0; 1299 if (pPatch->flags & PATMFL_CODE32) 1300 pPB[offset++] = 0x66; /* size override -> 16 bits pop */ 1301 pPB[offset++] = 0x50 + pCpu->param1.base.reg_gen32; 1302 PATCHGEN_EPILOG(pPatch, offset); 1303 1304 1305 PATCHGEN_PROLOG_NODEF(pVM, pPatch); 1306 size = patmPatchGenCode(pVM, pPatch, pPB, &PATMClearPIFRecord, 0, false); 1307 PATCHGEN_EPILOG(pPatch, size); 1308 1309 return VINF_SUCCESS; 1310 } 1311 1280 1312 1281 1313 /** -
trunk/src/VBox/VMM/PATM/PATMPatch.h
r2030 r2043 30 30 int patmPatchGenMovControl(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu); 31 31 int patmPatchGenMovDebug(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu); 32 int patmPatchGenMovFromSS(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu); 32 33 int patmPatchGenRelJump(PVM pVM, PPATCHINFO pPatch, GCPTRTYPE(uint8_t *)pTargetGC, uint32_t opcode, bool fSizeOverride); 33 34 int patmPatchGenLoop(PVM pVM, PPATCHINFO pPatch, GCPTRTYPE(uint8_t *)pTargetGC, uint32_t opcode, bool fSizeOverride);
Note:
See TracChangeset
for help on using the changeset viewer.