VirtualBox

Changeset 44146 in vbox for trunk


Ignore:
Timestamp:
Dec 17, 2012 3:29:40 PM (12 years ago)
Author:
vboxsync
Message:

VMM: HM bits.

Location:
trunk
Files:
4 edited

Legend:

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

    r44096 r44146  
    455455#define VMX_EXIT_INVALID            -1
    456456/** 0 Exception or non-maskable interrupt (NMI). */
    457 #define VMX_EXIT_EXCEPTION_NMI      0
     457#define VMX_EXIT_XCPT_NMI           0
    458458/** 1 External interrupt. */
    459 #define VMX_EXIT_EXTERNAL_IRQ       1
     459#define VMX_EXIT_EXT_INT            1
    460460/** 2 Triple fault. */
    461461#define VMX_EXIT_TRIPLE_FAULT       2
     
    468468/** 6 Other SMI. */
    469469#define VMX_EXIT_SMI_IRQ            6
    470 /** 7 Interrupt window. */
    471 #define VMX_EXIT_IRQ_WINDOW         7
     470/** 7 Interrupt window exiting. */
     471#define VMX_EXIT_INT_WINDOW         7
    472472/** 9 Task switch. */
    473473#define VMX_EXIT_TASK_SWITCH        9
     
    843843#define VMX_VMCS32_CTRL_ENTRY_CONTROLS                          0x4012
    844844#define VMX_VMCS32_CTRL_ENTRY_MSR_LOAD_COUNT                    0x4014
    845 #define VMX_VMCS32_CTRL_ENTRY_IRQ_INFO                          0x4016
     845#define VMX_VMCS32_CTRL_ENTRY_INTERRUPTION_INFO                 0x4016
    846846#define VMX_VMCS32_CTRL_ENTRY_EXCEPTION_ERRCODE                 0x4018
    847847#define VMX_VMCS32_CTRL_ENTRY_INSTR_LENGTH                      0x401A
     
    869869 */
    870870/** VM Exit as soon as RFLAGS.IF=1 and no blocking is active. */
    871 #define VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_IRQ_WINDOW_EXIT        RT_BIT(2)
     871#define VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_INT_WINDOW_EXIT        RT_BIT(2)
    872872/** Use timestamp counter offset. */
    873873#define VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_TSC_OFFSET             RT_BIT(3)
     
    972972#define VMX_VMCS_CTRL_EXIT_CONTROLS_LOAD_PERF_MSR               RT_BIT(12)
    973973/** Acknowledge external interrupts with the irq controller if one caused a VM-exit. */
    974 #define VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXTERNAL_IRQ            RT_BIT(15)
     974#define VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXT_INT                 RT_BIT(15)
    975975/** This control determines whether the guest IA32_PAT MSR is saved on VM exit. */
    976976#define VMX_VMCS_CTRL_EXIT_CONTROLS_SAVE_GUEST_PAT_MSR          RT_BIT(18)
     
    998998/** @} */
    999999
    1000 /** @name VMX_VMCS_RO_EXIT_INTERRUPTION_INFO
    1001  * @{
    1002  */
    1003 #define VMX_EXIT_INTERRUPTION_INFO_VECTOR(a)            (a & 0xff)
    1004 #define VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT           8
    1005 #define VMX_EXIT_INTERRUPTION_INFO_TYPE(a)              ((a >> VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT) & 7)
    1006 #define VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_VALID       RT_BIT(11)
    1007 #define VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_IS_VALID(a) (a & VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_VALID)
    1008 #define VMX_EXIT_INTERRUPTION_INFO_NMI_UNBLOCK(a)       (a & RT_BIT(12))
    1009 #define VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT          31
    1010 #define VMX_EXIT_INTERRUPTION_INFO_VALID(a)             (a & RT_BIT(31))
     1000/** @name VMX_VMCS32_RO_EXIT_REASON
     1001 * @{
     1002 */
     1003#define VMX_EXIT_REASON_BASIC(a)                                  (a & 0xffff)
     1004#define VMX_EXIT_REASON_VMENTRY_FAILED(a)                         (a & RT_BIT(31))
     1005/** @} */
     1006
     1007/** @name VMX_VMCS32_RO_EXIT_INTERRUPTION_INFO
     1008 * @{
     1009 */
     1010#define VMX_EXIT_INTERRUPTION_INFO_VECTOR(a)                      (a & 0xff)
     1011#define VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT                     8
     1012#define VMX_EXIT_INTERRUPTION_INFO_TYPE(a)                        ((a >> VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT) & 7)
     1013#define VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_VALID               RT_BIT(11)
     1014#define VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_IS_VALID(a)         (a & VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_VALID)
     1015#define VMX_EXIT_INTERRUPTION_INFO_NMI_UNBLOCK(a)                 (a & RT_BIT(12))
     1016#define VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT                    31
     1017#define VMX_EXIT_INTERRUPTION_INFO_VALID(a)                       (a & RT_BIT(31))
    10111018/** Construct an irq event injection value from the exit interruption info value (same except that bit 12 is reserved). */
    1012 #define VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(a)      (a & ~RT_BIT(12))
     1019#define VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(a)        (a & ~RT_BIT(12))
    10131020/** @} */
    10141021
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r44096 r44146  
    974974     * Set event injection state.
    975975     */
    976     rc  = VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_IRQ_INFO, intInfo | (1 << VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT));
     976    rc  = VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_INTERRUPTION_INFO, intInfo | (1 << VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT));
    977977    rc |= VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_INSTR_LENGTH, cbInstr);
    978978    rc |= VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_EXCEPTION_ERRCODE, errCode);
     
    10401040            if (!(pCtx->eflags.u32 & X86_EFL_IF))
    10411041            {
    1042                 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_IRQ_WINDOW_EXIT))
     1042                if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_INT_WINDOW_EXIT))
    10431043                {
    10441044                    LogFlow(("Enable irq window exit!\n"));
    1045                     pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_IRQ_WINDOW_EXIT;
     1045                    pVCpu->hm.s.vmx.u32ProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_INT_WINDOW_EXIT;
    10461046                    rc = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);
    10471047                    AssertRC(rc);
     
    28312831     * originated before a VM reset *after* the VM has been reset. See @bugref{6220}.
    28322832     */
    2833     VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_IRQ_INFO, 0);
     2833    VMXWriteVmcs(VMX_VMCS32_CTRL_ENTRY_INTERRUPTION_INFO, 0);
    28342834
    28352835#ifdef VBOX_STRICT
     
    33963396    switch (exitReason)
    33973397    {
    3398     case VMX_EXIT_EXCEPTION_NMI:        /* 0 Exception or non-maskable interrupt (NMI). */
    3399     case VMX_EXIT_EXTERNAL_IRQ:         /* 1 External interrupt. */
     3398    case VMX_EXIT_XCPT_NMI:             /* 0 Exception or non-maskable interrupt (NMI). */
     3399    case VMX_EXIT_EXT_INT:              /* 1 External interrupt. */
    34003400    {
    34013401        uint32_t vector = VMX_EXIT_INTERRUPTION_INFO_VECTOR(intInfo);
     
    34033403        if (!VMX_EXIT_INTERRUPTION_INFO_VALID(intInfo))
    34043404        {
    3405             Assert(exitReason == VMX_EXIT_EXTERNAL_IRQ);
     3405            Assert(exitReason == VMX_EXIT_EXT_INT);
    34063406            /* External interrupt; leave to allow it to be dispatched again. */
    34073407            rc = VINF_EM_RAW_INTERRUPT;
     
    41334133    }
    41344134
    4135     case VMX_EXIT_IRQ_WINDOW:           /* 7 Interrupt window. */
     4135    case VMX_EXIT_INT_WINDOW:           /* 7 Interrupt window exiting. */
    41364136        /* Clear VM-exit on IF=1 change. */
    4137         LogFlow(("VMX_EXIT_IRQ_WINDOW %RGv pending=%d IF=%d\n", (RTGCPTR)pCtx->rip,
     4137        LogFlow(("VMX_EXIT_INT_WINDOW %RGv pending=%d IF=%d\n", (RTGCPTR)pCtx->rip,
    41384138                 VMCPU_FF_ISPENDING(pVCpu, (VMCPU_FF_INTERRUPT_APIC|VMCPU_FF_INTERRUPT_PIC)), pCtx->eflags.Bits.u1IF));
    4139         pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_IRQ_WINDOW_EXIT;
     4139        pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_INT_WINDOW_EXIT;
    41404140        rc2 = VMXWriteVmcs(VMX_VMCS32_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.u32ProcCtls);
    41414141        AssertRC(rc2);
    4142         STAM_COUNTER_INC(&pVCpu->hm.s.StatExitIrqWindow);
     4142        STAM_COUNTER_INC(&pVCpu->hm.s.StatExitIntWindow);
    41434143        goto ResumeExecution;   /* we check for pending guest interrupts there */
    41444144
     
    46804680    switch (exitReason)
    46814681    {
    4682     case VMX_EXIT_EXCEPTION_NMI:        /* 0 Exception or non-maskable interrupt (NMI). */
    4683     case VMX_EXIT_EXTERNAL_IRQ:         /* 1 External interrupt. */
     4682    case VMX_EXIT_XCPT_NMI:             /* 0 Exception or non-maskable interrupt (NMI). */
     4683    case VMX_EXIT_EXT_INT:              /* 1 External interrupt. */
    46844684    case VMX_EXIT_EPT_VIOLATION:
    46854685    case VMX_EXIT_EPT_MISCONFIG:        /* 49 EPT misconfig is used by the PGM/MMIO optimizations. */
     
    48204820    }
    48214821
    4822     case VMX_EXIT_IRQ_WINDOW:           /* 7 Interrupt window. */
     4822    case VMX_EXIT_INT_WINDOW:           /* 7 Interrupt window. */
    48234823        Assert(rc == VINF_EM_RAW_INTERRUPT);
    48244824        break;
     
    48914891     * If we executed vmlaunch/vmresume and an external IRQ was pending, then we don't have to do a full sync the next time.
    48924892     */
    4893     if (    exitReason == VMX_EXIT_EXTERNAL_IRQ
     4893    if (    exitReason == VMX_EXIT_EXT_INT
    48944894        &&  !VMX_EXIT_INTERRUPTION_INFO_VALID(intInfo))
    48954895    {
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r44089 r44146  
    5959static const char * const g_apszVTxExitReasons[MAX_EXITREASON_STAT] =
    6060{
    61     EXIT_REASON(VMX_EXIT_EXCEPTION          ,  0, "Exception or non-maskable interrupt (NMI)."),
    62     EXIT_REASON(VMX_EXIT_EXTERNAL_IRQ       ,  1, "External interrupt."),
     61    EXIT_REASON(VMX_EXIT_XCPT_NMI           ,  0, "Exception or non-maskable interrupt (NMI)."),
     62    EXIT_REASON(VMX_EXIT_EXT_INT            ,  1, "External interrupt."),
    6363    EXIT_REASON(VMX_EXIT_TRIPLE_FAULT       ,  2, "Triple fault."),
    6464    EXIT_REASON(VMX_EXIT_INIT_SIGNAL        ,  3, "INIT signal."),
     
    545545        HM_REG_COUNTER(&pVCpu->hm.s.StatExitIOStringWrite,      "/HM/CPU%d/Exit/IO/WriteString");
    546546        HM_REG_COUNTER(&pVCpu->hm.s.StatExitIOStringRead,       "/HM/CPU%d/Exit/IO/ReadString");
    547         HM_REG_COUNTER(&pVCpu->hm.s.StatExitIrqWindow,          "/HM/CPU%d/Exit/IrqWindow");
     547        HM_REG_COUNTER(&pVCpu->hm.s.StatExitIntWindow,          "/HM/CPU%d/Exit/IntWindow");
    548548        HM_REG_COUNTER(&pVCpu->hm.s.StatExitMaxResume,          "/HM/CPU%d/Exit/MaxResume");
    549549        HM_REG_COUNTER(&pVCpu->hm.s.StatExitPreemptPending,     "/HM/CPU%d/Exit/PreemptPending");
     
    850850            LogRel(("HM: MSR_IA32_VMX_PROCBASED_CTLS   = %RX64\n", pVM->hm.s.vmx.msr.vmx_proc_ctls.u));
    851851            val = pVM->hm.s.vmx.msr.vmx_proc_ctls.n.allowed1;
    852             if (val & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_IRQ_WINDOW_EXIT)
    853                 LogRel(("HM:    VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_IRQ_WINDOW_EXIT\n"));
     852            if (val & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_INT_WINDOW_EXIT)
     853                LogRel(("HM:    VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_INT_WINDOW_EXIT\n"));
    854854            if (val & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_TSC_OFFSET)
    855855                LogRel(("HM:    VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_TSC_OFFSET\n"));
     
    894894
    895895            val = pVM->hm.s.vmx.msr.vmx_proc_ctls.n.disallowed0;
    896             if (val & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_IRQ_WINDOW_EXIT)
    897                 LogRel(("HM:    VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_IRQ_WINDOW_EXIT *must* be set\n"));
     896            if (val & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_INT_WINDOW_EXIT)
     897                LogRel(("HM:    VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_INT_WINDOW_EXIT *must* be set\n"));
    898898            if (val & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_TSC_OFFSET)
    899899                LogRel(("HM:    VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_TSC_OFFSET *must* be set\n"));
     
    10191019            if (val & VMX_VMCS_CTRL_EXIT_CONTROLS_HOST_ADDR_SPACE_SIZE)
    10201020                LogRel(("HM:    VMX_VMCS_CTRL_EXIT_CONTROLS_HOST_ADDR_SPACE_SIZE\n"));
    1021             if (val & VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXTERNAL_IRQ)
    1022                 LogRel(("HM:    VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXTERNAL_IRQ\n"));
     1021            if (val & VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXT_INT)
     1022                LogRel(("HM:    VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXT_INT\n"));
    10231023            if (val & VMX_VMCS_CTRL_EXIT_CONTROLS_SAVE_GUEST_PAT_MSR)
    10241024                LogRel(("HM:    VMX_VMCS_CTRL_EXIT_CONTROLS_SAVE_GUEST_PAT_MSR\n"));
     
    10361036            if (val & VMX_VMCS_CTRL_EXIT_CONTROLS_HOST_ADDR_SPACE_SIZE)
    10371037                LogRel(("HM:    VMX_VMCS_CTRL_EXIT_CONTROLS_HOST_ADDR_SPACE_SIZE *must* be set\n"));
    1038             if (val & VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXTERNAL_IRQ)
    1039                 LogRel(("HM:    VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXTERNAL_IRQ *must* be set\n"));
     1038            if (val & VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXT_INT)
     1039                LogRel(("HM:    VMX_VMCS_CTRL_EXIT_CONTROLS_ACK_EXT_INT *must* be set\n"));
    10401040            if (val & VMX_VMCS_CTRL_EXIT_CONTROLS_SAVE_GUEST_PAT_MSR)
    10411041                LogRel(("HM:    VMX_VMCS_CTRL_EXIT_CONTROLS_SAVE_GUEST_PAT_MSR *must* be set\n"));
  • trunk/src/VBox/VMM/include/HMInternal.h

    r44089 r44146  
    774774    STAMCOUNTER             StatExitIOStringWrite;
    775775    STAMCOUNTER             StatExitIOStringRead;
    776     STAMCOUNTER             StatExitIrqWindow;
     776    STAMCOUNTER             StatExitIntWindow;
    777777    STAMCOUNTER             StatExitMaxResume;
    778778    STAMCOUNTER             StatExitPreemptPending;
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