Changeset 103659 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Mar 4, 2024 10:43:32 AM (12 months ago)
- svn:sync-xref-src-repo-rev:
- 162019
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r103649 r103659 5135 5135 * RIP updates, since these are the most common ones. 5136 5136 */ 5137 DECL_HIDDEN_THROW(uint32_t) iemNativeRegFlushPendingWrites(PIEMRECOMPILERSTATE pReNative, uint32_t off )5137 DECL_HIDDEN_THROW(uint32_t) iemNativeRegFlushPendingWrites(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint64_t fGstShwExcept /*= 0*/) 5138 5138 { 5139 5139 #ifdef IEMNATIVE_WITH_DELAYED_PC_UPDATING 5140 off = iemNativeEmitPcWriteback(pReNative, off); 5141 #else 5142 RT_NOREF(pReNative); 5140 if (!(fGstShwExcept & kIemNativeGstReg_Pc)) 5141 off = iemNativeEmitPcWriteback(pReNative, off); 5142 #else 5143 RT_NOREF(pReNative, fGstShwExcept); 5143 5144 #endif 5144 5145 … … 11703 11704 * registers after returning from the call. Not sure if that's sensible or 11704 11705 * not, though. */ 11706 #ifndef IEMNATIVE_WITH_INSTRUCTION_COUNTING 11705 11707 off = iemNativeRegFlushPendingWrites(pReNative, off); 11708 #else 11709 /* The program counter is treated differently for now. */ 11710 off = iemNativeRegFlushPendingWrites(pReNative, off, RT_BIT_64(kIemNativeGstReg_Pc)); 11711 #endif 11706 11712 11707 11713 #ifdef IEMNATIVE_WITH_FREE_AND_FLUSH_VOLATILE_REGS_AT_TLB_LOOKUP … … 11754 11760 #endif 11755 11761 11762 #ifdef IEMNATIVE_WITH_DELAYED_PC_UPDATING 11763 if (pReNative->Core.offPc) 11764 { 11765 /* 11766 * Update the program counter but restore it at the end of the TlbMiss branch. 11767 * This should allow delaying more program counter updates for the TlbLookup and hit paths 11768 * which are hopefully much more frequent, reducing the amount of memory accesses. 11769 */ 11770 /* Allocate a temporary PC register. */ 11771 uint8_t const idxPcReg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_Pc, kIemNativeGstRegUse_ForUpdate); 11772 11773 /* Perform the addition and store the result. */ 11774 off = iemNativeEmitAddGprImm(pReNative, off, idxPcReg, pReNative->Core.offPc); 11775 off = iemNativeEmitStoreGprToVCpuU64(pReNative, off, idxPcReg, RT_UOFFSETOF(VMCPU, cpum.GstCtx.rip)); 11776 11777 /* Free and flush the PC register. */ 11778 iemNativeRegFreeTmp(pReNative, idxPcReg); 11779 iemNativeRegFlushGuestShadowsByHostMask(pReNative, RT_BIT_32(idxPcReg)); 11780 } 11781 #endif 11782 11756 11783 #ifndef IEMNATIVE_WITH_FREE_AND_FLUSH_VOLATILE_REGS_AT_TLB_LOOKUP 11757 11784 /* Save variables in volatile registers. */ … … 11811 11838 off = iemNativeVarRestoreVolatileRegsPostHlpCall(pReNative, off, fHstRegsNotToSave); 11812 11839 off = iemNativeRegRestoreGuestShadowsInVolatileRegs(pReNative, off, TlbState.getActiveRegsWithShadows()); 11840 #endif 11841 11842 #ifdef IEMNATIVE_WITH_DELAYED_PC_UPDATING 11843 if (pReNative->Core.offPc) 11844 { 11845 /* 11846 * Time to restore the program counter to its original value. 11847 */ 11848 /* Allocate a temporary PC register. */ 11849 uint8_t const idxPcReg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_Pc, kIemNativeGstRegUse_ForUpdate); 11850 11851 /* Restore the original value. */ 11852 off = iemNativeEmitSubGprImm(pReNative, off, idxPcReg, pReNative->Core.offPc); 11853 off = iemNativeEmitStoreGprToVCpuU64(pReNative, off, idxPcReg, RT_UOFFSETOF(VMCPU, cpum.GstCtx.rip)); 11854 11855 /* Free and flush the PC register. */ 11856 iemNativeRegFreeTmp(pReNative, idxPcReg); 11857 iemNativeRegFlushGuestShadowsByHostMask(pReNative, RT_BIT_32(idxPcReg)); 11858 } 11813 11859 #endif 11814 11860 -
trunk/src/VBox/VMM/include/IEMN8veRecompiler.h
r103649 r103659 1232 1232 DECLHIDDEN(void) iemNativeRegFreeVar(PIEMRECOMPILERSTATE pReNative, uint8_t idxHstReg, bool fFlushShadows) RT_NOEXCEPT; 1233 1233 DECLHIDDEN(void) iemNativeRegFreeAndFlushMask(PIEMRECOMPILERSTATE pReNative, uint32_t fHstRegMask) RT_NOEXCEPT; 1234 DECL_HIDDEN_THROW(uint32_t) iemNativeRegFlushPendingWrites(PIEMRECOMPILERSTATE pReNative, uint32_t off );1234 DECL_HIDDEN_THROW(uint32_t) iemNativeRegFlushPendingWrites(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint64_t fGstShwExept = 0); 1235 1235 DECL_HIDDEN_THROW(uint32_t) iemNativeRegMoveAndFreeAndFlushAtCall(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t cArgs, 1236 1236 uint32_t fKeepVars = 0);
Note:
See TracChangeset
for help on using the changeset viewer.