Changeset 101958 in vbox for trunk/src/VBox
- Timestamp:
- Nov 8, 2023 10:54:58 AM (13 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstCommon.cpp.h
r101387 r101958 939 939 { 940 940 case IEMMODE_16BIT: 941 IEM_MC_BEGIN(5, 1, 0, 0); 942 IEM_MC_ARG(uint16_t, uSel, 0); 943 IEM_MC_ARG(uint16_t, offSeg, 1); 944 IEM_MC_ARG_CONST(uint8_t, iSegRegArg,/*=*/iSegReg, 2); 945 IEM_MC_ARG_CONST(uint8_t, iGRegArg, /*=*/iGReg, 3); 946 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pVCpu->iem.s.enmEffOpSize, 4); 947 IEM_MC_LOCAL(RTGCPTR, GCPtrEff); 948 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 949 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 950 IEM_MC_FETCH_MEM_U16(offSeg, pVCpu->iem.s.iEffSeg, GCPtrEff); 951 IEM_MC_FETCH_MEM_U16_DISP(uSel, pVCpu->iem.s.iEffSeg, GCPtrEff, 2); 941 if (iSegReg >= X86_SREG_FS || !IEM_IS_32BIT_CODE(pVCpu)) /* IEM_CIMPL_F_XXX flag are combined for whole MC block, */ 942 { /* thus the duplication. */ 943 IEM_MC_BEGIN(5, 1, 0, 0); 944 IEM_MC_LOCAL(RTGCPTR, GCPtrEff); 945 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 946 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 947 IEM_MC_ARG(uint16_t, offSeg, 1); 948 IEM_MC_FETCH_MEM_U16(offSeg, pVCpu->iem.s.iEffSeg, GCPtrEff); /** @todo check memory access pattern */ 949 IEM_MC_ARG(uint16_t, uSel, 0); 950 IEM_MC_FETCH_MEM_U16_DISP(uSel, pVCpu->iem.s.iEffSeg, GCPtrEff, 2); 951 IEM_MC_ARG_CONST(uint8_t, iSegRegArg,/*=*/iSegReg, 2); 952 IEM_MC_ARG_CONST(uint8_t, iGRegArg, /*=*/iGReg, 3); 953 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pVCpu->iem.s.enmEffOpSize, 4); 954 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(iGReg); 955 IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG(iSegReg); 956 IEM_MC_CALL_CIMPL_5( 0, iemCImpl_load_SReg_Greg, uSel, offSeg, iSegRegArg, iGRegArg, enmEffOpSize); 957 IEM_MC_END(); 958 } 959 else 960 { 961 IEM_MC_BEGIN(5, 1, 0, 0); 962 IEM_MC_LOCAL(RTGCPTR, GCPtrEff); 963 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 964 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 965 IEM_MC_ARG(uint16_t, offSeg, 1); 966 IEM_MC_FETCH_MEM_U16(offSeg, pVCpu->iem.s.iEffSeg, GCPtrEff); /** @todo check memory access pattern */ 967 IEM_MC_ARG(uint16_t, uSel, 0); 968 IEM_MC_FETCH_MEM_U16_DISP(uSel, pVCpu->iem.s.iEffSeg, GCPtrEff, 2); 969 IEM_MC_ARG_CONST(uint8_t, iSegRegArg,/*=*/iSegReg, 2); 970 IEM_MC_ARG_CONST(uint8_t, iGRegArg, /*=*/iGReg, 3); 971 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pVCpu->iem.s.enmEffOpSize, 4); 972 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(iGReg); 973 IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG(iSegReg); 974 IEM_MC_CALL_CIMPL_5(IEM_CIMPL_F_MODE, iemCImpl_load_SReg_Greg, uSel, offSeg, iSegRegArg, iGRegArg, enmEffOpSize); 975 IEM_MC_END(); 976 } 977 978 case IEMMODE_32BIT: 952 979 if (iSegReg >= X86_SREG_FS || !IEM_IS_32BIT_CODE(pVCpu)) 980 { 981 IEM_MC_BEGIN(5, 1, IEM_MC_F_MIN_386, 0); 982 IEM_MC_LOCAL(RTGCPTR, GCPtrEff); 983 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 984 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 985 IEM_MC_ARG(uint32_t, offSeg, 1); /** @todo check memory access pattern */ 986 IEM_MC_FETCH_MEM_U32(offSeg, pVCpu->iem.s.iEffSeg, GCPtrEff); 987 IEM_MC_ARG(uint16_t, uSel, 0); 988 IEM_MC_FETCH_MEM_U16_DISP(uSel, pVCpu->iem.s.iEffSeg, GCPtrEff, 4); 989 IEM_MC_ARG_CONST(uint8_t, iSegRegArg,/*=*/iSegReg, 2); 990 IEM_MC_ARG_CONST(uint8_t, iGRegArg, /*=*/iGReg, 3); 991 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pVCpu->iem.s.enmEffOpSize, 4); 992 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(iGReg); 993 IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG(iSegReg); 953 994 IEM_MC_CALL_CIMPL_5( 0, iemCImpl_load_SReg_Greg, uSel, offSeg, iSegRegArg, iGRegArg, enmEffOpSize); 995 IEM_MC_END(); 996 } 954 997 else 998 { 999 IEM_MC_BEGIN(5, 1, IEM_MC_F_MIN_386, 0); 1000 IEM_MC_LOCAL(RTGCPTR, GCPtrEff); 1001 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 1002 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 1003 IEM_MC_ARG(uint32_t, offSeg, 1); /** @todo check memory access pattern */ 1004 IEM_MC_FETCH_MEM_U32(offSeg, pVCpu->iem.s.iEffSeg, GCPtrEff); 1005 IEM_MC_ARG(uint16_t, uSel, 0); 1006 IEM_MC_FETCH_MEM_U16_DISP(uSel, pVCpu->iem.s.iEffSeg, GCPtrEff, 4); 1007 IEM_MC_ARG_CONST(uint8_t, iSegRegArg,/*=*/iSegReg, 2); 1008 IEM_MC_ARG_CONST(uint8_t, iGRegArg, /*=*/iGReg, 3); 1009 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pVCpu->iem.s.enmEffOpSize, 4); 1010 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(iGReg); 1011 IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG(iSegReg); 955 1012 IEM_MC_CALL_CIMPL_5(IEM_CIMPL_F_MODE, iemCImpl_load_SReg_Greg, uSel, offSeg, iSegRegArg, iGRegArg, enmEffOpSize); 956 IEM_MC_END(); 957 958 case IEMMODE_32BIT: 959 IEM_MC_BEGIN(5, 1, IEM_MC_F_MIN_386, 0); 960 IEM_MC_ARG(uint16_t, uSel, 0); 961 IEM_MC_ARG(uint32_t, offSeg, 1); 962 IEM_MC_ARG_CONST(uint8_t, iSegRegArg,/*=*/iSegReg, 2); 963 IEM_MC_ARG_CONST(uint8_t, iGRegArg, /*=*/iGReg, 3); 964 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pVCpu->iem.s.enmEffOpSize, 4); 965 IEM_MC_LOCAL(RTGCPTR, GCPtrEff); 966 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 967 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 968 IEM_MC_FETCH_MEM_U32(offSeg, pVCpu->iem.s.iEffSeg, GCPtrEff); 969 IEM_MC_FETCH_MEM_U16_DISP(uSel, pVCpu->iem.s.iEffSeg, GCPtrEff, 4); 970 if (iSegReg >= X86_SREG_FS || !IEM_IS_32BIT_CODE(pVCpu)) 971 IEM_MC_CALL_CIMPL_5( 0, iemCImpl_load_SReg_Greg, uSel, offSeg, iSegRegArg, iGRegArg, enmEffOpSize); 972 else 973 IEM_MC_CALL_CIMPL_5(IEM_CIMPL_F_MODE, iemCImpl_load_SReg_Greg, uSel, offSeg, iSegRegArg, iGRegArg, enmEffOpSize); 974 IEM_MC_END(); 1013 IEM_MC_END(); 1014 } 975 1015 976 1016 case IEMMODE_64BIT: … … 978 1018 IEM_MC_ARG(uint16_t, uSel, 0); 979 1019 IEM_MC_ARG(uint64_t, offSeg, 1); 980 IEM_MC_ARG_CONST(uint8_t, iSegRegArg,/*=*/iSegReg, 2);981 IEM_MC_ARG_CONST(uint8_t, iGRegArg, /*=*/iGReg, 3);982 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pVCpu->iem.s.enmEffOpSize, 4);983 1020 IEM_MC_LOCAL(RTGCPTR, GCPtrEff); 984 1021 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); … … 989 1026 IEM_MC_FETCH_MEM_U64(offSeg, pVCpu->iem.s.iEffSeg, GCPtrEff); 990 1027 IEM_MC_FETCH_MEM_U16_DISP(uSel, pVCpu->iem.s.iEffSeg, GCPtrEff, 8); 1028 IEM_MC_ARG_CONST(uint8_t, iSegRegArg,/*=*/iSegReg, 2); 1029 IEM_MC_ARG_CONST(uint8_t, iGRegArg, /*=*/iGReg, 3); 1030 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pVCpu->iem.s.enmEffOpSize, 4); 1031 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(iGReg); 1032 IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG(iSegReg); 991 1033 IEM_MC_CALL_CIMPL_5(0, iemCImpl_load_SReg_Greg, uSel, offSeg, iSegRegArg, iGRegArg, enmEffOpSize); 992 1034 IEM_MC_END(); -
trunk/src/VBox/VMM/VMMAll/IEMAllInstOneByte.cpp.h
r101954 r101958 5798 5798 IEM_MC_ARG(uint16_t, u16Value, 1); \ 5799 5799 IEM_MC_FETCH_GREG_U16(u16Value, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5800 IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG(iSegReg); \ 5800 5801 IEM_MC_CALL_CIMPL_2(a_fCImplFlags, iemCImpl_load_SReg, iSRegArg, u16Value); \ 5801 5802 IEM_MC_END() … … 5836 5837 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 5837 5838 IEM_MC_FETCH_MEM_U16(u16Value, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 5839 IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG(iSegReg); \ 5838 5840 IEM_MC_CALL_CIMPL_2(a_fCImplFlags, iemCImpl_load_SReg, iSRegArg, u16Value); \ 5839 5841 IEM_MC_END() … … 5904 5906 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5905 5907 IEM_MC_ARG_CONST(uint8_t, iEffSeg, pVCpu->iem.s.iEffSeg, 0); 5908 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(X86_GREG_xSP); 5906 5909 IEM_MC_CALL_CIMPL_2(0, iemCImpl_pop_mem16, iEffSeg, GCPtrEffDst); 5907 5910 IEM_MC_END(); … … 5914 5917 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5915 5918 IEM_MC_ARG_CONST(uint8_t, iEffSeg, pVCpu->iem.s.iEffSeg, 0); 5919 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(X86_GREG_xSP); 5916 5920 IEM_MC_CALL_CIMPL_2(0, iemCImpl_pop_mem32, iEffSeg, GCPtrEffDst); 5917 5921 IEM_MC_END(); … … 5924 5928 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5925 5929 IEM_MC_ARG_CONST(uint8_t, iEffSeg, pVCpu->iem.s.iEffSeg, 0); 5930 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(X86_GREG_xSP); 5926 5931 IEM_MC_CALL_CIMPL_2(0, iemCImpl_pop_mem64, iEffSeg, GCPtrEffDst); 5927 5932 IEM_MC_END(); … … 13410 13415 IEM_MC_FETCH_MEM_U16(offSeg, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); \ 13411 13416 IEM_MC_FETCH_MEM_U16_DISP(u16Sel, pVCpu->iem.s.iEffSeg, GCPtrEffSrc, 2); \ 13417 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(X86_GREG_xSP); \ 13412 13418 IEM_MC_CALL_CIMPL_3(IEM_CIMPL_F_BRANCH_INDIRECT | IEM_CIMPL_F_BRANCH_FAR \ 13413 13419 | IEM_CIMPL_F_MODE | IEM_CIMPL_F_RFLAGS | IEM_CIMPL_F_VMEXIT, \ … … 13426 13432 IEM_MC_FETCH_MEM_U32(offSeg, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); \ 13427 13433 IEM_MC_FETCH_MEM_U16_DISP(u16Sel, pVCpu->iem.s.iEffSeg, GCPtrEffSrc, 4); \ 13434 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(X86_GREG_xSP); \ 13428 13435 IEM_MC_CALL_CIMPL_3(IEM_CIMPL_F_BRANCH_INDIRECT | IEM_CIMPL_F_BRANCH_FAR \ 13429 13436 | IEM_CIMPL_F_MODE | IEM_CIMPL_F_RFLAGS | IEM_CIMPL_F_VMEXIT, \ … … 13443 13450 IEM_MC_FETCH_MEM_U64(offSeg, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); \ 13444 13451 IEM_MC_FETCH_MEM_U16_DISP(u16Sel, pVCpu->iem.s.iEffSeg, GCPtrEffSrc, 8); \ 13452 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(X86_GREG_xSP); \ 13445 13453 IEM_MC_CALL_CIMPL_3(IEM_CIMPL_F_BRANCH_INDIRECT | IEM_CIMPL_F_BRANCH_FAR | IEM_CIMPL_F_MODE /* no gates */, \ 13446 13454 a_fnCImpl, u16Sel, offSeg, enmEffOpSize); \ -
trunk/src/VBox/VMM/VMMAll/IEMAllInstPython.py
r101954 r101958 2896 2896 'IEM_MC_FPU_STACK_UNDERFLOW_THEN_POP_POP': (McBlock.parseMcGeneric, True, False, ), 2897 2897 'IEM_MC_FPU_TO_MMX_MODE': (McBlock.parseMcGeneric, True, False, ), 2898 'IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG': (McBlock.parseMcGeneric, True, True, ), 2899 'IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG': (McBlock.parseMcGeneric, True, True, ), 2898 2900 'IEM_MC_IF_CX_IS_NZ': (McBlock.parseMcGenericCond, True, True, ), 2899 2901 'IEM_MC_IF_CX_IS_NZ_AND_EFL_BIT_NOT_SET': (McBlock.parseMcGenericCond, True, True, ), -
trunk/src/VBox/VMM/VMMAll/IEMAllInstTwoByte0f.cpp.h
r101950 r101958 1861 1861 IEM_MC_ARG_CONST(bool, fIsLarArg, fIsLar, 2); 1862 1862 1863 IEM_MC_FETCH_GREG_U16(u16Sel, IEM_GET_MODRM_RM(pVCpu, bRm)); 1863 1864 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); 1864 IEM_MC_ FETCH_GREG_U16(u16Sel, IEM_GET_MODRM_RM(pVCpu, bRm));1865 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(IEM_GET_MODRM_REG(pVCpu, bRm)); 1865 1866 IEM_MC_CALL_CIMPL_3(IEM_CIMPL_F_STATUS_FLAGS, iemCImpl_LarLsl_u16, pu16Dst, u16Sel, fIsLarArg); 1866 1867 … … 1876 1877 IEM_MC_ARG_CONST(bool, fIsLarArg, fIsLar, 2); 1877 1878 1879 IEM_MC_FETCH_GREG_U16(u16Sel, IEM_GET_MODRM_RM(pVCpu, bRm)); 1878 1880 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); 1879 IEM_MC_ FETCH_GREG_U16(u16Sel, IEM_GET_MODRM_RM(pVCpu, bRm));1881 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(IEM_GET_MODRM_REG(pVCpu, bRm)); 1880 1882 IEM_MC_CALL_CIMPL_3(IEM_CIMPL_F_STATUS_FLAGS, iemCImpl_LarLsl_u64, pu64Dst, u16Sel, fIsLarArg); 1881 1883 … … 1902 1904 IEM_MC_FETCH_MEM_U16(u16Sel, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); 1903 1905 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); 1906 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(IEM_GET_MODRM_REG(pVCpu, bRm)); 1904 1907 IEM_MC_CALL_CIMPL_3(IEM_CIMPL_F_STATUS_FLAGS, iemCImpl_LarLsl_u16, pu16Dst, u16Sel, fIsLarArg); 1905 1908 … … 1921 1924 IEM_MC_FETCH_MEM_U16(u16Sel, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); 1922 1925 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); 1926 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(IEM_GET_MODRM_REG(pVCpu, bRm)); 1923 1927 IEM_MC_CALL_CIMPL_3(IEM_CIMPL_F_STATUS_FLAGS, iemCImpl_LarLsl_u64, pu64Dst, u16Sel, fIsLarArg); 1924 1928 … … 7104 7108 IEM_MC_FETCH_GREG_U64(u64Enc, IEM_GET_MODRM_REG(pVCpu, bRm)); 7105 7109 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); 7110 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(IEM_GET_MODRM_RM(pVCpu, bRm)); 7106 7111 IEM_MC_CALL_CIMPL_2(IEM_CIMPL_F_VMEXIT | IEM_CIMPL_F_STATUS_FLAGS, iemCImpl_vmread_reg64, pu64Dst, u64Enc); 7107 7112 IEM_MC_END(); … … 7115 7120 IEM_MC_FETCH_GREG_U32(u32Enc, IEM_GET_MODRM_REG(pVCpu, bRm)); 7116 7121 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); 7122 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(IEM_GET_MODRM_RM(pVCpu, bRm)); 7117 7123 IEM_MC_CALL_CIMPL_2(IEM_CIMPL_F_VMEXIT | IEM_CIMPL_F_STATUS_FLAGS, iemCImpl_vmread_reg32, pu64Dst, u32Enc); 7118 7124 IEM_MC_END(); … … 12450 12456 IEM_MC_REF_LOCAL(pu128RbxRcx, u128RbxRcx); \ 12451 12457 \ 12452 IEM_MC_FETCH_EFLAGS(EFlags) 12458 IEM_MC_FETCH_EFLAGS(EFlags); \ 12459 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(X86_GREG_xAX); \ 12460 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(X86_GREG_xDX) 12453 12461 12454 12462 #define BODY_CMPXCHG16B_TAIL \ … … 12556 12564 IEM_MC_BEGIN(2, 0, IEM_MC_F_NOT_286_OR_OLDER, 0); 12557 12565 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 12558 IEM_MC_ARG_CONST(uint8_t, iReg, /*=*/IEM_GET_MODRM_RM(pVCpu, bRm), 0); 12559 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pVCpu->iem.s.enmEffOpSize, 1); 12566 IEM_MC_ARG_CONST(uint8_t, iReg, /*=*/ IEM_GET_MODRM_RM(pVCpu, bRm), 0); 12567 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/ pVCpu->iem.s.enmEffOpSize, 1); 12568 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(IEM_GET_MODRM_RM(pVCpu, bRm)); 12560 12569 IEM_MC_CALL_CIMPL_2(IEM_CIMPL_F_RFLAGS | IEM_CIMPL_F_VMEXIT, iemCImpl_rdrand, iReg, enmEffOpSize); 12561 12570 IEM_MC_END(); … … 12652 12661 IEM_MC_BEGIN(2, 0, IEM_MC_F_NOT_286_OR_OLDER, 0); 12653 12662 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 12654 IEM_MC_ARG_CONST(uint8_t, iReg, /*=*/IEM_GET_MODRM_RM(pVCpu, bRm), 0); 12655 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pVCpu->iem.s.enmEffOpSize, 1); 12663 IEM_MC_ARG_CONST(uint8_t, iReg, /*=*/ IEM_GET_MODRM_RM(pVCpu, bRm), 0); 12664 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/ pVCpu->iem.s.enmEffOpSize, 1); 12665 IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(IEM_GET_MODRM_RM(pVCpu, bRm)); 12656 12666 IEM_MC_CALL_CIMPL_2(IEM_CIMPL_F_RFLAGS | IEM_CIMPL_F_VMEXIT, iemCImpl_rdseed, iReg, enmEffOpSize); 12657 12667 IEM_MC_END(); -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r101949 r101958 3067 3067 uint64_t const fInThisHstReg = (pReNative->Core.aHstRegs[idxHstReg].fGstRegShadows & fGstRegs) | RT_BIT_64(idxGstReg); 3068 3068 fGstRegs &= ~fInThisHstReg; 3069 pReNative->Core.aHstRegs[idxHstReg].fGstRegShadows &= fInThisHstReg;3069 pReNative->Core.aHstRegs[idxHstReg].fGstRegShadows &= ~fInThisHstReg; 3070 3070 if (!pReNative->Core.aHstRegs[idxHstReg].fGstRegShadows) 3071 3071 pReNative->Core.bmHstRegsWithGstShadow &= ~RT_BIT_32(idxHstReg); … … 5525 5525 /* 5526 5526 * Make the call and check the return code. 5527 * 5528 * Shadow PC copies are always flushed here, other stuff depends on flags. 5529 * Segment and general purpose registers are explictily flushed via the 5530 * IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG and IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG 5531 * macros. 5527 5532 */ 5528 5533 off = iemNativeEmitCallImm(pReNative, off, (uintptr_t)pfnCImpl); … … 5530 5535 off = iemNativeEmitLoadGprByBpU32(pReNative, off, X86_GREG_xAX, IEMNATIVE_FP_OFF_IN_SHADOW_ARG0); /* rcStrict (see above) */ 5531 5536 #endif 5537 /** @todo Always flush EFLAGS if this is an xxF variation. */ 5538 iemNativeRegFlushGuestShadows(pReNative, 5539 RT_BIT_64(kIemNativeGstReg_Pc) 5540 | (pReNative->fCImpl & ( IEM_CIMPL_F_RFLAGS 5541 | IEM_CIMPL_F_STATUS_FLAGS 5542 | IEM_CIMPL_F_INHIBIT_SHADOW) 5543 ? RT_BIT_64(kIemNativeGstReg_EFlags) : 0) 5544 ); 5545 5532 5546 return iemNativeEmitCheckCallRetAndPassUp(pReNative, off, idxInstr); 5533 5547 } … … 5655 5669 return iemNativeEmitCallCImplCommon(pReNative, off, cbInstr, idxInstr, pfnCImpl, 5); 5656 5670 } 5671 5672 5673 /** Flush guest GPR shadow copy. */ 5674 #define IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(a_iGReg) \ 5675 iemNativeRegFlushGuestShadows(pReNative, RT_BIT_64(kIemNativeGstReg_GprFirst + (a_iGReg)) ) 5676 5677 /** Flush guest segment register (hidden and non-hidden bits) shadow copy. */ 5678 #define IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG(a_iSReg) \ 5679 iemNativeRegFlushGuestShadows(pReNative, \ 5680 RT_BIT_64(kIemNativeGstReg_SegSelFirst + (a_iSReg)) \ 5681 | RT_BIT_64(kIemNativeGstReg_SegBaseFirst + (a_iSReg)) \ 5682 | RT_BIT_64(kIemNativeGstReg_SegLimitFirst + (a_iSReg)) ) 5657 5683 5658 5684 -
trunk/src/VBox/VMM/include/IEMMc.h
r101954 r101958 2494 2494 #define IEM_MC_ENDIF() } do {} while (0) 2495 2495 2496 2497 /** Native recompiler GREG shadow copy flush hint related to CIMPL calls. */ 2498 #define IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(a_iGReg) ((void)0) 2499 /** Native recompiler SREG shadow copy flush hint related to CIMPL calls. */ 2500 #define IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG(a_iSReg) ((void)0) 2501 2496 2502 /** @} */ 2497 2503 -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r101954 r101958 1043 1043 #define IEM_MC_ENDIF() } do { (void)fMcBegin; } while (0) 1044 1044 1045 #define IEM_MC_HINT_FLUSH_GUEST_SHADOW_GREG(a_iGReg) ((void)fMcBegin) 1046 #define IEM_MC_HINT_FLUSH_GUEST_SHADOW_SREG(a_iSReg) ((void)fMcBegin) 1047 1045 1048 /** @} */ 1046 1049
Note:
See TracChangeset
for help on using the changeset viewer.