- Timestamp:
- Oct 9, 2018 9:31:14 AM (6 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r74683 r74709 434 434 do { return iemVmxVmexitTaskSwitch((a_pVCpu), (a_enmTaskSwitch), (a_SelNewTss)); } while (0) 435 435 436 /** 437 * Invokes the VMX VM-exit handler for MWAIT. 438 */ 439 # define IEM_VMX_VMEXIT_MWAIT_RET(a_pVCpu, a_fMonitorArmed, a_cbInstr) \ 440 do { return iemVmxVmexitInstrMwait((a_pVCpu), (a_fMonitorArmed), (a_cbInstr)); } while (0) 441 436 442 #else 437 443 # define IEM_VMX_IS_ROOT_MODE(a_pVCpu) (false) … … 440 446 # define IEM_VMX_IS_PROCCTLS_SET(a_pVCpu, a_cbInstr) (false) 441 447 # define IEM_VMX_IS_PROCCTLS2_SET(a_pVCpu, a_cbInstr) (false) 442 # define IEM_VMX_VMEXIT_TASK_SWITCH_RET(a_pVCpu, a_enmTaskSwitch, a_SelNewTss) do { return VERR_VMX_IPE_1; } while (0)443 448 # define IEM_VMX_VMEXIT_INSTR_RET(a_pVCpu, a_uExitReason, a_cbInstr) do { return VERR_VMX_IPE_1; } while (0) 444 449 # define IEM_VMX_VMEXIT_INSTR_NEEDS_INFO_RET(a_pVCpu, a_uExitReason, a_uInstrId, a_cbInstr) do { return VERR_VMX_IPE_1; } while (0) 450 # define IEM_VMX_VMEXIT_TASK_SWITCH_RET(a_pVCpu, a_enmTaskSwitch, a_SelNewTss) do { return VERR_VMX_IPE_1; } while (0) 451 # define IEM_VMX_VMEXIT_MWAIT_RET(a_pVCpu, a_fMonitorArmed, a_cbInstr) do { return VERR_VMX_IPE_1; } while (0) 445 452 446 453 #endif -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r74706 r74709 7149 7149 } 7150 7150 7151 /* Check VMX nested-guest intercept. */ 7152 if ( IEM_VMX_IS_NON_ROOT_MODE(pVCpu) 7153 && IEM_VMX_IS_PROCCTLS_SET(pVCpu, VMX_PROC_CTLS_MWAIT_EXIT)) 7154 IEM_VMX_VMEXIT_MWAIT_RET(pVCpu, EMMonitorIsArmed(pVCpu), cbInstr); 7155 7151 7156 /* 7152 7157 * Gather the operands and validate them. 7153 7158 */ 7154 uint32_t uEax = pVCpu->cpum.GstCtx.eax;7155 uint32_t uEcx = pVCpu->cpum.GstCtx.ecx;7159 uint32_t const uEax = pVCpu->cpum.GstCtx.eax; 7160 uint32_t const uEcx = pVCpu->cpum.GstCtx.ecx; 7156 7161 if (uEcx != 0) 7157 7162 { … … 7171 7176 return iemRaiseGeneralProtectionFault0(pVCpu); 7172 7177 } 7178 7179 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX 7180 /* 7181 * If the interrupt-window exiting control is set or a virtual-interrupt is pending 7182 * for delivery; and interrupts are disabled the processor does not enter its 7183 * mwait state but rather passes control to the next instruction. 7184 * 7185 * See Intel spec. 25.3 "Changes to Instruction Behavior In VMX Non-root Operation". 7186 */ 7187 if ( IEM_VMX_IS_NON_ROOT_MODE(pVCpu) 7188 && !pVCpu->cpum.GstCtx.eflags.Bits.u1IF) 7189 { 7190 if ( IEM_VMX_IS_PROCCTLS_SET(pVCpu, VMX_PROC_CTLS_INT_WINDOW_EXIT) 7191 || VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INTERRUPT_NESTED_GUEST)) 7192 { 7193 iemRegAddToRipAndClearRF(pVCpu, cbInstr); 7194 return VINF_SUCCESS; 7195 } 7196 } 7197 #endif 7173 7198 } 7174 7199 -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r74706 r74709 3476 3476 3477 3477 /** 3478 * VMX VM-exit handler for VM-exits due to MWAIT instruction. 3479 * 3480 * @returns VBox strict status code. 3481 * @param pVCpu The cross context virtual CPU structure. 3482 * @param fMonitorHwArmed Whether the address-range monitor hardware is armed. 3483 * @param cbInstr The instruction length in bytes. 3484 */ 3485 IEM_STATIC VBOXSTRICTRC iemVmxVmexitInstrMwait(PVMCPU pVCpu, bool fMonitorHwArmed, uint8_t cbInstr) 3486 { 3487 VMXVEXITINFO ExitInfo; 3488 RT_ZERO(ExitInfo); 3489 ExitInfo.uReason = VMX_EXIT_MWAIT; 3490 ExitInfo.cbInstr = cbInstr; 3491 ExitInfo.u64Qual = fMonitorHwArmed; 3492 return iemVmxVmexitInstrWithInfo(pVCpu, &ExitInfo); 3493 } 3494 3495 3496 /** 3478 3497 * VMX VM-exit handler for TPR virtualization. 3479 3498 *
Note:
See TracChangeset
for help on using the changeset viewer.