VirtualBox

Changeset 75413 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Nov 13, 2018 4:55:09 AM (6 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:9180 Added VMX functions for evaluating whether the nested-guest can receive APIC or virtual interrupts
similar to SVM. Would be easier for abstracting later when virtual-interrupt delivery is implemented. Performance comes later if needed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r75109 r75413  
    26492649
    26502650/**
     2651 * Checks whether the VMX nested-guest is in a state to receive physical (APIC)
     2652 * interrupts.
     2653 *
     2654 * @returns VBox status code.
     2655 * @retval  true if it's ready, false otherwise.
     2656 *
     2657 * @param   pVCpu   The cross context virtual CPU structure of the calling EMT.
     2658 * @param   pCtx    The guest-CPU context.
     2659 */
     2660VMM_INT_DECL(bool) CPUMCanVmxNstGstTakePhysIntr(PVMCPU pVCpu, PCCPUMCTX pCtx)
     2661{
     2662#ifdef IN_RC
     2663    RT_NOREF2(pVCpu, pCtx);
     2664    AssertReleaseFailedReturn(false);
     2665#else
     2666    RT_NOREF(pVCpu);
     2667    Assert(CPUMIsGuestInVmxNonRootMode(pCtx));
     2668    Assert(pCtx->hwvirt.fGif);  /* Always true on Intel. */
     2669
     2670    return (pCtx->eflags.u & X86_EFL_IF);
     2671#endif
     2672}
     2673
     2674/**
     2675 * Checks whether the VMX nested-guest is in a state to receive virtual interrupts
     2676 * (those injected with the "virtual-interrupt delivery" feature).
     2677 *
     2678 * @returns VBox status code.
     2679 * @retval  true if it's ready, false otherwise.
     2680 *
     2681 * @param   pVCpu   The cross context virtual CPU structure of the calling EMT.
     2682 * @param   pCtx    The guest-CPU context.
     2683 */
     2684VMM_INT_DECL(bool) CPUMCanVmxNstGstTakeVirtIntr(PVMCPU pVCpu, PCCPUMCTX pCtx)
     2685{
     2686#ifdef IN_RC
     2687    RT_NOREF2(pVCpu, pCtx);
     2688    AssertReleaseFailedReturn(false);
     2689#else
     2690    RT_NOREF(pVCpu);
     2691    Assert(CPUMIsGuestInVmxNonRootMode(pCtx));
     2692    Assert(pCtx->hwvirt.fGif);  /* Always true on Intel. */
     2693
     2694    return false; /** @todo NSTVMX: Currently not implemented. */
     2695#endif
     2696}
     2697
     2698
     2699/**
    26512700 * Checks whether the SVM nested-guest is in a state to receive physical (APIC)
    26522701 * interrupts.
     
    26572706 * @param   pVCpu   The cross context virtual CPU structure of the calling EMT.
    26582707 * @param   pCtx    The guest-CPU context.
    2659  *
    2660  * @sa      hmR0SvmCanNstGstTakePhysIntr.
    26612708 */
    26622709VMM_INT_DECL(bool) CPUMCanSvmNstGstTakePhysIntr(PVMCPU pVCpu, PCCPUMCTX pCtx)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette