Changeset 75729 in vbox
- Timestamp:
- Nov 26, 2018 9:32:52 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r75646 r75729 2649 2649 2650 2650 /** 2651 * Gets whether the guest or nested-guest's are ready to receive physical 2652 * interrupts. 2653 * 2654 * This function assumes there is no global 2655 * 2656 * @returns @c true if interrupts can be injected into the guest (or nested-guest), 2657 * @c false otherwise. 2658 * @param pVCpu The cross context virtual CPU structure. 2659 */ 2660 DECLINLINE(bool) CPUMIsGuestPhysIntrsEnabled(PVMCPU pVCpu) 2661 { 2662 Assert(pVCpu->cpum.s.Guest.hwvirt.fGif); 2663 if ( !CPUMIsGuestInVmxNonRootMode(&pVCpu->cpum.s.Guest) 2664 && !CPUMIsGuestInSvmNestedHwVirtMode(&pVCpu->cpum.s.Guest)) 2665 return RT_BOOL(pVCpu->cpum.s.Guest.rflags.Bits.u1IF); 2666 2667 if (CPUMIsGuestInVmxNonRootMode(&pVCpu->cpum.s.Guest)) 2668 return CPUMCanVmxNstGstTakePhysIntr(pVCpu, &pVCpu->cpum.s.Guest); 2669 2670 return CPUMCanSvmNstGstTakePhysIntr(pVCpu, &pVCpu->cpum.s.Guest); 2671 } 2672 2673 2674 /** 2651 2675 * Calculates the interruptiblity of the guest. 2652 2676 * … … 2656 2680 VMM_INT_DECL(CPUMINTERRUPTIBILITY) CPUMGetGuestInterruptibility(PVMCPU pVCpu) 2657 2681 { 2682 #if 1 2683 if (pVCpu->cpum.s.Guest.hwvirt.fGif) 2684 { 2685 /** @todo r=ramshankar: What about virtual-interrupt delivery to nested-guests? */ 2686 if (CPUMIsGuestPhysIntrsEnabled(pVCpu)) 2687 { 2688 if (!VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_BLOCK_NMIS | VMCPU_FF_INHIBIT_INTERRUPTS)) 2689 return CPUMINTERRUPTIBILITY_UNRESTRAINED; 2690 2691 /** @todo does blocking NMIs mean interrupts are also inhibited? */ 2692 if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)) 2693 { 2694 if (!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS)) 2695 return CPUMINTERRUPTIBILITY_INT_INHIBITED; 2696 return CPUMINTERRUPTIBILITY_NMI_INHIBIT; 2697 } 2698 AssertFailed(); 2699 return CPUMINTERRUPTIBILITY_NMI_INHIBIT; 2700 } 2701 else 2702 { 2703 if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS)) 2704 return CPUMINTERRUPTIBILITY_NMI_INHIBIT; 2705 return CPUMINTERRUPTIBILITY_INT_DISABLED; 2706 } 2707 } 2708 return CPUMINTERRUPTIBILITY_GLOBAL_INHIBIT; 2709 #else 2658 2710 if (pVCpu->cpum.s.Guest.rflags.Bits.u1IF) 2659 2711 { … … 2685 2737 return CPUMINTERRUPTIBILITY_GLOBAL_INHIBIT; 2686 2738 } 2739 #endif 2687 2740 } 2688 2741
Note:
See TracChangeset
for help on using the changeset viewer.

