Changeset 97334 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Oct 28, 2022 2:17:25 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154331
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/IEMInline.h
r97289 r97334 1563 1563 } 1564 1564 1565 1565 #if 0 /* unused and buggy */ 1566 1566 /** 1567 1567 * Updates the RIP/EIP/IP to point to the next instruction. … … 1593 1593 } 1594 1594 } 1595 1595 #endif 1596 1596 1597 1597 #if 0 … … 1606 1606 } 1607 1607 #endif 1608 1609 1610 1608 1611 1609 /** … … 1618 1616 DECLINLINE(void) iemRegAddToRipAndClearRF(PVMCPUCC pVCpu, uint8_t cbInstr) 1619 1617 { 1620 /* Clear RF and interrupt shadowing: */ 1618 /* 1619 * Advance RIP. 1620 * 1621 * When we're targetting 8086/8, 80186/8 or 80286 mode the updates are 16-bit, 1622 * while in all other modes except LM64 the updates are 32-bit. This means 1623 * we need to watch for both 32-bit and 16-bit "carry" situations, i.e. 1624 * 4GB and 64KB rollovers, and decide whether anything needs masking. 1625 * 1626 * See PC wrap around tests in bs3-cpu-weird-1. 1627 */ 1628 uint64_t const uRipPrev = pVCpu->cpum.GstCtx.rip; 1629 uint64_t const uRipNext = uRipPrev + cbInstr; 1630 if (RT_LIKELY( !((uRipNext ^ uRipPrev) & (RT_BIT_64(32) | RT_BIT_64(16))) 1631 || CPUMIsGuestIn64BitCodeEx(&pVCpu->cpum.GstCtx))) 1632 pVCpu->cpum.GstCtx.rip = uRipNext; 1633 else if (IEM_GET_TARGET_CPU(pVCpu) >= IEMTARGETCPU_386) 1634 pVCpu->cpum.GstCtx.rip = (uint32_t)uRipNext; 1635 else 1636 pVCpu->cpum.GstCtx.rip = (uint16_t)uRipNext; 1637 1638 /* 1639 * Clear RF and interrupt shadowing. 1640 */ 1621 1641 AssertCompile(CPUMCTX_INHIBIT_SHADOW < UINT32_MAX); 1622 1642 pVCpu->cpum.GstCtx.eflags.uBoth &= ~(X86_EFL_RF | CPUMCTX_INHIBIT_SHADOW); 1623 1624 /* Update RIP: */1625 #if ARCH_BITS >= 641626 AssertCompile(IEMMODE_16BIT == 0 && IEMMODE_32BIT == 1 && IEMMODE_64BIT == 2);1627 static uint64_t const s_aRipMasks[] = { UINT64_C(0xffffffff), UINT64_C(0xffffffff), UINT64_MAX };1628 Assert(pVCpu->cpum.GstCtx.rip <= s_aRipMasks[(unsigned)pVCpu->iem.s.enmCpuMode]);1629 pVCpu->cpum.GstCtx.rip = (pVCpu->cpum.GstCtx.rip + cbInstr) & s_aRipMasks[(unsigned)pVCpu->iem.s.enmCpuMode];1630 #else1631 if (pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT)1632 pVCpu->cpum.GstCtx.rip += cbInstr;1633 else1634 pVCpu->cpum.GstCtx.eip += cbInstr;1635 #endif1636 1643 } 1637 1644
Note:
See TracChangeset
for help on using the changeset viewer.