Changeset 40449 in vbox
- Timestamp:
- Mar 13, 2012 3:51:02 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/selm.h
r37955 r40449 74 74 /** @} */ 75 75 76 VMMDECL(int) SELMToFlatEx(PVM pVM, DIS_SELREG SelReg, PCCPUMCTXCORE pCtxCore, RTGCPTR Addr, unsigned fFlags, PRTGCPTR ppvGC);77 VMMDECL(int) SELMToFlatBySelEx(PVM pVM, X86EFLAGS eflags, RTSEL Sel, RTGCPTR Addr, PCCPUMSELREGHID pHiddenSel,78 u nsignedfFlags, PRTGCPTR ppvGC, uint32_t *pcb);79 VMMDECL(int) SELMValidateAndConvertCSAddr(PVM pVM, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS,76 VMMDECL(int) SELMToFlatEx(PVMCPU pVCpu, DIS_SELREG SelReg, PCCPUMCTXCORE pCtxCore, RTGCPTR Addr, unsigned fFlags, PRTGCPTR ppvGC); 77 VMMDECL(int) SELMToFlatBySelEx(PVMCPU pVCpu, X86EFLAGS eflags, RTSEL Sel, RTGCPTR Addr, PCCPUMSELREGHID pHiddenSel, 78 uint32_t fFlags, PRTGCPTR ppvGC, uint32_t *pcb); 79 VMMDECL(int) SELMValidateAndConvertCSAddr(PVMCPU pVCpu, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS, 80 80 PCCPUMSELREGHID pHiddenCSSel, RTGCPTR Addr, PRTGCPTR ppvFlat); 81 VMMDECL(int) SELMValidateAndConvertCSAddrGCTrap(PVM pVM, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS, RTGCPTR Addr,81 VMMDECL(int) SELMValidateAndConvertCSAddrGCTrap(PVMCPU pVCpu, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS, RTGCPTR Addr, 82 82 PRTGCPTR ppvFlat, uint32_t *pcBits); 83 VMMDECL(DISCPUMODE) SELMGetCpuModeFromSelector(PVM pVM, X86EFLAGS eflags, RTSEL Sel, PCCPUMSELREGHID pHiddenSel);83 VMMDECL(DISCPUMODE) SELMGetCpuModeFromSelector(PVMCPU pVCpu, X86EFLAGS eflags, RTSEL Sel, PCCPUMSELREGHID pHiddenSel); 84 84 VMMDECL(int) SELMGetLDTFromSel(PVM pVM, RTSEL SelLdt, PRTGCPTR ppvLdt, unsigned *pcbLimit); 85 85 -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r40448 r40449 288 288 * 289 289 */ 290 static DECLCALLBACK(int) EMReadBytes(RTUINTPTR pSrc, uint8_t *pDest, unsigned cb, void *pvUserdata)290 static DECLCALLBACK(int) emReadBytes(RTUINTPTR pSrc, uint8_t *pDest, unsigned cb, void *pvUserdata) 291 291 { 292 292 PDISCPUSTATE pDis = (PDISCPUSTATE)pvUserdata; … … 304 304 { 305 305 unsigned offset = pSrc - pState->GCPtr; 306 307 306 Assert(pSrc >= pState->GCPtr); 308 307 309 for (unsigned i=0; i<cb; i++) 310 { 308 for (unsigned i = 0; i < cb; i++) 311 309 pDest[i] = pState->aOpcode[offset + i]; 312 }313 310 return VINF_SUCCESS; 314 311 } … … 368 365 State.GCPtr = NIL_RTGCPTR; 369 366 } 370 return DISCoreOneEx(InstrGC, pDis->mode, EMReadBytes, &State, pDis, pOpsize);367 return DISCoreOneEx(InstrGC, pDis->mode, emReadBytes, &State, pDis, pOpsize); 371 368 } 372 369 … … 381 378 State.GCPtr = InstrGC; 382 379 383 return DISCoreOneEx(InstrGC, pDis->mode, EMReadBytes, &State, pDis, pOpsize);380 return DISCoreOneEx(InstrGC, pDis->mode, emReadBytes, &State, pDis, pOpsize); 384 381 } 385 382 … … 403 400 { 404 401 RTGCPTR GCPtrInstr; 405 int rc = SELMToFlatEx(pV M, DIS_SELREG_CS, pCtxCore, pCtxCore->rip, 0, &GCPtrInstr);402 int rc = SELMToFlatEx(pVCpu, DIS_SELREG_CS, pCtxCore, pCtxCore->rip, 0, &GCPtrInstr); 406 403 if (RT_FAILURE(rc)) 407 404 { … … 459 456 #endif 460 457 461 rc = DISCoreOneEx(GCPtrInstr, SELMGetCpuModeFromSelector(pV M, pCtxCore->eflags, pCtxCore->cs, (PCPUMSELREGHID)&pCtxCore->csHid),462 EMReadBytes, &State,458 rc = DISCoreOneEx(GCPtrInstr, SELMGetCpuModeFromSelector(pVCpu, pCtxCore->eflags, pCtxCore->cs, (PCPUMSELREGHID)&pCtxCore->csHid), 459 emReadBytes, &State, 463 460 pDis, pcbInstr); 464 461 if (RT_SUCCESS(rc)) … … 503 500 #else 504 501 RTGCPTR pbCode; 505 VBOXSTRICTRC rc = SELMToFlatEx(pV M, DIS_SELREG_CS, pRegFrame, pRegFrame->rip, 0, &pbCode);502 VBOXSTRICTRC rc = SELMToFlatEx(pVCpu, DIS_SELREG_CS, pRegFrame, pRegFrame->rip, 0, &pbCode); 506 503 if (RT_SUCCESS(rc)) 507 504 { 508 505 uint32_t cbOp; 509 506 PDISCPUSTATE pDis = &pVCpu->em.s.DisState; 510 pDis->mode = SELMGetCpuModeFromSelector(pV M, pRegFrame->eflags, pRegFrame->cs, &pRegFrame->csHid);511 rc = emDisCoreOne(pV M, pVCpu, pDis, (RTGCUINTPTR)pbCode, &cbOp);507 pDis->mode = SELMGetCpuModeFromSelector(pVCpu, pRegFrame->eflags, pRegFrame->cs, &pRegFrame->csHid); 508 rc = emDisCoreOne(pVCpu->CTX_SUFF(pVM), pVCpu, pDis, (RTGCUINTPTR)pbCode, &cbOp); 512 509 if (RT_SUCCESS(rc)) 513 510 { … … 560 557 #else 561 558 RTGCPTR pbCode; 562 VBOXSTRICTRC rc = SELMToFlatEx(pV M, DIS_SELREG_CS, pRegFrame, pRegFrame->rip, 0, &pbCode);559 VBOXSTRICTRC rc = SELMToFlatEx(pVCpu, DIS_SELREG_CS, pRegFrame, pRegFrame->rip, 0, &pbCode); 563 560 if (RT_SUCCESS(rc)) 564 561 { 565 562 uint32_t cbOp; 566 563 PDISCPUSTATE pDis = &pVCpu->em.s.DisState; 567 pDis->mode = SELMGetCpuModeFromSelector(pV M, pRegFrame->eflags, pRegFrame->cs, &pRegFrame->csHid);568 rc = emDisCoreOne(pV M, pVCpu, pDis, (RTGCUINTPTR)pbCode, &cbOp);564 pDis->mode = SELMGetCpuModeFromSelector(pVCpu, pRegFrame->eflags, pRegFrame->cs, &pRegFrame->csHid); 565 rc = emDisCoreOne(pVCpu->CTX_SUFF(pVM), pVCpu, pDis, (RTGCUINTPTR)pbCode, &cbOp); 569 566 if (RT_SUCCESS(rc)) 570 567 { … … 967 964 968 965 /* Read stack value first */ 969 if (SELMGetCpuModeFromSelector(pV M, pRegFrame->eflags, pRegFrame->ss, &pRegFrame->ssHid) == CPUMODE_16BIT)966 if (SELMGetCpuModeFromSelector(pVCpu, pRegFrame->eflags, pRegFrame->ss, &pRegFrame->ssHid) == CPUMODE_16BIT) 970 967 return VERR_EM_INTERPRETER; /* No legacy 16 bits stuff here, please. */ 971 968 -
trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
r40280 r40449 2052 2052 /* Convert destination address es:edi. */ 2053 2053 RTGCPTR GCPtrDst; 2054 int rc2 = SELMToFlatEx(pV M, DIS_SELREG_ES, pRegFrame, pRegFrame->rdi & fAddrMask,2054 int rc2 = SELMToFlatEx(pVCpu, DIS_SELREG_ES, pRegFrame, pRegFrame->rdi & fAddrMask, 2055 2055 SELMTOFLAT_FLAGS_HYPER | SELMTOFLAT_FLAGS_NO_PL, 2056 2056 &GCPtrDst); … … 2214 2214 /* Convert source address ds:esi. */ 2215 2215 RTGCPTR GCPtrSrc; 2216 int rc2 = SELMToFlatEx(pV M, DIS_SELREG_DS, pRegFrame, pRegFrame->rsi & fAddrMask,2216 int rc2 = SELMToFlatEx(pVCpu, DIS_SELREG_DS, pRegFrame, pRegFrame->rsi & fAddrMask, 2217 2217 SELMTOFLAT_FLAGS_HYPER | SELMTOFLAT_FLAGS_NO_PL, 2218 2218 &GCPtrSrc); -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r40274 r40449 907 907 */ 908 908 RTGCPTR PC; 909 rc = SELMValidateAndConvertCSAddr(pV M, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs,909 rc = SELMValidateAndConvertCSAddr(pVCpu, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, 910 910 &pRegFrame->csHid, (RTGCPTR)pRegFrame->eip, &PC); 911 911 if (rc == VINF_SUCCESS) -
trunk/src/VBox/VMM/VMMAll/SELMAll.cpp
r39078 r40449 140 140 * 141 141 * @returns VBox status 142 * @param pV M VM Handle.143 * @param SelReg Selector register 144 * @param pCtxCore CPU context 142 * @param pVCpu The virtual CPU handle. 143 * @param SelReg Selector register. 144 * @param pCtxCore CPU context. 145 145 * @param Addr Address part. 146 146 * @param fFlags SELMTOFLAT_FLAGS_* … … 148 148 * @param ppvGC Where to store the GC flat address. 149 149 */ 150 VMMDECL(int) SELMToFlatEx(PVM pVM, DIS_SELREG SelReg, PCCPUMCTXCORE pCtxCore, RTGCPTR Addr, unsigned fFlags, PRTGCPTR ppvGC)150 VMMDECL(int) SELMToFlatEx(PVMCPU pVCpu, DIS_SELREG SelReg, PCCPUMCTXCORE pCtxCore, RTGCPTR Addr, unsigned fFlags, PRTGCPTR ppvGC) 151 151 { 152 152 /* … … 155 155 PCPUMSELREGHID pHiddenSel; 156 156 RTSEL Sel; 157 PVMCPU pVCpu = VMMGetCpu(pVM);158 157 159 158 int rc = DISFetchRegSegEx(pCtxCore, SelReg, &Sel, &pHiddenSel); … … 303 302 X86DESC Desc; 304 303 304 PVM pVM = pVCpu->CTX_SUFF(pVM); 305 305 if (!(Sel & X86_SEL_LDT)) 306 306 { … … 448 448 * 449 449 * @returns VBox status 450 * @param pV M VM Handle.450 * @param pVCpu The virtual CPU handle. 451 451 * @param eflags Current eflags 452 452 * @param Sel Selector part. … … 460 460 * @remarks Don't use when in long mode. 461 461 */ 462 VMMDECL(int) SELMToFlatBySelEx(PVM pVM, X86EFLAGS eflags, RTSEL Sel, RTGCPTR Addr, PCCPUMSELREGHID pHiddenSel, unsigned fFlags, PRTGCPTR ppvGC, uint32_t *pcb) 463 { 464 PVMCPU pVCpu = VMMGetCpu(pVM); 465 462 VMMDECL(int) SELMToFlatBySelEx(PVMCPU pVCpu, X86EFLAGS eflags, RTSEL Sel, RTGCPTR Addr, PCCPUMSELREGHID pHiddenSel, uint32_t fFlags, PRTGCPTR ppvGC, uint32_t *pcb) 463 { 466 464 Assert(!CPUMIsGuestInLongMode(pVCpu)); /* DON'T USE! */ 467 465 … … 514 512 X86DESC Desc; 515 513 514 PVM pVM = pVCpu->CTX_SUFF(pVM); 516 515 if (!(Sel & X86_SEL_LDT)) 517 516 { … … 834 833 * 835 834 * @returns VBox status code. 836 * @param pVM VM Handle. 837 * @param eflags Current eflags 838 * @param SelCPL Current privilege level. Get this from SS - CS might be conforming! 839 * A full selector can be passed, we'll only use the RPL part. 840 * @param SelCS Selector part. 841 * @param Addr Address part. 842 * @param ppvFlat Where to store the flat address. 843 * @param pcBits Where to store the 64-bit/32-bit/16-bit indicator. 844 */ 845 VMMDECL(int) SELMValidateAndConvertCSAddrGCTrap(PVM pVM, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS, RTGCPTR Addr, PRTGCPTR ppvFlat, uint32_t *pcBits) 846 { 847 Assert(pVM->cCpus == 1); 848 PVMCPU pVCpu = &pVM->aCpus[0]; 849 835 * @param pVCpu The virtual CPU handle. 836 * @param eflags Current eflags 837 * @param SelCPL Current privilege level. Get this from SS - CS might be 838 * conforming! A full selector can be passed, we'll only 839 * use the RPL part. 840 * @param SelCS Selector part. 841 * @param Addr Address part. 842 * @param ppvFlat Where to store the flat address. 843 * @param pcBits Where to store the 64-bit/32-bit/16-bit indicator. 844 */ 845 VMMDECL(int) SELMValidateAndConvertCSAddrGCTrap(PVMCPU pVCpu, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS, RTGCPTR Addr, PRTGCPTR ppvFlat, uint32_t *pcBits) 846 { 850 847 if ( eflags.Bits.u1VM 851 848 || CPUMIsGuestInRealMode(pVCpu)) … … 855 852 } 856 853 Assert(!CPUMAreHiddenSelRegsValid(pVCpu)); 857 return selmValidateAndConvertCSAddrStd(pV M, pVCpu, SelCPL, SelCS, Addr, ppvFlat, pcBits);854 return selmValidateAndConvertCSAddrStd(pVCpu->CTX_SUFF(pVM), pVCpu, SelCPL, SelCS, Addr, ppvFlat, pcBits); 858 855 } 859 856 #endif /* IN_RC */ … … 864 861 * 865 862 * @returns VBox status code. 866 * @param pV M VM Handle.863 * @param pVCpu The virtual CPU handle. 867 864 * @param eflags Current eflags 868 865 * @param SelCPL Current privilege level. Get this from SS - CS might be conforming! … … 873 870 * @param ppvFlat Where to store the flat address. 874 871 */ 875 VMMDECL(int) SELMValidateAndConvertCSAddr(PVM pVM, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS, PCCPUMSELREGHID pHiddenCSSel,872 VMMDECL(int) SELMValidateAndConvertCSAddr(PVMCPU pVCpu, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS, PCCPUMSELREGHID pHiddenCSSel, 876 873 RTGCPTR Addr, PRTGCPTR ppvFlat) 877 874 { 878 PVMCPU pVCpu = VMMGetCpu(pVM);879 880 875 if ( eflags.Bits.u1VM 881 876 || CPUMIsGuestInRealMode(pVCpu)) … … 887 882 /** @todo when we're in 16 bits mode, we should cut off the address as well? (like in selmValidateAndConvertCSAddrRealMode) */ 888 883 if (!CPUMAreHiddenSelRegsValid(pVCpu) || !pHiddenCSSel) 889 return selmValidateAndConvertCSAddrStd(pV M, pVCpu, SelCPL, SelCS, Addr, ppvFlat, NULL);884 return selmValidateAndConvertCSAddrStd(pVCpu->CTX_SUFF(pVM), pVCpu, SelCPL, SelCS, Addr, ppvFlat, NULL); 890 885 #endif 891 886 return selmValidateAndConvertCSAddrHidden(pVCpu, SelCPL, SelCS, pHiddenCSSel, Addr, ppvFlat); … … 925 920 * 926 921 * @returns DISCPUMODE according to the selector type (16, 32 or 64 bits) 927 * @param pV M VM Handle.922 * @param pVCpu The virtual CPU handle. 928 923 * @param eflags Current eflags register 929 924 * @param Sel The selector. 930 925 * @param pHiddenSel The hidden selector register. 931 926 */ 932 VMMDECL(DISCPUMODE) SELMGetCpuModeFromSelector(PVM pVM, X86EFLAGS eflags, RTSEL Sel, PCCPUMSELREGHID pHiddenSel) 933 { 934 PVMCPU pVCpu = VMMGetCpu(pVM); 927 VMMDECL(DISCPUMODE) SELMGetCpuModeFromSelector(PVMCPU pVCpu, X86EFLAGS eflags, RTSEL Sel, PCCPUMSELREGHID pHiddenSel) 928 { 935 929 #ifdef IN_RING0 936 930 Assert(CPUMAreHiddenSelRegsValid(pVCpu)); … … 946 940 return CPUMODE_16BIT; 947 941 948 return selmGetCpuModeFromSelector(pV M, pVCpu, Sel);942 return selmGetCpuModeFromSelector(pVCpu->CTX_SUFF(pVM), pVCpu, Sel); 949 943 } 950 944 #endif /* !IN_RING0 */ -
trunk/src/VBox/VMM/VMMAll/TRPMAll.cpp
r39078 r40449 488 488 fakeflags.u32 = 0; 489 489 490 rc = SELMValidateAndConvertCSAddr(pV M, fakeflags, 0, GuestIdte.Gen.u16SegSel, NULL, pHandler, &dummy);490 rc = SELMValidateAndConvertCSAddr(pVCpu, fakeflags, 0, GuestIdte.Gen.u16SegSel, NULL, pHandler, &dummy); 491 491 if (rc == VINF_SUCCESS) 492 492 { … … 554 554 || !ss_r0 555 555 || (ss_r0 & X86_SEL_RPL) != ((dpl == 0) ? 1 : dpl) 556 || SELMToFlatBySelEx(pV M, fakeflags, ss_r0, (RTGCPTR)esp_r0, NULL, SELMTOFLAT_FLAGS_CPL1, (PRTGCPTR)&pTrapStackGC, NULL) != VINF_SUCCESS556 || SELMToFlatBySelEx(pVCpu, fakeflags, ss_r0, (RTGCPTR)esp_r0, NULL, SELMTOFLAT_FLAGS_CPL1, (PRTGCPTR)&pTrapStackGC, NULL) != VINF_SUCCESS 557 557 ) 558 558 { … … 568 568 569 569 if ( eflags.Bits.u1VM /* illegal */ 570 || SELMToFlatBySelEx(pV M, fakeflags, ss_r0, (RTGCPTR)esp_r0, NULL, SELMTOFLAT_FLAGS_CPL1, (PRTGCPTR)&pTrapStackGC, NULL) != VINF_SUCCESS)570 || SELMToFlatBySelEx(pVCpu, fakeflags, ss_r0, (RTGCPTR)esp_r0, NULL, SELMTOFLAT_FLAGS_CPL1, (PRTGCPTR)&pTrapStackGC, NULL) != VINF_SUCCESS) 571 571 { 572 572 AssertMsgFailed(("Invalid stack %04X:%08RX32??? (VM=%d)\n", ss_r0, esp_r0, eflags.Bits.u1VM)); -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r40447 r40449 2738 2738 * Only allow 32 & 64 bits code. 2739 2739 */ 2740 DISCPUMODE enmMode = SELMGetCpuModeFromSelector(pV M, pRegFrame->eflags, pRegFrame->cs, &pRegFrame->csHid);2740 DISCPUMODE enmMode = SELMGetCpuModeFromSelector(pVCpu, pRegFrame->eflags, pRegFrame->cs, &pRegFrame->csHid); 2741 2741 if (enmMode != CPUMODE_16BIT) 2742 2742 { 2743 2743 RTGCPTR pbCode; 2744 int rc = SELMValidateAndConvertCSAddr(pV M, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs,2744 int rc = SELMValidateAndConvertCSAddr(pVCpu, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, 2745 2745 &pRegFrame->csHid, (RTGCPTR)pRegFrame->rip, &pbCode); 2746 2746 if (RT_SUCCESS(rc)) -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r40447 r40449 3181 3181 } 3182 3182 3183 rc2 = SELMToFlatEx(pV M, DIS_SELREG_SS, CPUMCTX2CORE(pCtx), pCtx->esp & uMask, 0, &GCPtrStack);3183 rc2 = SELMToFlatEx(pVCpu, DIS_SELREG_SS, CPUMCTX2CORE(pCtx), pCtx->esp & uMask, 0, &GCPtrStack); 3184 3184 if (RT_FAILURE(rc2)) 3185 3185 { … … 3223 3223 } 3224 3224 3225 rc2 = SELMToFlatEx(pV M, DIS_SELREG_SS, CPUMCTX2CORE(pCtx), (pCtx->esp - cbParm) & uMask, 0, &GCPtrStack);3225 rc2 = SELMToFlatEx(pVCpu, DIS_SELREG_SS, CPUMCTX2CORE(pCtx), (pCtx->esp - cbParm) & uMask, 0, &GCPtrStack); 3226 3226 if (RT_FAILURE(rc2)) 3227 3227 { … … 3259 3259 } 3260 3260 3261 rc2 = SELMToFlatEx(pV M, DIS_SELREG_SS, CPUMCTX2CORE(pCtx), pCtx->esp & uMask, 0, &GCPtrStack);3261 rc2 = SELMToFlatEx(pVCpu, DIS_SELREG_SS, CPUMCTX2CORE(pCtx), pCtx->esp & uMask, 0, &GCPtrStack); 3262 3262 if (RT_FAILURE(rc2)) 3263 3263 { -
trunk/src/VBox/VMM/VMMR3/CSAM.cpp
r40274 r40449 2272 2272 { 2273 2273 /* Assuming 32 bits code for now. */ 2274 Assert(SELMGetCpuModeFromSelector( pVM, pCtxCore->eflags, pCtxCore->cs, &pCtxCore->csHid) == CPUMODE_32BIT);2274 Assert(SELMGetCpuModeFromSelector(VMMGetCpu0(pVM), pCtxCore->eflags, pCtxCore->cs, &pCtxCore->csHid) == CPUMODE_32BIT); 2275 2275 2276 2276 pInstrGC = SELMToFlat(pVM, DIS_SELREG_CS, pCtxCore, pInstrGC); -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r40442 r40449 684 684 { 685 685 rc = PATMR3InstallPatch(pVM, SELMToFlat(pVM, DIS_SELREG_CS, CPUMCTX2CORE(pCtx), pCtx->eip), 686 (SELMGetCpuModeFromSelector(pV M, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT) ? PATMFL_CODE32 : 0);686 (SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT) ? PATMFL_CODE32 : 0); 687 687 if (RT_SUCCESS(rc)) 688 688 { … … 934 934 { 935 935 int rc = PATMR3InstallPatch(pVM, SELMToFlat(pVM, DIS_SELREG_CS, CPUMCTX2CORE(pCtx), pCtx->eip), 936 (SELMGetCpuModeFromSelector(pV M, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT) ? PATMFL_CODE32 : 0);936 (SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT) ? PATMFL_CODE32 : 0); 937 937 if (RT_SUCCESS(rc)) 938 938 { … … 1041 1041 if ( (pCtx->ss & X86_SEL_RPL) == 0 1042 1042 && !pCtx->eflags.Bits.u1VM 1043 && SELMGetCpuModeFromSelector(pV M, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT)1043 && SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT) 1044 1044 { 1045 1045 STAM_PROFILE_START(&pVCpu->em.s.StatPrivEmu, a); -
trunk/src/VBox/VMM/VMMRC/PATMRC.cpp
r40447 r40449 472 472 return VINF_SUCCESS; 473 473 } 474 else475 474 if (pRec->patch.flags & PATMFL_INT3_REPLACEMENT) 476 475 { … … 506 505 } 507 506 508 cpu.mode = SELMGetCpuModeFromSelector( pVM, pRegFrame->eflags, pRegFrame->cs, 0);509 if (cpu.mode != CPUMODE_32BIT)507 cpu.mode = SELMGetCpuModeFromSelector(VMMGetCpu0(pVM), pRegFrame->eflags, pRegFrame->cs, 0); 508 if (cpu.mode != CPUMODE_32BIT) 510 509 { 511 510 AssertFailed(); -
trunk/src/VBox/VMM/VMMRC/TRPMRC.cpp
r40447 r40449 177 177 */ 178 178 RTGCPTR PC; 179 int rc = SELMValidateAndConvertCSAddr(pV M, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid,179 int rc = SELMValidateAndConvertCSAddr(pVCpu, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid, 180 180 (RTGCPTR)pRegFrame->eip, &PC); 181 181 if (rc == VINF_SUCCESS) -
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
r40442 r40449 494 494 */ 495 495 RTGCPTR PC; 496 rc = SELMValidateAndConvertCSAddr(pV M, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid,496 rc = SELMValidateAndConvertCSAddr(pVCpu, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid, 497 497 (RTGCPTR)pRegFrame->eip, &PC); 498 498 if (RT_FAILURE(rc)) … … 629 629 */ 630 630 RTGCPTR GCPtr; 631 if ( SELMValidateAndConvertCSAddr(pV M, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid,631 if ( SELMValidateAndConvertCSAddr(pVCpu, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid, 632 632 (RTGCPTR)pRegFrame->eip, &GCPtr) 633 633 == VINF_SUCCESS) … … 951 951 RTGCPTR PC; 952 952 uint32_t cBits; 953 int rc = SELMValidateAndConvertCSAddrGCTrap(pV M, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs,953 int rc = SELMValidateAndConvertCSAddrGCTrap(pVCpu, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, 954 954 (RTGCPTR)pRegFrame->eip, &PC, &cBits); 955 955 if (RT_FAILURE(rc)) -
trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp
r39405 r40449 125 125 { 126 126 RTGCPTR pPc; 127 int rc = SELMValidateAndConvertCSAddr(pV M, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid,127 int rc = SELMValidateAndConvertCSAddr(pVCpu, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid, 128 128 #ifdef IN_RC 129 129 (RTGCPTR)((RTGCUINTPTR)pRegFrame->eip - 1), -
trunk/src/VBox/VMM/include/EMHandleRCTmpl.h
r40280 r40449 112 112 case VINF_PATM_HC_MMIO_PATCH_READ: 113 113 rc = PATMR3InstallPatch(pVM, SELMToFlat(pVM, DIS_SELREG_CS, CPUMCTX2CORE(pCtx), pCtx->eip), 114 PATMFL_MMIO_ACCESS | ((SELMGetCpuModeFromSelector(pV M, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT) ? PATMFL_CODE32 : 0));114 PATMFL_MMIO_ACCESS | ((SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT) ? PATMFL_CODE32 : 0)); 115 115 if (RT_FAILURE(rc)) 116 116 rc = emR3ExecuteInstruction(pVM, pVCpu, "MMIO");
Note:
See TracChangeset
for help on using the changeset viewer.