Changeset 65501 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jan 28, 2017 10:36:58 PM (8 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r65207 r65501 6362 6362 6363 6363 6364 /** 6365 * Implements 'CMPXCHG16B' fallback using rendezvous. 6366 */ 6367 IEM_CIMPL_DEF_4(iemCImpl_cmpxchg16b_fallback_rendezvous, PRTUINT128U, pu128Dst, PRTUINT128U, pu64RaxRdx, 6368 PRTUINT128U, pu64RbxRcx, uint32_t *, pEFlags) 6369 { 6370 RT_NOREF(pVCpu, cbInstr, pu128Dst, pu64RaxRdx, pu64RbxRcx, pEFlags); 6371 #ifdef IN_RING3 6372 /** @todo VMMR3EmtRendezvous() */ 6373 return VERR_NOT_IMPLEMENTED; 6374 #else 6375 return VINF_EM_RAW_EMULATE_INSTR; 6376 #endif 6377 } 6378 6364 6379 6365 6380 /** -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r65493 r65501 6833 6833 if (IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fMovCmpXchg16b) 6834 6834 { 6835 #if 1 6835 6836 RT_NOREF(bRm); 6836 6837 IEMOP_BITCH_ABOUT_STUB(); 6837 6838 return VERR_IEM_INSTR_NOT_IMPLEMENTED; 6839 #else 6840 IEM_MC_BEGIN(4, 3); 6841 IEM_MC_ARG(PRTUINT128U, pu128MemDst, 0); 6842 IEM_MC_ARG(PRTUINT128U, pu128RaxRdx, 1); 6843 IEM_MC_ARG(PRTUINT128U, pu128RbxRcx, 2); 6844 IEM_MC_ARG_LOCAL_EFLAGS(pEFlags, EFlags, 3); 6845 IEM_MC_LOCAL(RTUINT128U, u128RaxRdx); 6846 IEM_MC_LOCAL(RTUINT128U, u128RbxRcx); 6847 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 6848 6849 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 6850 IEMOP_HLP_DONE_DECODING(); 6851 IEM_MC_MEM_MAP(pu128MemDst, IEM_ACCESS_DATA_RW, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 0 /*arg*/); 6852 6853 IEM_MC_FETCH_GREG_U64(u128RaxRdx.s.Lo, X86_GREG_xAX); 6854 IEM_MC_FETCH_GREG_U64(u128RaxRdx.s.Hi, X86_GREG_xDX); 6855 IEM_MC_REF_LOCAL(pu128RaxRdx, u128RaxRdx); 6856 6857 IEM_MC_FETCH_GREG_U64(u128RbxRcx.s.Lo, X86_GREG_xBX); 6858 IEM_MC_FETCH_GREG_U64(u128RbxRcx.s.Hi, X86_GREG_xCX); 6859 IEM_MC_REF_LOCAL(pu128RbxRcx, u128RbxRcx); 6860 6861 IEM_MC_FETCH_EFLAGS(EFlags); 6862 # ifdef RT_ARCH_AMD64 6863 if (IEM_GET_HOST_CPU_FEATURES(pVCpu)->fMovCmpXchg16b) 6864 { 6865 if (!(pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK)) 6866 IEM_MC_CALL_VOID_AIMPL_4(iemAImpl_cmpxchg16b, pu128MemDst, pu128RaxRdx, pu128RbxRcx, pEFlags); 6867 else 6868 IEM_MC_CALL_VOID_AIMPL_4(iemAImpl_cmpxchg16b_locked, pu128MemDst, pu128RaxRdx, pu128RbxRcx, pEFlags); 6869 } 6870 else 6871 # endif 6872 { 6873 /* Note! The fallback for 32-bit systems and systems without CX16 is to use 6874 SSE instructions for 16-byte loads and stores. Since these aren't 6875 atomic and there are cycles between the loading and storing, this 6876 only works correctly in UNI CPU guests. If guest SMP is active 6877 we have no choice but to use a rendezvous callback here. Sigh. */ 6878 IEM_MC_ACTUALIZE_SSE_STATE_FOR_READ(); /* HACK ALERT! */ 6879 if (pVCpu->CTX_SUFF(pVM)->cCpus == 1) 6880 IEM_MC_CALL_VOID_AIMPL_4(iemAImpl_cmpxchg16b_fallback_sse, pu128MemDst, pu128RaxRdx, pu128RbxRcx, pEFlags); 6881 else 6882 IEM_MC_CALL_CIMPL_4(iemCImpl_cmpxchg16b_fallback_rendezvous, pu128MemDst, pu128RaxRdx, pu128RbxRcx, pEFlags); 6883 } 6884 6885 IEM_MC_MEM_COMMIT_AND_UNMAP(pu128MemDst, IEM_ACCESS_DATA_RW); 6886 IEM_MC_COMMIT_EFLAGS(EFlags); 6887 IEM_MC_IF_EFL_BIT_NOT_SET(X86_EFL_ZF) 6888 IEM_MC_STORE_GREG_U64(X86_GREG_xAX, u128RaxRdx.s.Lo); 6889 IEM_MC_STORE_GREG_U64(X86_GREG_xDX, u128RaxRdx.s.Hi); 6890 IEM_MC_ENDIF(); 6891 IEM_MC_ADVANCE_RIP(); 6892 6893 IEM_MC_END(); 6894 return VINF_SUCCESS; 6895 #endif 6838 6896 } 6839 6897 Log(("cmpxchg16b -> #UD\n")); -
trunk/src/VBox/VMM/include/IEMInternal.h
r65194 r65501 1102 1102 IEM_DECL_IMPL_DEF(void, iemAImpl_cmpxchg8b_locked,(uint64_t *pu64Dst, PRTUINT64U pu64EaxEdx, PRTUINT64U pu64EbxEcx, 1103 1103 uint32_t *pEFlags)); 1104 IEM_DECL_IMPL_DEF(void, iemAImpl_cmpxchg16b,(PRTUINT128U *pu128Dst, PRTUINT128U pu64RaxRdx, PRTUINT128U pu64RbxRcx,1104 IEM_DECL_IMPL_DEF(void, iemAImpl_cmpxchg16b,(PRTUINT128U pu128Dst, PRTUINT128U pu64RaxRdx, PRTUINT128U pu64RbxRcx, 1105 1105 uint32_t *pEFlags)); 1106 IEM_DECL_IMPL_DEF(void, iemAImpl_cmpxchg16b_locked,(PRTUINT128U *pu128Dst, PRTUINT128U pu64RaxRdx, PRTUINT128U pu64RbxRcx,1106 IEM_DECL_IMPL_DEF(void, iemAImpl_cmpxchg16b_locked,(PRTUINT128U pu128Dst, PRTUINT128U pu64RaxRdx, PRTUINT128U pu64RbxRcx, 1107 1107 uint32_t *pEFlags)); 1108 IEM_DECL_IMPL_DEF(void, iemAImpl_cmpxchg16b_fallback_sse,(PRTUINT128U pu128Dst, PRTUINT128U pu64RaxRdx, 1109 PRTUINT128U pu64RbxRcx, uint32_t *pEFlags)); 1108 1110 /** @} */ 1109 1111
Note:
See TracChangeset
for help on using the changeset viewer.