Changeset 46168 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 19, 2013 10:58:37 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r46165 r46168 771 771 pIemCpu->rcPassUp = VINF_SUCCESS; 772 772 pIemCpu->fBypassHandlers = fBypassHandlers; 773 773 #ifdef IN_RC 774 pIemCpu->fInPatchCode = pIemCpu->uCpl == 0 775 && pCtx->cs.u64Base == 0 776 && pCtx->cs.u32Limit == UINT32_MAX 777 && PATMIsPatchGCAddr(IEMCPU_TO_VM(pIemCpu), pCtx->eip); 778 if (!pIemCpu->fInPatchCode) 779 CPUMRawLeave(pVCpu, CPUMCTX2CORE(pCtx), VINF_SUCCESS); 780 #endif 774 781 } 775 782 … … 818 825 /* Allow interpretation of patch manager code blocks since they can for 819 826 instance throw #PFs for perfectly good reasons. */ 820 if ( (pCtx->cs.Sel & X86_SEL_RPL) == 1 821 && PATMIsPatchGCAddr(IEMCPU_TO_VM(pIemCpu), GCPtrPC)) 827 if (pIemCpu->fInPatchCode) 822 828 { 823 829 uint32_t cbLeftOnPage = PAGE_SIZE - (GCPtrPC & PAGE_OFFSET_MASK); … … 8372 8378 8373 8379 8380 #ifdef IN_RC 8381 /** 8382 * Re-enters raw-mode or ensure we return to ring-3. 8383 * 8384 * @returns rcStrict, maybe modified. 8385 * @param pIemCpu The IEM CPU structure. 8386 * @param pVCpu The cross context virtual CPU structure of the caller. 8387 * @param pCtx The current CPU context. 8388 * @param rcStrict The status code returne by the interpreter. 8389 */ 8390 DECLINLINE(VBOXSTRICTRC) iemRCRawMaybeReenter(PIEMCPU pIemCpu, PVMCPU pVCpu, PCPUMCTX pCtx, VBOXSTRICTRC rcStrict) 8391 { 8392 if (!pIemCpu->fInPatchCode) 8393 CPUMRawEnter(pVCpu, CPUMCTX2CORE(pCtx)); 8394 return rcStrict; 8395 } 8396 #endif 8397 8398 8374 8399 /** 8375 8400 * Execute one instruction. … … 8432 8457 iemExecVerificationModeCheck(pIemCpu); 8433 8458 #endif 8459 #ifdef IN_RC 8460 rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pCtx, rcStrict); 8461 #endif 8434 8462 if (rcStrict != VINF_SUCCESS) 8435 8463 LogFlow(("IEMExecOne: cs:rip=%04x:%08RX64 ss:rsp=%04x:%08RX64 EFL=%06x - rcStrict=%Rrc\n", … … 8445 8473 AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3); 8446 8474 8447 iemInitDecoder(pIemCpu, false);8448 8475 uint32_t const cbOldWritten = pIemCpu->cbWritten; 8449 8450 8476 VBOXSTRICTRC rcStrict = iemInitDecoderAndPrefetchOpcodes(pIemCpu, false); 8451 8477 if (rcStrict == VINF_SUCCESS) … … 8455 8481 *pcbWritten = pIemCpu->cbWritten - cbOldWritten; 8456 8482 } 8483 8484 #ifdef IN_RC 8485 rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pCtx, rcStrict); 8486 #endif 8457 8487 return rcStrict; 8458 8488 } … … 8481 8511 rcStrict = iemExecOneInner(pVCpu, pIemCpu, true); 8482 8512 } 8513 8514 #ifdef IN_RC 8515 rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pCtx, rcStrict); 8516 #endif 8483 8517 return rcStrict; 8484 8518 } … … 8491 8525 AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3); 8492 8526 8493 #ifdef IN_RC8494 CPUMRawLeave(pVCpu, pCtxCore, VINF_SUCCESS);8495 #endif8496 8497 iemInitDecoder(pIemCpu, true);8498 8527 uint32_t const cbOldWritten = pIemCpu->cbWritten; 8499 8500 8528 VBOXSTRICTRC rcStrict = iemInitDecoderAndPrefetchOpcodes(pIemCpu, true); 8501 8529 if (rcStrict == VINF_SUCCESS) … … 8507 8535 8508 8536 #ifdef IN_RC 8509 CPUMRawEnter(pVCpu, pCtxCore);8537 rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pCtx, rcStrict); 8510 8538 #endif 8511 8539 return rcStrict; … … 8519 8547 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx); 8520 8548 AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3); 8521 8522 #ifdef IN_RC8523 CPUMRawLeave(pVCpu, pCtxCore, VINF_SUCCESS);8524 #endif8525 8549 8526 8550 VBOXSTRICTRC rcStrict; … … 8539 8563 8540 8564 #ifdef IN_RC 8541 CPUMRawEnter(pVCpu, pCtxCore);8565 rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pCtx, rcStrict); 8542 8566 #endif 8543 8567 return rcStrict; -
trunk/src/VBox/VMM/include/IEMInternal.h
r42778 r46168 214 214 /** Whether to bypass access handlers or not. */ 215 215 bool fBypassHandlers; 216 /** Indicates that we're interpreting patch code - RC only! */ 217 bool fInPatchCode; 216 218 /** Explicit alignment padding. */ 217 bool afAlignment0[ 3];219 bool afAlignment0[2]; 218 220 219 221 /** The flags of the current exception / interrupt. */ -
trunk/src/VBox/VMM/include/SELMInline.h
r45485 r46168 282 282 pSReg->u64Base = X86DESC_BASE(pShwDesc); 283 283 pSReg->ValidSel = pSReg->Sel; 284 /** @todo VBOX_WITH_RAW_RING1 */ 284 285 if (pSReg->Attr.n.u1Available) 285 286 pSReg->ValidSel &= ~(RTSEL)1; … … 303 304 pSReg->u64Base = X86DESC_BASE(pGstDesc); 304 305 pSReg->ValidSel = pSReg->Sel; 306 /** @todo VBOX_WITH_RAW_RING1 */ 305 307 if ((pSReg->ValidSel & 1) && CPUMIsGuestInRawMode(pVCpu)) 306 308 pSReg->ValidSel &= ~(RTSEL)1;
Note:
See TracChangeset
for help on using the changeset viewer.