Changeset 97370 in vbox for trunk/src/VBox/VMM/include
- Timestamp:
- Nov 2, 2022 12:53:30 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154368
- Location:
- trunk/src/VBox/VMM/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/IEMInline.h
r97358 r97370 1614 1614 * @param cbInstr The number of bytes to add. 1615 1615 */ 1616 DECLINLINE(VBOXSTRICTRC) iemRegAddToRipAnd ClearRF(PVMCPUCC pVCpu, uint8_t cbInstr)1616 DECLINLINE(VBOXSTRICTRC) iemRegAddToRipAndFinishingClearingRF(PVMCPUCC pVCpu, uint8_t cbInstr) 1617 1617 { 1618 1618 /* … … 1647 1647 1648 1648 /** 1649 * Extended version of iemRegAddToRipAndFinishingClearingRF for use by POPF and 1650 * others potentially updating EFLAGS.TF. 1651 * 1652 * The single step event must be generated using the TF value at the start of 1653 * the instruction, not the new value set by it. 1654 * 1655 * @param pVCpu The cross context virtual CPU structure of the calling thread. 1656 * @param cbInstr The number of bytes to add. 1657 * @param fEflOld The EFLAGS at the start of the instruction 1658 * execution. 1659 */ 1660 DECLINLINE(VBOXSTRICTRC) iemRegAddToRipAndFinishingClearingRfEx(PVMCPUCC pVCpu, uint8_t cbInstr, uint32_t fEflOld) 1661 { 1662 /* 1663 * Advance RIP. 1664 * 1665 * When we're targetting 8086/8, 80186/8 or 80286 mode the updates are 16-bit, 1666 * while in all other modes except LM64 the updates are 32-bit. This means 1667 * we need to watch for both 32-bit and 16-bit "carry" situations, i.e. 1668 * 4GB and 64KB rollovers, and decide whether anything needs masking. 1669 * 1670 * See PC wrap around tests in bs3-cpu-weird-1. 1671 */ 1672 uint64_t const uRipPrev = pVCpu->cpum.GstCtx.rip; 1673 uint64_t const uRipNext = uRipPrev + cbInstr; 1674 if (RT_LIKELY( !((uRipNext ^ uRipPrev) & (RT_BIT_64(32) | RT_BIT_64(16))) 1675 || CPUMIsGuestIn64BitCodeEx(&pVCpu->cpum.GstCtx))) 1676 pVCpu->cpum.GstCtx.rip = uRipNext; 1677 else if (IEM_GET_TARGET_CPU(pVCpu) >= IEMTARGETCPU_386) 1678 pVCpu->cpum.GstCtx.rip = (uint32_t)uRipNext; 1679 else 1680 pVCpu->cpum.GstCtx.rip = (uint16_t)uRipNext; 1681 1682 /* 1683 * Clear RF and interrupt shadowing. 1684 */ 1685 AssertCompile(CPUMCTX_INHIBIT_SHADOW < UINT32_MAX); 1686 pVCpu->cpum.GstCtx.eflags.uBoth &= ~(X86_EFL_RF | CPUMCTX_INHIBIT_SHADOW); 1687 1688 RT_NOREF(fEflOld); 1689 return VINF_SUCCESS; 1690 } 1691 1692 1693 /** 1649 1694 * Updates the RIP/EIP/IP to point to the next instruction and clears EFLAGS.RF. 1650 1695 * 1651 1696 * @param pVCpu The cross context virtual CPU structure of the calling thread. 1652 1697 */ 1653 DECLINLINE(VBOXSTRICTRC) iemRegUpdateRipAnd ClearRF(PVMCPUCC pVCpu)1654 { 1655 return iemRegAddToRipAnd ClearRF(pVCpu, IEM_GET_INSTR_LEN(pVCpu));1698 DECLINLINE(VBOXSTRICTRC) iemRegUpdateRipAndFinishClearingRF(PVMCPUCC pVCpu) 1699 { 1700 return iemRegAddToRipAndFinishingClearingRF(pVCpu, IEM_GET_INSTR_LEN(pVCpu)); 1656 1701 } 1657 1702 -
trunk/src/VBox/VMM/include/IEMMc.h
r97358 r97370 55 55 /** Advances RIP, finishes the instruction and returns. 56 56 * This may include raising debug exceptions and such. */ 57 #define IEM_MC_ADVANCE_RIP_AND_FINISH() return iemRegUpdateRipAnd ClearRF(pVCpu)57 #define IEM_MC_ADVANCE_RIP_AND_FINISH() return iemRegUpdateRipAndFinishClearingRF(pVCpu) 58 58 /** Sets RIP (may trigger \#GP), finishes the instruction and returns. */ 59 59 #define IEM_MC_REL_JMP_S8_AND_FINISH(a_i8) return iemRegRipRelativeJumpS8(pVCpu, (a_i8))
Note:
See TracChangeset
for help on using the changeset viewer.