Changeset 103671 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Mar 4, 2024 3:48:34 PM (12 months ago)
- svn:sync-xref-src-repo-rev:
- 162031
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r103665 r103671 4528 4528 return iemRaiseXcptOrInt(pVCpu, 0, X86_XCPT_XF, IEM_XCPT_FLAGS_T_CPU_XCPT, 0, 0); 4529 4529 } 4530 4531 4532 #ifdef IEM_WITH_SETJMP 4533 /** \#XF(0)/\#XM(0) - 19s, longjmp. */ 4534 DECL_NO_RETURN(void) iemRaiseSimdFpExceptionJmp(PVMCPUCC pVCpu) IEM_NOEXCEPT_MAY_LONGJMP 4535 { 4536 IEM_DO_LONGJMP(pVCpu, VBOXSTRICTRC_VAL(iemRaiseSimdFpException(pVCpu))); 4537 } 4538 #endif 4530 4539 4531 4540 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstPython.py
r103667 r103671 3208 3208 'IEM_MC_RAISE_GP0_IF_CPL_NOT_ZERO': (McBlock.parseMcGeneric, True, True, False, ), 3209 3209 'IEM_MC_RAISE_GP0_IF_EFF_ADDR_UNALIGNED': (McBlock.parseMcGeneric, True, True, False, ), 3210 'IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT': (McBlock.parseMcGeneric, True, True, False,),3210 'IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT': (McBlock.parseMcGeneric, True, True, True, ), 3211 3211 'IEM_MC_REF_EFLAGS': (McBlock.parseMcGeneric, False, False, True, ), 3212 3212 'IEM_MC_REF_FPUREG': (McBlock.parseMcGeneric, False, False, False, ), -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r103670 r103671 1634 1634 1635 1635 /** 1636 * Used by TB code when it wants to raise a \#XF. 1637 */ 1638 IEM_DECL_NATIVE_HLP_DEF(int, iemNativeHlpExecRaiseXf,(PVMCPUCC pVCpu)) 1639 { 1640 iemRaiseSimdFpExceptionJmp(pVCpu); 1641 #ifndef _MSC_VER 1642 return VINF_IEM_RAISED_XCPT; /* not reached */ 1643 #endif 1644 } 1645 1646 1647 /** 1636 1648 * Used by TB code when detecting opcode changes. 1637 1649 * @see iemThreadeFuncWorkerObsoleteTb … … 2946 2958 pReNative->Core.u64ArgVars = UINT64_MAX; 2947 2959 2948 AssertCompile(RT_ELEMENTS(pReNative->aidxUniqueLabels) == 1 2);2960 AssertCompile(RT_ELEMENTS(pReNative->aidxUniqueLabels) == 13); 2949 2961 pReNative->aidxUniqueLabels[0] = UINT32_MAX; 2950 2962 pReNative->aidxUniqueLabels[1] = UINT32_MAX; … … 2959 2971 pReNative->aidxUniqueLabels[10] = UINT32_MAX; 2960 2972 pReNative->aidxUniqueLabels[11] = UINT32_MAX; 2973 pReNative->aidxUniqueLabels[12] = UINT32_MAX; 2961 2974 2962 2975 /* Full host register reinit: */ … … 5982 5995 5983 5996 /** 5997 * Emits the code at the RaiseXf label. 5998 */ 5999 static uint32_t iemNativeEmitRaiseXf(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint32_t idxReturnLabel) 6000 { 6001 uint32_t const idxLabel = iemNativeLabelFind(pReNative, kIemNativeLabelType_RaiseXf); 6002 if (idxLabel != UINT32_MAX) 6003 { 6004 iemNativeLabelDefine(pReNative, idxLabel, off); 6005 6006 /* iemNativeHlpExecRaiseXf(PVMCPUCC pVCpu) */ 6007 off = iemNativeEmitLoadGprFromGpr(pReNative, off, IEMNATIVE_CALL_ARG0_GREG, IEMNATIVE_REG_FIXED_PVMCPU); 6008 off = iemNativeEmitCallImm(pReNative, off, (uintptr_t)iemNativeHlpExecRaiseXf); 6009 6010 /* jump back to the return sequence. */ 6011 off = iemNativeEmitJmpToLabel(pReNative, off, idxReturnLabel); 6012 } 6013 return off; 6014 } 6015 6016 6017 /** 5984 6018 * Emits the code at the ReturnWithFlags label (returns 5985 6019 * VINF_IEM_REEXEC_FINISH_WITH_FLAGS). … … 7159 7193 iemNativeRegFreeTmp(pReNative, idxCr4Reg); 7160 7194 iemNativeRegFreeTmp(pReNative, idxXcr0Reg); 7195 7196 return off; 7197 } 7198 7199 7200 #define IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT() \ 7201 off = iemNativeEmitRaiseSseAvxSimdFpXcpt(pReNative, off, pCallEntry->idxInstr) 7202 7203 /** 7204 * Emits code to raise a SIMD floating point (either \#UD or \#XF) should be raised. 7205 * 7206 * @returns New code buffer offset, UINT32_MAX on failure. 7207 * @param pReNative The native recompile state. 7208 * @param off The code buffer offset. 7209 * @param idxInstr The current instruction. 7210 */ 7211 DECL_INLINE_THROW(uint32_t) 7212 iemNativeEmitRaiseSseAvxSimdFpXcpt(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxInstr) 7213 { 7214 /* 7215 * Make sure we don't have any outstanding guest register writes as we may 7216 * raise an \#UD or \#NM and all guest register must be up to date in CPUMCTX. 7217 * 7218 * @todo r=aeichner Can we postpone this to the RaiseNm/RaiseUd path? 7219 */ 7220 off = iemNativeRegFlushPendingWrites(pReNative, off); 7221 7222 #ifdef IEMNATIVE_WITH_INSTRUCTION_COUNTING 7223 off = iemNativeEmitStoreImmToVCpuU8(pReNative, off, idxInstr, RT_UOFFSETOF(VMCPUCC, iem.s.idxTbCurInstr)); 7224 #else 7225 RT_NOREF(idxInstr); 7226 #endif 7227 7228 /* Allocate a temporary CR4 register. */ 7229 uint8_t const idxCr4Reg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_Cr4, kIemNativeGstRegUse_ReadOnly); 7230 uint8_t const idxLabelRaiseXf = iemNativeLabelCreate(pReNative, kIemNativeLabelType_RaiseXf); 7231 uint8_t const idxLabelRaiseUd = iemNativeLabelCreate(pReNative, kIemNativeLabelType_RaiseUd); 7232 7233 /* 7234 * if (!(cr4 & X86_CR4_OSXMMEEXCPT)) 7235 * return raisexcpt(); 7236 */ 7237 off = iemNativeEmitTestBitInGprAndJmpToLabelIfNotSet(pReNative, off, idxCr4Reg, X86_CR4_OSXMMEEXCPT_BIT, idxLabelRaiseXf); 7238 7239 /* raise \#UD exception unconditionally. */ 7240 off = iemNativeEmitJmpToLabel(pReNative, off, idxLabelRaiseUd); 7241 7242 /* Free but don't flush the CR4 register. */ 7243 iemNativeRegFreeTmp(pReNative, idxCr4Reg); 7161 7244 7162 7245 return off; … … 14451 14534 pszName = "RaiseMf"; 14452 14535 break; 14536 case kIemNativeLabelType_RaiseXf: 14537 pszName = "RaiseXf"; 14538 break; 14453 14539 case kIemNativeLabelType_ObsoleteTb: 14454 14540 pszName = "ObsoleteTb"; … … 15053 15139 if (pReNative->bmLabelTypes & RT_BIT_64(kIemNativeLabelType_RaiseMf)) 15054 15140 off = iemNativeEmitRaiseMf(pReNative, off, idxReturnLabel); 15141 if (pReNative->bmLabelTypes & RT_BIT_64(kIemNativeLabelType_RaiseXf)) 15142 off = iemNativeEmitRaiseXf(pReNative, off, idxReturnLabel); 15055 15143 if (pReNative->bmLabelTypes & RT_BIT_64(kIemNativeLabelType_ObsoleteTb)) 15056 15144 off = iemNativeEmitObsoleteTb(pReNative, off, idxReturnLabel); -
trunk/src/VBox/VMM/include/IEMInternal.h
r103665 r103671 5227 5227 #endif 5228 5228 VBOXSTRICTRC iemRaiseSimdFpException(PVMCPUCC pVCpu) RT_NOEXCEPT; 5229 #ifdef IEM_WITH_SETJMP 5230 DECL_NO_RETURN(void) iemRaiseSimdFpExceptionJmp(PVMCPUCC pVCpu) IEM_NOEXCEPT_MAY_LONGJMP; 5231 #endif 5229 5232 5230 5233 void iemLogSyscallRealModeInt(PVMCPUCC pVCpu, uint8_t u8Vector, uint8_t cbInstr); -
trunk/src/VBox/VMM/include/IEMN8veRecompiler.h
r103667 r103671 331 331 kIemNativeLabelType_RaiseUd, 332 332 kIemNativeLabelType_RaiseMf, 333 kIemNativeLabelType_RaiseXf, 333 334 kIemNativeLabelType_ObsoleteTb, 334 335 kIemNativeLabelType_NeedCsLimChecking,
Note:
See TracChangeset
for help on using the changeset viewer.