Changeset 100084 in vbox for trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp
- Timestamp:
- Jun 6, 2023 2:56:14 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp
r100061 r100084 4954 4954 { 4955 4955 case IEMMODE_16BIT: 4956 *(uint16_t *)iemGRegRef(pVCpu, iGReg) = offSeg;4956 iemGRegStoreU16(pVCpu, iGReg, offSeg); 4957 4957 break; 4958 4958 case IEMMODE_32BIT: 4959 4959 case IEMMODE_64BIT: 4960 *(uint64_t *)iemGRegRef(pVCpu, iGReg) = offSeg;4960 iemGRegStoreU64(pVCpu, iGReg, offSeg); 4961 4961 break; 4962 4962 IEM_NOT_REACHED_DEFAULT_CASE_RET(); … … 5529 5529 switch (enmEffOpSize) 5530 5530 { 5531 case IEMMODE_16BIT: *(uint16_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.ldtr.Sel; break; 5532 case IEMMODE_32BIT: *(uint64_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.ldtr.Sel; break; 5533 case IEMMODE_64BIT: *(uint64_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.ldtr.Sel; break; 5531 case IEMMODE_16BIT: 5532 iemGRegStoreU16(pVCpu, iGReg, pVCpu->cpum.GstCtx.ldtr.Sel); 5533 break; 5534 case IEMMODE_32BIT: 5535 case IEMMODE_64BIT: 5536 iemGRegStoreU64(pVCpu, iGReg, pVCpu->cpum.GstCtx.ldtr.Sel); 5537 break; 5534 5538 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 5535 5539 } … … 5711 5715 switch (enmEffOpSize) 5712 5716 { 5713 case IEMMODE_16BIT: *(uint16_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.tr.Sel; break; 5714 case IEMMODE_32BIT: *(uint64_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.tr.Sel; break; 5715 case IEMMODE_64BIT: *(uint64_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.tr.Sel; break; 5717 case IEMMODE_16BIT: 5718 iemGRegStoreU16(pVCpu, iGReg, pVCpu->cpum.GstCtx.tr.Sel); 5719 break; 5720 case IEMMODE_32BIT: 5721 case IEMMODE_64BIT: 5722 iemGRegStoreU64(pVCpu, iGReg, pVCpu->cpum.GstCtx.tr.Sel); 5723 break; 5716 5724 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 5717 5725 } … … 5860 5868 /* Store it. */ 5861 5869 if (IEM_IS_64BIT_CODE(pVCpu)) 5862 *(uint64_t *)iemGRegRef(pVCpu, iGReg) = crX;5870 iemGRegStoreU64(pVCpu, iGReg, crX); 5863 5871 else 5864 *(uint64_t *)iemGRegRef(pVCpu, iGReg) = (uint32_t)crX;5872 iemGRegStoreU64(pVCpu, iGReg, (uint32_t)crX); 5865 5873 5866 5874 return iemRegAddToRipAndFinishingClearingRF(pVCpu, cbInstr); … … 5893 5901 case IEMMODE_16BIT: 5894 5902 if (IEM_GET_TARGET_CPU(pVCpu) > IEMTARGETCPU_386) 5895 *(uint16_t *)iemGRegRef(pVCpu, iGReg) = (uint16_t)u64GuestCr0; 5903 iemGRegStoreU16(pVCpu, iGReg, (uint16_t)u64GuestCr0); 5904 /* Unused bits are set on 386 and older CPU: */ 5896 5905 else if (IEM_GET_TARGET_CPU(pVCpu) >= IEMTARGETCPU_386) 5897 *(uint16_t *)iemGRegRef(pVCpu, iGReg) = (uint16_t)u64GuestCr0 | 0xffe0;5906 iemGRegStoreU16(pVCpu, iGReg, (uint16_t)u64GuestCr0 | 0xffe0); 5898 5907 else 5899 *(uint16_t *)iemGRegRef(pVCpu, iGReg) = (uint16_t)u64GuestCr0 | 0xfff0;5908 iemGRegStoreU16(pVCpu, iGReg, (uint16_t)u64GuestCr0 | 0xfff0); 5900 5909 break; 5901 5910 5911 /** @todo testcase for bits 31:16. We're not doing that correctly. */ 5912 5902 5913 case IEMMODE_32BIT: 5903 *(uint32_t *)iemGRegRef(pVCpu, iGReg) = (uint32_t)u64GuestCr0; 5914 if (IEM_GET_TARGET_CPU(pVCpu) >= IEMTARGETCPU_386) 5915 iemGRegStoreU32(pVCpu, iGReg, (uint32_t)u64GuestCr0); 5916 else /** @todo test this! */ 5917 iemGRegStoreU32(pVCpu, iGReg, (uint32_t)u64GuestCr0 | UINT32_C(0x7fffffe0)); /* Unused bits are set on 386. */ 5904 5918 break; 5905 5919 5906 5920 case IEMMODE_64BIT: 5907 *(uint64_t *)iemGRegRef(pVCpu, iGReg) = u64GuestCr0;5921 iemGRegStoreU64(pVCpu, iGReg, u64GuestCr0); 5908 5922 break; 5909 5923 … … 6654 6668 6655 6669 if (IEM_IS_64BIT_CODE(pVCpu)) 6656 *(uint64_t *)iemGRegRef(pVCpu, iGReg) = drX;6670 iemGRegStoreU64(pVCpu, iGReg, drX); 6657 6671 else 6658 *(uint64_t *)iemGRegRef(pVCpu, iGReg) = (uint32_t)drX;6672 iemGRegStoreU32(pVCpu, iGReg, (uint32_t)drX); 6659 6673 6660 6674 return iemRegAddToRipAndFinishingClearingRF(pVCpu, cbInstr); … … 6827 6841 * (different on 386/486) is exceedingly rare. 6828 6842 */ 6829 uint 64_t trX;6843 uint32_t trX; 6830 6844 switch (iTrReg) 6831 6845 { … … 6839 6853 } 6840 6854 6841 *(uint64_t *)iemGRegRef(pVCpu, iGReg) = (uint32_t)trX;6855 iemGRegStoreU32(pVCpu, iGReg, trX); 6842 6856 6843 6857 return iemRegAddToRipAndFinishingClearingRF(pVCpu, cbInstr); … … 6873 6887 * Read the new value from the source register. 6874 6888 */ 6875 uint64_t uNewTrX; 6876 if (IEM_IS_64BIT_CODE(pVCpu)) /** @todo err... 64-bit 386? */ 6877 uNewTrX = iemGRegFetchU64(pVCpu, iGReg); 6878 else 6879 uNewTrX = iemGRegFetchU32(pVCpu, iGReg); 6889 uint32_t uNewTrX = iemGRegFetchU32(pVCpu, iGReg); 6880 6890 6881 6891 /*
Note:
See TracChangeset
for help on using the changeset viewer.