vbox的更動 45485 路徑 trunk/src/VBox/VMM/VMMRC
- 時間撮記:
- 2013-4-11 下午02:46:04 (12 年 以前)
- 位置:
- trunk/src/VBox/VMM/VMMRC
- 檔案:
-
- 修改 4 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/VMM/VMMRC/CPUMRC.cpp
r45276 r45485 115 115 * @param pVCpu The current virtual CPU. 116 116 * @param pRegFrame Pointer to the register frame. 117 * 118 * @todo r=bird: This is very similar to CPUMGetGuestCPL and I cannot quite 119 * see why this variant of the code is necessary. 117 120 */ 118 121 VMMDECL(uint32_t) CPUMRCGetGuestCPL(PVMCPU pVCpu, PCPUMCTXCORE pRegFrame) … … 142 145 if (pVCpu->cpum.s.fRawEntered) 143 146 { 144 if ( EMIsRawRing1Enabled(pVCpu->CTX_SUFF(pVM))145 && uCpl == 2)147 if ( uCpl == 2 148 && EMIsRawRing1Enabled(pVCpu->CTX_SUFF(pVM)) ) 146 149 uCpl = 1; 147 else 148 if (uCpl == 1) 150 else if (uCpl == 1) 149 151 uCpl = 0; 150 152 } … … 162 164 } 163 165 166 164 167 #ifdef VBOX_WITH_RAW_RING1 165 168 /** … … 168 171 * This function will change the any of the cs and ss register with DPL=0 to DPL=1. 169 172 * 170 * @returns VBox status. (recompiler failure) 173 * Used by emInterpretIret() after the new state has been loaded. 174 * 171 175 * @param pVCpu Pointer to the VMCPU. 172 176 * @param pCtxCore The context core (for trap usage). 173 177 * @see @ref pg_raw 178 * @remarks Will be probably obsoleted by #5653 (it will leave and reenter raw 179 * mode instead, I think). 174 180 */ 175 181 VMMDECL(void) CPUMRCRecheckRawState(PVMCPU pVCpu, PCPUMCTXCORE pCtxCore) … … 213 219 } 214 220 #endif /* VBOX_WITH_RAW_RING1 */ 221 -
trunk/src/VBox/VMM/VMMRC/PATMRC.cpp
r45276 r45485 155 155 156 156 /* Very important check -> otherwise we have a security leak. */ 157 #ifdef VBOX_WITH_RAW_RING1 158 AssertReturn(!pRegFrame->eflags.Bits.u1VM && (pRegFrame->ss.Sel & X86_SEL_RPL) <= (unsigned) (EMIsRawRing1Enabled(pVM) ? 2 : 1), VERR_ACCESS_DENIED); 159 #else 160 AssertReturn(!pRegFrame->eflags.Bits.u1VM && (pRegFrame->ss.Sel & X86_SEL_RPL) == 1, VERR_ACCESS_DENIED); 161 #endif 157 AssertReturn(!pRegFrame->eflags.Bits.u1VM && (pRegFrame->ss.Sel & X86_SEL_RPL) <= (EMIsRawRing1Enabled(pVM) ? 2U : 1U), 158 VERR_ACCESS_DENIED); 162 159 Assert(PATMIsPatchGCAddr(pVM, pRegFrame->eip)); 163 160 … … 459 456 int rc; 460 457 461 #ifdef VBOX_WITH_RAW_RING1 462 AssertReturn(!pRegFrame->eflags.Bits.u1VM && ((pRegFrame->ss.Sel & X86_SEL_RPL) == 1 || (EMIsRawRing1Enabled(pVM) && (pRegFrame->ss.Sel & X86_SEL_RPL) == 2)), VERR_ACCESS_DENIED); 463 #else 464 AssertReturn(!pRegFrame->eflags.Bits.u1VM && (pRegFrame->ss.Sel & X86_SEL_RPL) == 1, VERR_ACCESS_DENIED); 465 #endif 458 AssertReturn(!pRegFrame->eflags.Bits.u1VM 459 && ( (pRegFrame->ss.Sel & X86_SEL_RPL) == 1 460 || (EMIsRawRing1Enabled(pVM) && (pRegFrame->ss.Sel & X86_SEL_RPL) == 2)), VERR_ACCESS_DENIED); 466 461 467 462 /* Int 3 in PATM generated code? (most common case) */ -
trunk/src/VBox/VMM/VMMRC/SELMRC.cpp
r45276 r45485 35 35 #include <iprt/asm.h> 36 36 37 #include "SELMInline.h" 38 37 39 38 40 /******************************************************************************* … … 43 45 static char const g_aszSRegNms[X86_SREG_COUNT][4] = { "ES", "CS", "SS", "DS", "FS", "GS" }; 44 46 #endif 47 45 48 46 49 #ifdef SELM_TRACK_GUEST_GDT_CHANGES … … 308 311 #endif /* SELM_TRACK_GUEST_GDT_CHANGES */ 309 312 313 310 314 #ifdef SELM_TRACK_GUEST_LDT_CHANGES 311 315 /** … … 332 336 } 333 337 #endif 338 334 339 335 340 #ifdef SELM_TRACK_GUEST_TSS_CHANGES … … 407 412 } 408 413 #ifdef VBOX_WITH_RAW_RING1 409 else 410 if ( EMIsRawRing1Enabled(pVM) 411 && PAGE_ADDRESS(&pGuestTss->esp1) == PAGE_ADDRESS(&pGuestTss->padding_ss1) 412 && PAGE_ADDRESS(&pGuestTss->esp1) == PAGE_ADDRESS((uint8_t *)pGuestTss + offRange) 413 && ( pGuestTss->esp1 != pVM->selm.s.Tss.esp2 414 || pGuestTss->ss1 != ((pVM->selm.s.Tss.ss2 & ~2) | 1)) /* undo raw-r1 */ 415 ) 414 else if ( EMIsRawRing1Enabled(pVM) 415 && PAGE_ADDRESS(&pGuestTss->esp1) == PAGE_ADDRESS(&pGuestTss->padding_ss1) 416 && PAGE_ADDRESS(&pGuestTss->esp1) == PAGE_ADDRESS((uint8_t *)pGuestTss + offRange) 417 && ( pGuestTss->esp1 != pVM->selm.s.Tss.esp2 418 || pGuestTss->ss1 != ((pVM->selm.s.Tss.ss2 & ~2) | 1)) /* undo raw-r1 */ 419 ) 416 420 { 417 421 Log(("selmRCGuestTSSWriteHandler: R1 stack: %RTsel:%RGv -> %RTsel:%RGv\n", … … 513 517 #endif /* SELM_TRACK_GUEST_TSS_CHANGES */ 514 518 519 515 520 #ifdef SELM_TRACK_SHADOW_GDT_CHANGES 516 521 /** … … 534 539 #endif 535 540 541 536 542 #ifdef SELM_TRACK_SHADOW_LDT_CHANGES 537 543 /** … … 556 562 #endif 557 563 564 558 565 #ifdef SELM_TRACK_SHADOW_TSS_CHANGES 559 566 /** -
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
r45305 r45485 304 304 PVM pVM = TRPMCPU_2_VM(pTrpmCpu); 305 305 PVMCPU pVCpu = TRPMCPU_2_VMCPU(pTrpmCpu); 306 //LogFlow(("TRPMGC01: cs:eip=%04x:%08x uDr6=%RTreg EFL=%x\n", pRegFrame->cs.Sel, pRegFrame->eip, uDr6, CPUMRawGetEFlags(pVCpu)));306 LogFlow(("TRPMGC01: cs:eip=%04x:%08x uDr6=%RTreg EFL=%x\n", pRegFrame->cs.Sel, pRegFrame->eip, uDr6, CPUMRawGetEFlags(pVCpu))); 307 307 TRPM_ENTER_DBG_HOOK(1); 308 308 … … 445 445 * PATM is using INT3s, let them have a go first. 446 446 */ 447 #ifdef VBOX_WITH_RAW_RING1 448 if ( ( (pRegFrame->ss.Sel & X86_SEL_RPL) == 1 449 || (EMIsRawRing1Enabled(pVM) && (pRegFrame->ss.Sel & X86_SEL_RPL) == 2)) 450 #else 451 if ( (pRegFrame->ss.Sel & X86_SEL_RPL) == 1 452 #endif 453 && !pRegFrame->eflags.Bits.u1VM) 447 if ( ( (pRegFrame->ss.Sel & X86_SEL_RPL) == 1 448 || (EMIsRawRing1Enabled(pVM) && (pRegFrame->ss.Sel & X86_SEL_RPL) == 2) ) 449 && !pRegFrame->eflags.Bits.u1VM) 454 450 { 455 451 rc = PATMRCHandleInt3PatchTrap(pVM, pRegFrame); … … 528 524 PGMRZDynMapStartAutoSet(pVCpu); 529 525 530 #ifdef VBOX_WITH_RAW_RING1 531 if (CPUMGetGuestCPL(pVCpu) <= (unsigned)(EMIsRawRing1Enabled(pVM) ? 1 : 0)) 532 #else 533 if (CPUMGetGuestCPL(pVCpu) == 0) 534 #endif 526 if (CPUMGetGuestCPL(pVCpu) <= (EMIsRawRing1Enabled(pVM) ? 1U : 0U)) 535 527 { 536 528 /*
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器