Changeset 47744 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Aug 14, 2013 11:49:48 PM (11 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r47740 r47744 6479 6479 RTGCPTR GCPtrTop = iemRegGetRspForPush(pIemCpu, pCtx, 4, &uNewRsp); 6480 6480 6481 /* Write the word the lazy way. */6481 /* Write the dword the lazy way. */ 6482 6482 uint32_t *pu32Dst; 6483 6483 VBOXSTRICTRC rc = iemMemMap(pIemCpu, (void **)&pu32Dst, sizeof(*pu32Dst), X86_SREG_SS, GCPtrTop, IEM_ACCESS_STACK_W); … … 6486 6486 *pu32Dst = u32Value; 6487 6487 rc = iemMemCommitAndUnmap(pIemCpu, pu32Dst, IEM_ACCESS_STACK_W); 6488 } 6489 6490 /* Commit the new RSP value unless we an access handler made trouble. */ 6491 if (rc == VINF_SUCCESS) 6492 pCtx->rsp = uNewRsp; 6493 6494 return rc; 6495 } 6496 6497 6498 /** 6499 * Pushes a dword segment register value onto the stack. 6500 * 6501 * @returns Strict VBox status code. 6502 * @param pIemCpu The IEM per CPU data. 6503 * @param u16Value The value to push. 6504 */ 6505 static VBOXSTRICTRC iemMemStackPushU32SReg(PIEMCPU pIemCpu, uint32_t u32Value) 6506 { 6507 /* Increment the stack pointer. */ 6508 uint64_t uNewRsp; 6509 PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx); 6510 RTGCPTR GCPtrTop = iemRegGetRspForPush(pIemCpu, pCtx, 4, &uNewRsp); 6511 6512 VBOXSTRICTRC rc; 6513 if (IEM_FULL_VERIFICATION_REM_ENABLED(pIemCpu)) 6514 { 6515 /* The recompiler writes a full dword. */ 6516 uint32_t *pu32Dst; 6517 rc = iemMemMap(pIemCpu, (void **)&pu32Dst, sizeof(*pu32Dst), X86_SREG_SS, GCPtrTop, IEM_ACCESS_STACK_W); 6518 if (rc == VINF_SUCCESS) 6519 { 6520 *pu32Dst = u32Value; 6521 rc = iemMemCommitAndUnmap(pIemCpu, pu32Dst, IEM_ACCESS_STACK_W); 6522 } 6523 } 6524 else 6525 { 6526 /* The intel docs talks about zero extending the selector register 6527 value. My actual intel CPU here might be zero extending the value 6528 but it still only writes the lower word... */ 6529 /** @todo Test this on new HW and on AMD and in 64-bit mode. Also test what 6530 * happens when crossing an electric page boundrary, is the high word 6531 * checked for write accessibility or not? Probably it is. What about 6532 * segment limits? */ 6533 uint16_t *pu16Dst; 6534 rc = iemMemMap(pIemCpu, (void **)&pu16Dst, sizeof(uint32_t), X86_SREG_SS, GCPtrTop, IEM_ACCESS_STACK_RW); 6535 if (rc == VINF_SUCCESS) 6536 { 6537 *pu16Dst = (uint16_t)u32Value; 6538 rc = iemMemCommitAndUnmap(pIemCpu, pu16Dst, IEM_ACCESS_STACK_RW); 6539 } 6488 6540 } 6489 6541 … … 7619 7671 #define IEM_MC_PUSH_U32(a_u32Value) \ 7620 7672 IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU32(pIemCpu, (a_u32Value))) 7673 #define IEM_MC_PUSH_U32_SREG(a_u32Value) \ 7674 IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU32SReg(pIemCpu, (a_u32Value))) 7621 7675 #define IEM_MC_PUSH_U64(a_u64Value) \ 7622 7676 IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU64(pIemCpu, (a_u64Value))) -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r47740 r47744 4331 4331 IEM_MC_LOCAL(uint32_t, u32Value); 4332 4332 IEM_MC_FETCH_SREG_ZX_U32(u32Value, iReg); 4333 IEM_MC_PUSH_U32 (u32Value);4333 IEM_MC_PUSH_U32_SREG(u32Value); 4334 4334 IEM_MC_ADVANCE_RIP(); 4335 4335 IEM_MC_END();
Note:
See TracChangeset
for help on using the changeset viewer.