- Timestamp:
- Mar 4, 2024 12:50:11 PM (7 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
-
VMMAll/IEMAll.cpp (modified) (1 diff)
-
VMMAll/IEMAllInstPython.py (modified) (1 diff)
-
VMMAll/IEMAllN8veRecompiler.cpp (modified) (7 diffs)
-
include/IEMInternal.h (modified) (1 diff)
-
include/IEMN8veRecompiler.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r103592 r103665 4498 4498 return iemRegUpdateRipAndFinishClearingRF(pVCpu); 4499 4499 } 4500 4501 #ifdef IEM_WITH_SETJMP 4502 /** \#MF(0) - 10, longjmp. */ 4503 DECL_NO_RETURN(void) iemRaiseMathFaultJmp(PVMCPUCC pVCpu) IEM_NOEXCEPT_MAY_LONGJMP 4504 { 4505 IEM_DO_LONGJMP(pVCpu, VBOXSTRICTRC_VAL(iemRaiseMathFault(pVCpu))); 4506 } 4507 #endif 4500 4508 4501 4509 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstPython.py
r103663 r103665 3125 3125 'IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT': (McBlock.parseMcGeneric, True, True, True, ), 3126 3126 'IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE': (McBlock.parseMcGeneric, True, True, True, ), 3127 'IEM_MC_MAYBE_RAISE_FPU_XCPT': (McBlock.parseMcGeneric, True, True, False,),3127 'IEM_MC_MAYBE_RAISE_FPU_XCPT': (McBlock.parseMcGeneric, True, True, True, ), 3128 3128 'IEM_MC_MAYBE_RAISE_FSGSBASE_XCPT': (McBlock.parseMcGeneric, True, True, False, ), 3129 3129 'IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT': (McBlock.parseMcGeneric, True, True, False, ), -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r103664 r103665 1622 1622 1623 1623 /** 1624 * Used by TB code when it wants to raise a \#MF. 1625 */ 1626 IEM_DECL_NATIVE_HLP_DEF(int, iemNativeHlpExecRaiseMf,(PVMCPUCC pVCpu)) 1627 { 1628 iemRaiseMathFaultJmp(pVCpu); 1629 #ifndef _MSC_VER 1630 return VINF_IEM_RAISED_XCPT; /* not reached */ 1631 #endif 1632 } 1633 1634 1635 /** 1624 1636 * Used by TB code when detecting opcode changes. 1625 1637 * @see iemThreadeFuncWorkerObsoleteTb … … 2934 2946 pReNative->Core.u64ArgVars = UINT64_MAX; 2935 2947 2936 AssertCompile(RT_ELEMENTS(pReNative->aidxUniqueLabels) == 1 1);2948 AssertCompile(RT_ELEMENTS(pReNative->aidxUniqueLabels) == 12); 2937 2949 pReNative->aidxUniqueLabels[0] = UINT32_MAX; 2938 2950 pReNative->aidxUniqueLabels[1] = UINT32_MAX; … … 2946 2958 pReNative->aidxUniqueLabels[9] = UINT32_MAX; 2947 2959 pReNative->aidxUniqueLabels[10] = UINT32_MAX; 2960 pReNative->aidxUniqueLabels[11] = UINT32_MAX; 2948 2961 2949 2962 /* Full host register reinit: */ … … 5947 5960 5948 5961 /** 5962 * Emits the code at the RaiseMf label. 5963 */ 5964 static uint32_t iemNativeEmitRaiseMf(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint32_t idxReturnLabel) 5965 { 5966 uint32_t const idxLabel = iemNativeLabelFind(pReNative, kIemNativeLabelType_RaiseMf); 5967 if (idxLabel != UINT32_MAX) 5968 { 5969 iemNativeLabelDefine(pReNative, idxLabel, off); 5970 5971 /* iemNativeHlpExecRaiseMf(PVMCPUCC pVCpu) */ 5972 off = iemNativeEmitLoadGprFromGpr(pReNative, off, IEMNATIVE_CALL_ARG0_GREG, IEMNATIVE_REG_FIXED_PVMCPU); 5973 off = iemNativeEmitCallImm(pReNative, off, (uintptr_t)iemNativeHlpExecRaiseMf); 5974 5975 /* jump back to the return sequence. */ 5976 off = iemNativeEmitJmpToLabel(pReNative, off, idxReturnLabel); 5977 } 5978 return off; 5979 } 5980 5981 5982 /** 5949 5983 * Emits the code at the ReturnWithFlags label (returns 5950 5984 * VINF_IEM_REEXEC_FINISH_WITH_FLAGS). … … 6946 6980 /* Free but don't flush the CR0 register. */ 6947 6981 iemNativeRegFreeTmp(pReNative, idxCr0Reg); 6982 6983 return off; 6984 } 6985 6986 6987 #define IEM_MC_MAYBE_RAISE_FPU_XCPT() \ 6988 off = iemNativeEmitMaybeFpuException(pReNative, off, pCallEntry->idxInstr) 6989 6990 /** 6991 * Emits code to check if a \#MF exception should be raised. 6992 * 6993 * @returns New code buffer offset, UINT32_MAX on failure. 6994 * @param pReNative The native recompile state. 6995 * @param off The code buffer offset. 6996 * @param idxInstr The current instruction. 6997 */ 6998 DECL_INLINE_THROW(uint32_t) 6999 iemNativeEmitMaybeRaiseFpuException(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxInstr) 7000 { 7001 /* 7002 * Make sure we don't have any outstanding guest register writes as we may 7003 * raise an #MF and all guest register must be up to date in CPUMCTX. 7004 * 7005 * @todo r=aeichner Can we postpone this to the RaiseMf path? 7006 */ 7007 off = iemNativeRegFlushPendingWrites(pReNative, off); 7008 7009 #ifdef IEMNATIVE_WITH_INSTRUCTION_COUNTING 7010 off = iemNativeEmitStoreImmToVCpuU8(pReNative, off, idxInstr, RT_UOFFSETOF(VMCPUCC, iem.s.idxTbCurInstr)); 7011 #else 7012 RT_NOREF(idxInstr); 7013 #endif 7014 7015 /* Allocate a temporary FSW register. */ 7016 uint8_t const idxFpuFswReg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_FpuFsw, kIemNativeGstRegUse_ReadOnly); 7017 uint8_t const idxLabelRaiseMf = iemNativeLabelCreate(pReNative, kIemNativeLabelType_RaiseMf); 7018 7019 /* 7020 * if (FSW & X86_FSW_ES != 0) 7021 * return raisexcpt(); 7022 */ 7023 /* Test and jump. */ 7024 off = iemNativeEmitTestAnyBitsInGprAndJmpToLabelIfAnySet(pReNative, off, idxFpuFswReg, X86_FSW_ES, idxLabelRaiseMf); 7025 7026 /* Free but don't flush the FSW register. */ 7027 iemNativeRegFreeTmp(pReNative, idxFpuFswReg); 6948 7028 6949 7029 return off; … … 14349 14429 pszName = "RaiseUd"; 14350 14430 break; 14431 case kIemNativeLabelType_RaiseMf: 14432 pszName = "RaiseUd"; 14433 break; 14351 14434 case kIemNativeLabelType_ObsoleteTb: 14352 14435 pszName = "ObsoleteTb"; … … 14949 15032 if (pReNative->bmLabelTypes & RT_BIT_64(kIemNativeLabelType_RaiseUd)) 14950 15033 off = iemNativeEmitRaiseUd(pReNative, off, idxReturnLabel); 15034 if (pReNative->bmLabelTypes & RT_BIT_64(kIemNativeLabelType_RaiseMf)) 15035 off = iemNativeEmitRaiseMf(pReNative, off, idxReturnLabel); 14951 15036 if (pReNative->bmLabelTypes & RT_BIT_64(kIemNativeLabelType_ObsoleteTb)) 14952 15037 off = iemNativeEmitObsoleteTb(pReNative, off, idxReturnLabel); -
trunk/src/VBox/VMM/include/IEMInternal.h
r103649 r103665 5219 5219 #endif 5220 5220 VBOXSTRICTRC iemRaiseMathFault(PVMCPUCC pVCpu) RT_NOEXCEPT; 5221 #ifdef IEM_WITH_SETJMP 5222 DECL_NO_RETURN(void) iemRaiseMathFaultJmp(PVMCPUCC pVCpu) IEM_NOEXCEPT_MAY_LONGJMP; 5223 #endif 5221 5224 VBOXSTRICTRC iemRaiseAlignmentCheckException(PVMCPUCC pVCpu) RT_NOEXCEPT; 5222 5225 #ifdef IEM_WITH_SETJMP -
trunk/src/VBox/VMM/include/IEMN8veRecompiler.h
r103662 r103665 330 330 kIemNativeLabelType_RaiseNm, 331 331 kIemNativeLabelType_RaiseUd, 332 kIemNativeLabelType_RaiseMf, 332 333 kIemNativeLabelType_ObsoleteTb, 333 334 kIemNativeLabelType_NeedCsLimChecking,
Note:
See TracChangeset
for help on using the changeset viewer.

