VirtualBox

Changeset 42161 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Jul 16, 2012 12:12:06 PM (12 years ago)
Author:
vboxsync
Message:

VMM/HWVMXR0: cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r42156 r42161  
    17781778                    val = (val & ~0xF) | X86_SEL_TYPE_SYS_386_TSS_BUSY;
    17791779            }
    1780             AssertMsg((val & 0xf) == X86_SEL_TYPE_SYS_386_TSS_BUSY || (val & 0xf) == X86_SEL_TYPE_SYS_286_TSS_BUSY, ("%#x\n", val));
     1780            AssertMsg((val & 0xf) == X86_SEL_TYPE_SYS_386_TSS_BUSY || (val & 0xf) == X86_SEL_TYPE_SYS_286_TSS_BUSY,
     1781                      ("%#x\n", val));
    17811782        }
    17821783        rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_TR_ACCESS_RIGHTS, val);
     
    18361837            val |= X86_CR0_NE;  /* always turn on the native mechanism to report FPU errors (old style uses interrupts) */
    18371838        }
    1838         /* Note: protected mode & paging are always enabled; we use them for emulating real and protected mode without paging too. */
     1839        /* Protected mode & paging are always enabled; we use them for emulating real and protected mode without paging too. */
    18391840        if (!pVM->hwaccm.s.vmx.fUnrestrictedGuest)
    18401841            val |= X86_CR0_PE | X86_CR0_PG;
     
    27102711    VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_SHOOTDOWN);
    27112712
    2712     AssertMsg(pVCpu->hwaccm.s.cTLBFlushes == pCpu->cTLBFlushes, ("Flush count mismatch for cpu %d (%x vs %x)\n", pCpu->idCpu, pVCpu->hwaccm.s.cTLBFlushes, pCpu->cTLBFlushes));
    2713     AssertMsg(pCpu->uCurrentASID >= 1 && pCpu->uCurrentASID < pVM->hwaccm.s.uMaxASID, ("cpu%d uCurrentASID = %x\n", pCpu->idCpu, pCpu->uCurrentASID));
    2714     AssertMsg(pVCpu->hwaccm.s.uCurrentASID >= 1 && pVCpu->hwaccm.s.uCurrentASID < pVM->hwaccm.s.uMaxASID, ("cpu%d VM uCurrentASID = %x\n", pCpu->idCpu, pVCpu->hwaccm.s.uCurrentASID));
     2713    AssertMsg(pVCpu->hwaccm.s.cTLBFlushes == pCpu->cTLBFlushes,
     2714              ("Flush count mismatch for cpu %d (%x vs %x)\n", pCpu->idCpu, pVCpu->hwaccm.s.cTLBFlushes, pCpu->cTLBFlushes));
     2715    AssertMsg(pCpu->uCurrentASID >= 1 && pCpu->uCurrentASID < pVM->hwaccm.s.uMaxASID,
     2716              ("cpu%d uCurrentASID = %x\n", pCpu->idCpu, pCpu->uCurrentASID));
     2717    AssertMsg(pVCpu->hwaccm.s.uCurrentASID >= 1 && pVCpu->hwaccm.s.uCurrentASID < pVM->hwaccm.s.uMaxASID,
     2718              ("cpu%d VM uCurrentASID = %x\n", pCpu->idCpu, pVCpu->hwaccm.s.uCurrentASID));
    27152719
    27162720    int rc  = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_VPID, pVCpu->hwaccm.s.uCurrentASID);
     
    27612765#endif
    27622766
    2763     Assert(!(pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC) || (pVCpu->hwaccm.s.vmx.pbVAPIC && pVM->hwaccm.s.vmx.pAPIC));
     2767    Assert(!(pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC)
     2768           || (pVCpu->hwaccm.s.vmx.pbVAPIC && pVM->hwaccm.s.vmx.pAPIC));
    27642769
    27652770    /*
     
    27672772     */
    27682773    if (    CPUMIsGuestInLongModeEx(pCtx)
    2769         || (   ((pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC) || pVM->hwaccm.s.fTRPPatchingAllowed)
     2774        || (   ((   pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC)
     2775                 || pVM->hwaccm.s.fTRPPatchingAllowed)
    27702776            &&  pVM->hwaccm.s.fHasIoApic)
    27712777       )
     
    30183024         *   -> We don't need to be explicitely notified. There are enough world switches for detecting pending interrupts.
    30193025         */
    3020         rc  = VMXWriteVMCS(VMX_VMCS_CTRL_TPR_THRESHOLD, (fPending) ? (u8LastTPR >> 4) : 0);     /* cr8 bits 3-0 correspond to bits 7-4 of the task priority mmio register. */
     3026
     3027        /* cr8 bits 3-0 correspond to bits 7-4 of the task priority mmio register. */
     3028        rc  = VMXWriteVMCS(VMX_VMCS_CTRL_TPR_THRESHOLD, (fPending) ? (u8LastTPR >> 4) : 0);
    30213029        AssertRC(VBOXSTRICTRC_VAL(rc));
    30223030
     
    30493057    {
    30503058        PHMGLOBLCPUINFO pCpu = HWACCMR0GetCurrentCpu();
    3051         if (    pVCpu->hwaccm.s.idLastCpu   != pCpu->idCpu
    3052             ||  pVCpu->hwaccm.s.cTLBFlushes != pCpu->cTLBFlushes)
    3053         {
    3054             if (pVCpu->hwaccm.s.idLastCpu != pCpu->idCpu)
    3055                 LogFlow(("Force TLB flush due to rescheduling to a different cpu (%d vs %d)\n", pVCpu->hwaccm.s.idLastCpu, pCpu->idCpu));
    3056             else
    3057                 LogFlow(("Force TLB flush due to changed TLB flush count (%x vs %x)\n", pVCpu->hwaccm.s.cTLBFlushes, pCpu->cTLBFlushes));
     3059        if (pVCpu->hwaccm.s.idLastCpu != pCpu->idCpu)
     3060        {
     3061            LogFlow(("Force TLB flush due to rescheduling to a different cpu (%d vs %d)\n", pVCpu->hwaccm.s.idLastCpu,
     3062                     pCpu->idCpu));
     3063        }
     3064        else if (pVCpu->hwaccm.s.cTLBFlushes != pCpu->cTLBFlushes)
     3065        {
     3066            LogFlow(("Force TLB flush due to changed TLB flush count (%x vs %x)\n", pVCpu->hwaccm.s.cTLBFlushes,
     3067                     pCpu->cTLBFlushes));
    30583068        }
    30593069        else if (VMCPU_FF_ISSET(pVCpu, VMCPU_FF_TLB_FLUSH))
     
    32223232#endif
    32233233
    3224     AssertMsg(!pVCpu->hwaccm.s.vmx.VMCSCache.Write.cValidEntries, ("pVCpu->hwaccm.s.vmx.VMCSCache.Write.cValidEntries=%d\n", pVCpu->hwaccm.s.vmx.VMCSCache.Write.cValidEntries));
     3234    AssertMsg(!pVCpu->hwaccm.s.vmx.VMCSCache.Write.cValidEntries, ("pVCpu->hwaccm.s.vmx.VMCSCache.Write.cValidEntries=%d\n",
     3235                                                                   pVCpu->hwaccm.s.vmx.VMCSCache.Write.cValidEntries));
    32253236
    32263237    /* In case we execute a goto ResumeExecution later on. */
     
    38823893                    rc = VERR_EM_INTERPRETER;
    38833894
    3884                 AssertMsg(rc == VERR_EM_INTERPRETER || rc == VINF_PGM_CHANGE_MODE || rc == VINF_EM_HALT, ("Unexpected rc=%Rrc\n", VBOXSTRICTRC_VAL(rc)));
     3895                AssertMsg(rc == VERR_EM_INTERPRETER || rc == VINF_PGM_CHANGE_MODE || rc == VINF_EM_HALT,
     3896                          ("Unexpected rc=%Rrc\n", VBOXSTRICTRC_VAL(rc)));
    38853897                break;
    38863898            }
     
    38933905            case X86_XCPT_NP:   /* Segment not present exception. */
    38943906            {
    3895                 switch(vector)
     3907                switch (vector)
    38963908                {
    38973909                    case X86_XCPT_DE:
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