Changeset 79096 in vbox
- Timestamp:
- Jun 12, 2019 7:22:59 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r79073 r79096 2396 2396 */ 2397 2397 RT_NOREF(pVCpu); 2398 Assert(CPUMIsGuestInVmxNonRootMode(pCtx)); 2398 2399 Assert(CPUMIsGuestVmxPinCtlsSet(pVCpu, pCtx, VMX_PIN_CTLS_VIRT_NMI)); 2399 2400 return pCtx->hwvirt.vmx.fVirtNmiBlocking; 2401 #endif 2402 } 2403 2404 /** 2405 * Sets or clears VMX nested-guest virtual-NMI blocking. 2406 * 2407 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 2408 * @param pCtx The guest-CPU context. 2409 * @param fBlocking Whether virtual-NMI blocking is in effect or not. 2410 */ 2411 DECLINLINE(void) CPUMSetGuestVmxVirtNmiBlocking(PCVMCPU pVCpu, PCPUMCTX pCtx, bool fBlocking) 2412 { 2413 #ifdef IN_RC 2414 RT_NOREF3(pVCpu, pCtx, fBlocking); 2415 AssertReleaseFailedReturnVoid(); 2416 #else 2417 RT_NOREF(pVCpu); 2418 Assert(CPUMIsGuestInVmxNonRootMode(pCtx)); 2419 Assert(CPUMIsGuestVmxPinCtlsSet(pVCpu, pCtx, VMX_PIN_CTLS_VIRT_NMI)); 2420 pCtx->hwvirt.vmx.fVirtNmiBlocking = fBlocking; 2400 2421 #endif 2401 2422 } … … 2580 2601 VMM_INT_DECL(CPUMINTERRUPTIBILITY) CPUMGetGuestInterruptibility(PVMCPU pVCpu); 2581 2602 VMM_INT_DECL(bool) CPUMIsGuestNmiBlocking(PVMCPU pVCpu); 2582 2603 VMM_INT_DECL(void) CPUMSetGuestNmiBlocking(PVMCPU pVCpu, bool fBlock); 2583 2604 2584 2605 /** @name Typical scalable bus frequency values. -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r78981 r79096 2814 2814 2815 2815 /** 2816 * Sets blocking delivery of NMIs to the guest. 2817 * 2818 * @param pVCpu The cross context virtual CPU structure. 2819 * @param fBlock Whether NMIs are blocked or not. 2820 */ 2821 VMM_INT_DECL(void) CPUMSetGuestNmiBlocking(PVMCPU pVCpu, bool fBlock) 2822 { 2823 #ifndef IN_RC 2824 /* 2825 * Set the state of guest-NMI blocking in any of the following cases: 2826 * - We're not executing a nested-guest. 2827 * - We're executing an SVM nested-guest[1]. 2828 * - We're executing a VMX nested-guest without virtual-NMIs enabled. 2829 * 2830 * [1] -- SVM does not support virtual-NMIs or virtual-NMI blocking. 2831 * SVM hypervisors must track NMI blocking themselves by intercepting 2832 * the IRET instruction after injection of an NMI. 2833 */ 2834 PCPUMCTX pCtx = &pVCpu->cpum.s.Guest; 2835 if ( !CPUMIsGuestInNestedHwvirtMode(pCtx) 2836 || CPUMIsGuestInSvmNestedHwVirtMode(pCtx) 2837 || !CPUMIsGuestVmxPinCtlsSet(pVCpu, pCtx, VMX_PIN_CTLS_VIRT_NMI)) 2838 { 2839 if (fBlock) 2840 { 2841 if (!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS)) 2842 VMCPU_FF_SET(pVCpu, VMCPU_FF_BLOCK_NMIS); 2843 } 2844 else 2845 { 2846 if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS)) 2847 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS); 2848 } 2849 return; 2850 } 2851 2852 /* 2853 * Set the state of virtual-NMI blocking, if we are executing a 2854 * VMX nested-guest with virtual-NMIs enabled. 2855 */ 2856 return CPUMSetGuestVmxVirtNmiBlocking(pVCpu, pCtx, fBlock); 2857 #else 2858 if (fBlock) 2859 VMCPU_FF_SET(pVCpu, VMCPU_FF_BLOCK_NMIS); 2860 else 2861 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS); 2862 #endif 2863 } 2864 2865 2866 /** 2816 2867 * Checks whether the SVM nested-guest has physical interrupts enabled. 2817 2868 *
Note:
See TracChangeset
for help on using the changeset viewer.