VirtualBox

Changeset 75830 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Nov 30, 2018 9:30:58 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
127033
Message:

VMM: Adjust CPUMGetGuestInterruptibility to include virtual interrupts. Adjusted vmmR0DoHalt accordingly. Reworked interrupt injection in emR3ForcedActions().

Location:
trunk/include/VBox/vmm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r75759 r75830  
    14301430/** @name Nested Hardware-Virtualization Helpers.
    14311431 * @{  */
    1432 VMM_INT_DECL(bool)      CPUMCanSvmNstGstTakePhysIntr(PVMCPU pVCpu, PCCPUMCTX pCtx);
    1433 VMM_INT_DECL(bool)      CPUMCanSvmNstGstTakeVirtIntr(PVMCPU pVCpu, PCCPUMCTX pCtx);
    1434 VMM_INT_DECL(uint8_t)   CPUMGetSvmNstGstInterrupt(PCCPUMCTX pCtx);
     1432VMM_INT_DECL(bool)      CPUMIsGuestPhysIntrEnabled(PVMCPU pVCpu);
     1433VMM_INT_DECL(bool)      CPUMIsGuestVirtIntrEnabled(PVMCPU pVCpu);
     1434VMM_INT_DECL(bool)      CPUMIsGuestSvmPhysIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
     1435VMM_INT_DECL(bool)      CPUMIsGuestSvmVirtIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
     1436VMM_INT_DECL(uint8_t)   CPUMGetGuestSvmVirtIntrVector(PCCPUMCTX pCtx);
    14351437VMM_INT_DECL(void)      CPUMSvmVmExitRestoreHostState(PVMCPU pVCpu, PCPUMCTX pCtx);
    14361438VMM_INT_DECL(void)      CPUMSvmVmRunSaveHostState(PCPUMCTX pCtx, uint8_t cbInstr);
    14371439VMM_INT_DECL(uint64_t)  CPUMApplyNestedGuestTscOffset(PVMCPU pVCpu, uint64_t uTicks);
    1438 VMM_INT_DECL(bool)      CPUMCanVmxNstGstTakePhysIntr(PVMCPU pVCpu, PCCPUMCTX pCtx);
    1439 VMM_INT_DECL(bool)      CPUMCanVmxNstGstTakeVirtIntr(PVMCPU pVCpu, PCCPUMCTX pCtx);
     1440VMM_INT_DECL(bool)      CPUMIsGuestVmxPhysIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
     1441VMM_INT_DECL(bool)      CPUMIsGuestVmxVirtIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
    14401442/** @} */
    14411443
     
    16281630
    16291631/**
     1632 * Returns the guest's global-interrupt (GIF) flag.
     1633 *
     1634 * @returns true when global-interrupts are enabled, otherwise false.
     1635 * @param   pCtx    Current CPU context.
     1636 */
     1637DECLINLINE(bool) CPUMGetGuestGif(PCCPUMCTX pCtx)
     1638{
     1639    return pCtx->hwvirt.fGif;
     1640}
     1641
     1642/**
     1643 * Sets the guest's global-interrupt flag (GIF).
     1644 *
     1645 * @param   pCtx    Current CPU context.
     1646 * @param   fGif    The value to set.
     1647 */
     1648DECLINLINE(void) CPUMSetGuestGif(PCPUMCTX pCtx, bool fGif)
     1649{
     1650    pCtx->hwvirt.fGif = fGif;
     1651}
     1652
     1653/**
    16301654 * Checks if we are executing inside an SVM nested hardware-virtualized guest.
    16311655 *
    16321656 * @returns @c true if in SVM nested-guest mode, @c false otherwise.
    1633  * @param   pCtx        Pointer to the context.
     1657 * @param   pCtx    Current CPU context.
    16341658 */
    16351659DECLINLINE(bool) CPUMIsGuestInSvmNestedHwVirtMode(PCCPUMCTX pCtx)
     
    16671691    return false;
    16681692#endif
     1693}
     1694
     1695/**
     1696 * Checks if we are executing inside an SVM or VMX nested hardware-virtualized
     1697 * guest.
     1698 *
     1699 * @returns @c true if in nested-guest mode, @c false otherwise.
     1700 * @param   pCtx    Current CPU context.
     1701 */
     1702DECLINLINE(bool) CPUMIsGuestInNestedHwvirtMode(PCCPUMCTX pCtx)
     1703{
     1704    return CPUMIsGuestInVmxNonRootMode(pCtx) || CPUMIsGuestInSvmNestedHwVirtMode(pCtx);
    16691705}
    16701706
     
    21332169    CPUMINTERRUPTIBILITY_INVALID = 0,
    21342170    CPUMINTERRUPTIBILITY_UNRESTRAINED,
     2171    CPUMINTERRUPTIBILITY_VIRT_INT_DISABLED,
     2172    CPUMINTERRUPTIBILITY_INT_DISABLED,
    21352173    CPUMINTERRUPTIBILITY_INT_INHIBITED,
    2136     CPUMINTERRUPTIBILITY_INT_DISABLED,
    21372174    CPUMINTERRUPTIBILITY_NMI_INHIBIT,
    21382175    CPUMINTERRUPTIBILITY_GLOBAL_INHIBIT,
  • trunk/include/VBox/vmm/trpm.h

    r69107 r75830  
    101101VMMR3DECL(void)     TRPMR3Reset(PVM pVM);
    102102VMMR3DECL(int)      TRPMR3Term(PVM pVM);
    103 VMMR3DECL(int)      TRPMR3InjectEvent(PVM pVM, PVMCPU pVCpu, TRPMEVENT enmEvent);
     103VMMR3DECL(int)      TRPMR3InjectEvent(PVM pVM, PVMCPU pVCpu, TRPMEVENT enmEvent, bool *pfInjected);
    104104# ifdef VBOX_WITH_RAW_MODE
    105105VMMR3_INT_DECL(int) TRPMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue);
  • trunk/include/VBox/vmm/vm.h

    r75683 r75830  
    366366 *
    367367 * Available VMCPU bits:
    368  *      11, 14, 15, 35 to 63
     368 *      14, 15, 34 to 63
    369369 *
    370370 * @todo If we run low on VMCPU, we may consider merging the SELM bits
     
    473473/** This action forces the VM to service any pending updates to CR3 (used only
    474474 *  by HM). */
     475/** Hardware virtualized nested-guest interrupt pending. */
     476#define VMCPU_FF_INTERRUPT_NESTED_GUEST     RT_BIT_64(VMCPU_FF_INTERRUPT_NESTED_GUEST_BIT)
     477#define VMCPU_FF_INTERRUPT_NESTED_GUEST_BIT 11
    475478#define VMCPU_FF_HM_UPDATE_CR3              RT_BIT_64(VMCPU_FF_HM_UPDATE_CR3_BIT)
    476479#define VMCPU_FF_HM_UPDATE_CR3_BIT          12
     
    541544# define VMCPU_FF_CPUM_BIT                  30
    542545#endif /* VBOX_WITH_RAW_MODE */
    543 /** Hardware virtualized nested-guest interrupt pending. */
    544 #define VMCPU_FF_INTERRUPT_NESTED_GUEST     RT_BIT_64(VMCPU_FF_INTERRUPT_NESTED_GUEST_BIT)
    545 #define VMCPU_FF_INTERRUPT_NESTED_GUEST_BIT 31
    546546/** VMX-preemption timer in effect. */
    547547#define VMCPU_FF_VMX_PREEMPT_TIMER          RT_BIT_64(VMCPU_FF_VMX_PREEMPT_TIMER_BIT)
    548 #define VMCPU_FF_VMX_PREEMPT_TIMER_BIT      32
     548#define VMCPU_FF_VMX_PREEMPT_TIMER_BIT      31
    549549/** Pending MTF (Monitor Trap Flag) event.  */
    550550#define VMCPU_FF_VMX_MTF                    RT_BIT_64(VMCPU_FF_VMX_MTF_BIT)
    551 #define VMCPU_FF_VMX_MTF_BIT                33
     551#define VMCPU_FF_VMX_MTF_BIT                32
    552552/** VMX APIC-write emulation pending.  */
    553553#define VMCPU_FF_VMX_APIC_WRITE             RT_BIT_64(VMCPU_FF_VMX_APIC_WRITE_BIT)
    554 #define VMCPU_FF_VMX_APIC_WRITE_BIT         34
     554#define VMCPU_FF_VMX_APIC_WRITE_BIT         33
    555555
    556556
Note: See TracChangeset for help on using the changeset viewer.

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