Changeset 97564 in vbox
- Timestamp:
- Nov 16, 2022 9:33:28 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154596
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp
r97524 r97564 8581 8581 } 8582 8582 8583 /* XMM registers. */8583 /* XMM registers. Skipped in 64-bit CPL0 if EFER.FFXSR (AMD only) is set. */ 8584 8584 if ( !(pVCpu->cpum.GstCtx.msrEFER & MSR_K6_EFER_FFXSR) 8585 8585 || pVCpu->iem.s.enmCpuMode != IEMMODE_64BIT 8586 8586 || pVCpu->iem.s.uCpl != 0) 8587 8587 { 8588 uint32_t cXmmRegs = enmEffOpSize == IEMMODE_64BIT ? 16 : 8;8588 uint32_t cXmmRegs = pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT ? 16 : 8; 8589 8589 for (uint32_t i = 0; i < cXmmRegs; i++) 8590 8590 pDst->aXMM[i] = pSrc->aXMM[i]; … … 8647 8647 */ 8648 8648 /** @todo CPU/VM detection possible! If CR4.OSFXSR=0 MXCSR it's 8649 * implementation specific whether MXCSR and XMM0-XMM7 are restored. */ 8649 * implementation specific whether MXCSR and XMM0-XMM7 are 8650 * restored according to Intel. 8651 * AMD says MXCSR and XMM registers are never loaded if 8652 * CR4.OSFXSR=0. 8653 */ 8650 8654 8651 8655 /* common for all formats */ … … 8665 8669 8666 8670 /* FPU IP, CS, DP and DS. */ 8667 if (pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT) 8671 /** @todo AMD says this is only done if FSW.ES is set after loading. */ 8672 if (enmEffOpSize == IEMMODE_64BIT) 8668 8673 { 8669 8674 pDst->FPUIP = pSrc->FPUIP; … … 8684 8689 } 8685 8690 8686 /* XMM registers. */ 8691 /* XMM registers. Skipped in 64-bit CPL0 if EFER.FFXSR (AMD only) is set. 8692 * Does not affect MXCSR, only registers. 8693 */ 8687 8694 if ( !(pVCpu->cpum.GstCtx.msrEFER & MSR_K6_EFER_FFXSR) 8688 8695 || pVCpu->iem.s.enmCpuMode != IEMMODE_64BIT 8689 8696 || pVCpu->iem.s.uCpl != 0) 8690 8697 { 8691 uint32_t cXmmRegs = enmEffOpSize == IEMMODE_64BIT ? 16 : 8;8698 uint32_t cXmmRegs = pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT ? 16 : 8; 8692 8699 for (uint32_t i = 0; i < cXmmRegs; i++) 8693 8700 pDst->aXMM[i] = pSrc->aXMM[i]; 8694 8701 } 8702 8703 pDst->FCW &= ~X86_FCW_ZERO_MASK; 8704 iemFpuRecalcExceptionStatus(pDst); 8695 8705 8696 8706 if (pDst->FSW & X86_FSW_ES) … … 8699 8709 8700 8710 /* 8701 * Committhe memory.8711 * Unmap the memory. 8702 8712 */ 8703 8713 rcStrict = iemMemCommitAndUnmap(pVCpu, pvMem512, IEM_ACCESS_DATA_R); … … 8940 8950 8941 8951 /* 8942 * Storethe X87 state.8952 * Load the X87 state. 8943 8953 */ 8944 8954 if (fReqComponents & XSAVE_C_X87) … … 8956 8966 if (enmEffOpSize == IEMMODE_64BIT) 8957 8967 { 8958 /* Saveupper 16-bits of FPUIP (IP:CS:Rsvd1) and FPUDP (DP:DS:Rsvd2). */8968 /* Load upper 16-bits of FPUIP (IP:CS:Rsvd1) and FPUDP (DP:DS:Rsvd2). */ 8959 8969 pDst->Rsrvd1 = pSrc->Rsrvd1; 8960 8970 pDst->Rsrvd2 = pSrc->Rsrvd2; … … 8972 8982 pDst->aRegs[i].au32[3] = 0; 8973 8983 } 8984 8985 pDst->FCW &= ~X86_FCW_ZERO_MASK; 8986 iemFpuRecalcExceptionStatus(pDst); 8987 8974 8988 if (pDst->FSW & X86_FSW_ES) 8975 8989 Log11(("xrstor: %04x:%08RX64: loading state with pending FPU exception (FSW=%#x)\n",
Note:
See TracChangeset
for help on using the changeset viewer.