Changeset 41935 in vbox
- Timestamp:
- Jun 27, 2012 7:43:40 PM (13 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r41934 r41935 446 446 VMMDECL(VBOXSTRICTRC) EMInterpretInstruction(PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault) 447 447 { 448 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));449 448 LogFlow(("EMInterpretInstruction %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault)); 450 449 #ifdef VBOX_WITH_IEM … … 502 501 { 503 502 LogFlow(("EMInterpretInstructionEx %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault)); 504 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));505 503 #ifdef VBOX_WITH_IEM 506 504 NOREF(pvFault); … … 566 564 { 567 565 LogFlow(("EMInterpretInstructionDisasState %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault)); 568 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));569 566 #ifdef VBOX_WITH_IEM 570 567 NOREF(pDis); NOREF(pvFault); NOREF(enmCodeType); … … 609 606 int rc; 610 607 611 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));612 608 Assert(!CPUMIsGuestIn64BitCode(pVCpu, pRegFrame)); 613 609 /** @todo Rainy day: Test what happens when VERR_EM_INTERPRETER is returned by … … 675 671 VMMDECL(int) EMInterpretCpuId(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame) 676 672 { 677 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));678 673 uint32_t iLeaf = pRegFrame->eax; 679 674 NOREF(pVM); … … 703 698 VMMDECL(int) EMInterpretRdtsc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame) 704 699 { 705 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));706 700 unsigned uCR4 = CPUMGetGuestCR4(pVCpu); 707 701 … … 730 724 VMMDECL(int) EMInterpretRdtscp(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx) 731 725 { 732 Assert(pCtx == CPUMQueryGuestCtxPtr(pVCpu)); 733 uint32_t uCR4 = CPUMGetGuestCR4(pVCpu); 726 unsigned uCR4 = CPUMGetGuestCR4(pVCpu); 734 727 735 728 if (!CPUMGetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_RDTSCP)) … … 765 758 VMMDECL(int) EMInterpretRdpmc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame) 766 759 { 767 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu)); 768 uint32_t uCR4 = CPUMGetGuestCR4(pVCpu); 760 unsigned uCR4 = CPUMGetGuestCR4(pVCpu); 769 761 770 762 /* If X86_CR4_PCE is not set, then CPL must be zero. */ … … 791 783 VMMDECL(VBOXSTRICTRC) EMInterpretMWait(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame) 792 784 { 793 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));794 785 uint32_t u32Dummy, u32ExtFeatures, cpl, u32MWaitFeatures; 795 786 NOREF(pVM); … … 831 822 { 832 823 uint32_t u32Dummy, u32ExtFeatures, cpl; 833 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));834 824 NOREF(pVM); 835 825 … … 872 862 * (in absence of segment override prefixes)???? 873 863 */ 874 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));875 864 NOREF(pVM); NOREF(pRegFrame); 876 865 #ifdef IN_RC … … 908 897 /** @todo Clean up this mess. */ 909 898 LogFlow(("EMInterpretCRxWrite at %RGv CR%d <- %RX64\n", (RTGCPTR)pRegFrame->rip, DestRegCrx, val)); 910 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));911 899 switch (DestRegCrx) 912 900 { … … 1044 1032 uint64_t val; 1045 1033 int rc; 1046 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));1047 1034 1048 1035 if (CPUMIsGuestIn64BitCode(pVCpu, pRegFrame)) … … 1075 1062 VMMDECL(int) EMInterpretLMSW(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint16_t u16Data) 1076 1063 { 1077 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));1078 1064 uint64_t OldCr0 = CPUMGetGuestCR0(pVCpu); 1079 1065 … … 1098 1084 { 1099 1085 NOREF(pVM); 1100 1101 1086 uint64_t cr0 = CPUMGetGuestCR0(pVCpu); 1102 1087 if (!(cr0 & X86_CR0_TS)) … … 1119 1104 VMMDECL(int) EMInterpretCRxRead(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegGen, uint32_t SrcRegCrx) 1120 1105 { 1121 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));1122 1106 uint64_t val64; 1123 1107 int rc = CPUMGetGuestCRx(pVCpu, SrcRegCrx, &val64); … … 1152 1136 VMMDECL(int) EMInterpretDRxWrite(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegDrx, uint32_t SrcRegGen) 1153 1137 { 1154 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));1155 1138 uint64_t val; 1156 1139 int rc; … … 1194 1177 { 1195 1178 uint64_t val64; 1196 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));1197 1179 NOREF(pVM); 1198 1180 … … 3045 3027 VMMDECL(int) EMInterpretWrmsr(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame) 3046 3028 { 3047 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));3048 3049 3029 /* Check the current privilege level, this instruction is supervisor only. */ 3050 3030 if (CPUMGetGuestCPL(pVCpu, pRegFrame) != 0) -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r41934 r41935 7777 7777 7778 7778 /** 7779 * Updates the real CPU context structure with the context core (from the trap 7780 * stack frame) before interpreting any instructions. 7781 * 7782 * @param pCtx The real CPU context. 7783 * @param pCtxCore The trap stack CPU core context. 7784 */ 7785 DECLINLINE(void) iemCtxCoreToCtx(PCPUMCTX pCtx, PCCPUMCTXCORE pCtxCore) 7786 { 7787 PCPUMCTXCORE pDst = CPUMCTX2CORE(pCtx); 7788 if (pDst != pCtxCore) 7789 *pDst = *pCtxCore; 7790 } 7791 7792 7793 /** 7794 * Updates the context core (from the trap stack frame) with the updated values 7795 * from the real CPU context structure after instruction emulation. 7796 * 7797 * @param pCtx The real CPU context. 7798 * @param pCtxCore The trap stack CPU core context. 7799 */ 7800 DECLINLINE(void) iemCtxToCtxCore(PCPUMCTXCORE pCtxCore, PCCPUMCTX pCtx) 7801 { 7802 PCCPUMCTXCORE pSrc = CPUMCTX2CORE(pCtx); 7803 if (pSrc != pCtxCore) 7804 *pCtxCore = *pSrc; 7805 } 7806 7807 7808 /** 7779 7809 * The actual code execution bits of IEMExecOne, IEMExecOneEx, and 7780 7810 * IEMExecOneWithPrefetchedByPC. … … 7886 7916 PIEMCPU pIemCpu = &pVCpu->iem.s; 7887 7917 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx); 7888 AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3); 7889 7918 7919 iemCtxCoreToCtx(pCtx, pCtxCore); 7890 7920 iemInitDecoder(pIemCpu); 7891 7921 uint32_t const cbOldWritten = pIemCpu->cbWritten; … … 7895 7925 { 7896 7926 rcStrict = iemExecOneInner(pVCpu, pIemCpu); 7927 if (rcStrict == VINF_SUCCESS) 7928 iemCtxToCtxCore(pCtxCore, pCtx); 7897 7929 if (pcbWritten) 7898 7930 *pcbWritten = pIemCpu->cbWritten - cbOldWritten; … … 7907 7939 PIEMCPU pIemCpu = &pVCpu->iem.s; 7908 7940 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx); 7909 AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3); 7941 7942 iemCtxCoreToCtx(pCtx, pCtxCore); 7910 7943 7911 7944 VBOXSTRICTRC rcStrict; … … 7923 7956 { 7924 7957 rcStrict = iemExecOneInner(pVCpu, pIemCpu); 7958 if (rcStrict == VINF_SUCCESS) 7959 iemCtxToCtxCore(pCtxCore, pCtx); 7925 7960 } 7926 7961 return rcStrict; -
trunk/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac
r41934 r41935 661 661 662 662 663 GLOBALNAME End664 663 ; 665 664 ; The description string (in the text section).
Note:
See TracChangeset
for help on using the changeset viewer.