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