Changeset 52066 in vbox
- Timestamp:
- Jul 17, 2014 7:02:33 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 95068
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/vm.h
r52041 r52066 405 405 /** Inhibit interrupts pending. See EMGetInhibitInterruptsPC(). */ 406 406 #define VMCPU_FF_INHIBIT_INTERRUPTS RT_BIT_32(24) 407 /** Inhibit non-maskable interrupts. */408 #define VMCPU_FF_ INHIBIT_NMISRT_BIT_32(25)407 /** Block injection of non-maskable interrupts to the guest. */ 408 #define VMCPU_FF_BLOCK_NMIS RT_BIT_32(25) 409 409 #ifdef VBOX_WITH_RAW_MODE 410 410 /** CSAM needs to scan the page that's being executed */ -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r52041 r52066 2990 2990 { 2991 2991 /* 2992 * First, clear NMI inhibitionbefore causing any exceptions.2992 * First, clear NMI blocking, if any, before causing any exceptions. 2993 2993 */ 2994 2994 PVMCPU pVCpu = IEMCPU_TO_VMCPU(pIemCpu); 2995 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_ INHIBIT_NMIS);2995 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS); 2996 2996 2997 2997 /* -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r52044 r52066 2575 2575 bool const fIntShadow = RT_BOOL(hmR0SvmGetGuestIntrShadow(pVCpu, pCtx)); 2576 2576 bool const fBlockInt = !(pCtx->eflags.u32 & X86_EFL_IF); 2577 bool const fBlockNmi = RT_BOOL(VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_ INHIBIT_NMIS));2577 bool const fBlockNmi = RT_BOOL(VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_BLOCK_NMIS)); 2578 2578 PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb; 2579 2579 … … 3003 3003 3004 3004 /* 3005 * If we are injecting an NMI, we must set VMCPU_FF_ INHIBIT_NMIS only when we are going to execute3005 * If we are injecting an NMI, we must set VMCPU_FF_BLOCK_NMIS only when we are going to execute 3006 3006 * guest code for certain (no exits to ring-3). Otherwise, we could re-read the flag on re-entry into 3007 3007 * AMD-V and conclude that NMI inhibition is active when we have not even delivered the NMI. … … 3014 3014 SVMEVENT Event; 3015 3015 Event.u = pVCpu->hm.s.Event.u64IntInfo; 3016 if ( Event.n.u1Valid 3017 && Event.n.u3Type == SVM_EVENT_NMI 3018 && Event.n.u8Vector == X86_XCPT_NMI) 3019 { 3020 VMCPU_FF_SET(pVCpu, VMCPU_FF_INHIBIT_NMIS); 3016 if ( Event.n.u1Valid 3017 && Event.n.u3Type == SVM_EVENT_NMI 3018 && Event.n.u8Vector == X86_XCPT_NMI 3019 && !VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_BLOCK_NMIS)) 3020 { 3021 VMCPU_FF_SET(pVCpu, VMCPU_FF_BLOCK_NMIS); 3021 3022 } 3022 3023 } … … 4915 4916 4916 4917 PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb; 4917 pVmcb->ctrl.IntCtrl.n.u1VIrqValid = 0; /* No virtual interrupts pending, we'll inject the current one before reentry. */4918 pVmcb->ctrl.IntCtrl.n.u1VIrqValid = 0; /* No virtual interrupts pending, we'll inject the current one/NMI before reentry. */ 4918 4919 pVmcb->ctrl.IntCtrl.n.u8VIrqVector = 0; 4919 4920 /* Clear NMI inhibition, if it's active. */4921 if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INHIBIT_NMIS))4922 {4923 hmR0SvmClearIretIntercept(pVmcb);4924 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_NMIS);4925 }4926 4920 4927 4921 /* Indicate that we no longer need to #VMEXIT when the guest is ready to receive interrupts/NMIs, it is now ready. */ … … 4999 4993 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(); 5000 4994 5001 /* Clear NMI inhibition. */5002 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_ INHIBIT_NMIS);4995 /* Clear NMI blocking. */ 4996 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS); 5003 4997 5004 4998 /* Indicate that we no longer need to #VMEXIT when the guest is ready to receive NMIs, it is now ready. */ -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r52065 r52066 3524 3524 3525 3525 /* 3526 * NMIs to the guest are inhibited until the guest executes an IRET. We only 3527 * bother with virtual-NMI blocking when we have support for virtual NMIs in the 3528 * CPU, otherwise setting this would block host-NMIs and IRET will not clear the 3529 * blocking. 3526 * NMIs to the guest are blocked after an NMI is injected until the guest executes an IRET. We only 3527 * bother with virtual-NMI blocking when we have support for virtual NMIs in the CPU, otherwise 3528 * setting this would block host-NMIs and IRET will not clear the blocking. 3530 3529 * 3531 3530 * See Intel spec. 26.6.1 "Interruptibility state". See @bugref{7445}. 3532 3531 */ 3533 if ( VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_ INHIBIT_NMIS)3532 if ( VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_BLOCK_NMIS) 3534 3533 && (pVCpu->hm.s.vmx.u32PinCtls & VMX_VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI)) 3535 3534 { … … 5831 5830 * See Intel spec. 30.7.1.2 "Resuming Guest Software after Handling an Exception". See @bugref{7445}. 5832 5831 */ 5833 Assert(VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_ INHIBIT_NMIS));5834 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_ INHIBIT_NMIS);5832 Assert(VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_BLOCK_NMIS)); 5833 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS); 5835 5834 enmReflect = VMXREFLECTXCPT_XCPT; 5836 5835 } … … 5915 5914 { 5916 5915 /* 5917 * Execution of IRET caused this fault when NMI blocking was in effect . We need to reset the block-by-NMI field so5918 * that NMIs remain blocked until the IRET execution is completed.5916 * Execution of IRET caused this fault when NMI blocking was in effect (i.e we're in the guest NMI handler). 5917 * We need to reset the block-by-NMI field so that NMIs remain blocked until the IRET execution is completed. 5919 5918 * See Intel spec. 30.7.1.2 "Resuming guest software after handling an exception". 5920 5919 */ 5921 if (!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_ INHIBIT_NMIS))5922 VMCPU_FF_SET(pVCpu, VMCPU_FF_ INHIBIT_NMIS);5920 if (!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_BLOCK_NMIS)) 5921 VMCPU_FF_SET(pVCpu, VMCPU_FF_BLOCK_NMIS); 5923 5922 } 5924 5923 … … 6127 6126 if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)) 6128 6127 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS); 6129 if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INHIBIT_NMIS)) 6130 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_NMIS); 6128 6129 if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_BLOCK_NMIS)) 6130 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS); 6131 6131 } 6132 6132 else … … 6145 6145 6146 6146 if (uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_NMI) 6147 VMCPU_FF_SET(pVCpu, VMCPU_FF_INHIBIT_NMIS); 6148 else if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INHIBIT_NMIS)) 6149 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_NMIS); 6147 { 6148 if (!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_BLOCK_NMIS)) 6149 VMCPU_FF_SET(pVCpu, VMCPU_FF_BLOCK_NMIS); 6150 } 6151 else if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_BLOCK_NMIS)) 6152 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS); 6150 6153 } 6151 6154 } … … 9932 9935 } 9933 9936 9934 Assert(!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_ INHIBIT_NMIS));9937 Assert(!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_BLOCK_NMIS)); 9935 9938 9936 9939 /* -
trunk/src/recompiler/VBoxRecompiler.c
r52041 r52066 2239 2239 /* Update the inhibit NMI mask. */ 2240 2240 pVM->rem.s.Env.hflags2 &= ~HF2_NMI_MASK; 2241 if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_ INHIBIT_NMIS))2241 if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS)) 2242 2242 pVM->rem.s.Env.hflags2 |= HF2_NMI_MASK; 2243 2243 … … 2733 2733 if (pVM->rem.s.Env.hflags2 & HF2_NMI_MASK) 2734 2734 { 2735 Log(("Settings VMCPU_FF_ INHIBIT_NMIS at %RGv (REM)\n", (RTGCPTR)pCtx->rip));2736 VMCPU_FF_SET(pVCpu, VMCPU_FF_ INHIBIT_NMIS);2737 } 2738 else if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_ INHIBIT_NMIS))2739 { 2740 Log(("Clearing VMCPU_FF_ INHIBIT_NMIS at %RGv (REM)\n", (RTGCPTR)pCtx->rip));2741 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_ INHIBIT_NMIS);2735 Log(("Settings VMCPU_FF_BLOCK_NMIS at %RGv (REM)\n", (RTGCPTR)pCtx->rip)); 2736 VMCPU_FF_SET(pVCpu, VMCPU_FF_BLOCK_NMIS); 2737 } 2738 else if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS)) 2739 { 2740 Log(("Clearing VMCPU_FF_BLOCK_NMIS at %RGv (REM)\n", (RTGCPTR)pCtx->rip)); 2741 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS); 2742 2742 } 2743 2743
Note:
See TracChangeset
for help on using the changeset viewer.