Changeset 67204 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jun 1, 2017 11:55:18 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 115886
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp
r67200 r67204 811 811 812 812 /** 813 * Checks whether an interrupt is pending for the nested-guest. 813 * Checks whether the nested-guest is in a state to receive physical (APIC) 814 * interrupts. 814 815 * 815 816 * @returns VBox status code. 816 * @retval true if there's a pending interrupt, false otherwise.817 * @retval true if it's ready, false otherwise. 817 818 * 818 819 * @param pVCpu The cross context virtual CPU structure. 819 820 * @param pCtx The guest-CPU context. 820 821 */ 821 VMM_INT_DECL(bool) HMSvmNstGstCanTake Interrupt(PVMCPU pVCpu, PCCPUMCTX pCtx)822 VMM_INT_DECL(bool) HMSvmNstGstCanTakePhysInterrupt(PVMCPU pVCpu, PCCPUMCTX pCtx) 822 823 { 824 Assert(CPUMIsGuestInSvmNestedHwVirtMode(pCtx)); 825 RT_NOREF(pVCpu); 826 823 827 PCSVMVMCBCTRL pVmcbCtrl = &pCtx->hwvirt.svm.VmcbCtrl; 828 X86EFLAGS fEFlags; 829 if (!pVmcbCtrl->IntCtrl.n.u1VIntrMasking) 830 fEFlags.u = pCtx->hwvirt.svm.HostState.rflags.u; 831 else 832 fEFlags.u = pCtx->eflags.u; 833 834 return pCtx->hwvirt.svm.fGif && fEFlags.Bits.u1IF; 835 } 836 837 838 /** 839 * Checks whether the nested-guest is in a state to receive virtual (injected by 840 * VMRUN) interrupts. 841 * 842 * @returns VBox status code. 843 * @retval true if it's ready, false otherwise. 844 * 845 * @param pVCpu The cross context virtual CPU structure. 846 * @param pCtx The guest-CPU context. 847 */ 848 VMM_INT_DECL(bool) HMSvmNstGstCanTakeVirtInterrupt(PVMCPU pVCpu, PCCPUMCTX pCtx) 849 { 824 850 Assert(CPUMIsGuestInSvmNestedHwVirtMode(pCtx)); 825 826 X86RFLAGS RFlags; 827 if (pVmcbCtrl->IntCtrl.n.u1VIntrMasking) 828 RFlags.u = pCtx->rflags.u; 829 else 830 RFlags.u = pCtx->hwvirt.svm.HostState.rflags.u; 831 832 if (!RFlags.Bits.u1IF) 833 return false; 834 851 Assert(!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)); 852 Assert(VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INTERRUPT_NESTED_GUEST)); 853 RT_NOREF(pVCpu); 854 855 PCSVMVMCBCTRL pVmcbCtrl = &pCtx->hwvirt.svm.VmcbCtrl; 835 856 if ( !pVmcbCtrl->IntCtrl.n.u1IgnoreTPR 836 857 && pVmcbCtrl->IntCtrl.n.u4VIntrPrio <= pVmcbCtrl->IntCtrl.n.u8VTPR) 837 858 return false; 838 859 839 /* Paranoia. */ 840 Assert(RT_BOOL(pCtx->hwvirt.svm.fGif)); 841 Assert(!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)); 842 Assert(VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INTERRUPT_NESTED_GUEST)); 843 RT_NOREF(pVCpu); 860 if (!pCtx->rflags.Bits.u1IF) 861 return false; 862 863 if (!pCtx->hwvirt.svm.fGif) 864 return false; 865 844 866 return true; 845 867 }
Note:
See TracChangeset
for help on using the changeset viewer.