VirtualBox

Changeset 50748 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 12, 2014 2:29:06 PM (11 years ago)
Author:
vboxsync
Message:

VMM/HMR0: cleanup.

File:
1 edited

Legend:

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

    r50746 r50748  
    10081008        rc = SUPR0EnableVTx(true /* fEnable */);
    10091009        if (RT_SUCCESS(rc))
     1010        {
    10101011            /* If the host provides a VT-x init API, then we'll rely on that for global init. */
    10111012            g_HvmR0.fGlobalInit = pVM->hm.s.fGlobalInit = true;
     1013        }
    10121014        else
    10131015            AssertMsgFailed(("hmR0EnableAllCpuOnce/SUPR0EnableVTx: rc=%Rrc\n", rc));
     
    10601062VMMR0_INT_DECL(int) HMR0EnableAllCpus(PVM pVM)
    10611063{
    1062     /* Make sure we don't touch HM after we've disabled HM in
    1063        preparation of a suspend. */
     1064    /* Make sure we don't touch HM after we've disabled HM in preparation of a suspend. */
    10641065    if (ASMAtomicReadBool(&g_HvmR0.fSuspended))
    10651066        return VERR_HM_SUSPEND_PENDING;
     
    13301331    AssertReturn(pVM, VERR_INVALID_PARAMETER);
    13311332
    1332     /* Make sure we don't touch HM after we've disabled HM in
    1333        preparation of a suspend. */
     1333    /* Make sure we don't touch HM after we've disabled HM in preparation of a suspend. */
    13341334    AssertReturn(!ASMAtomicReadBool(&g_HvmR0.fSuspended), VERR_HM_SUSPEND_PENDING);
    13351335
     
    13911391        rc = hmR0EnableCpu(pVCpu->CTX_SUFF(pVM), idCpu);
    13921392
    1393     /* Reload host-context (back from ring-3/migrated CPUs), reload host context & shared bits. */
     1393    /* Reload host-state (back from ring-3/migrated CPUs) and shared guest/host bits. */
    13941394    HMCPU_CF_SET(pVCpu, HM_CHANGED_HOST_CONTEXT | HM_CHANGED_HOST_GUEST_SHARED_STATE);
    13951395    pVCpu->hm.s.idEnteredCpu = idCpu;
     
    14301430    AssertMsgRCReturn(rc, ("pfnEnterSession failed. rc=%Rrc pVCpu=%p HostCpuId=%u\n", rc, pVCpu, idCpu), rc);
    14311431
    1432     /* Load the host as we may be resuming code after a longjmp and quite
     1432    /* Load the host-state as we may be resuming code after a longjmp and quite
    14331433       possibly now be scheduled on a different CPU. */
    14341434    rc = g_HvmR0.pfnSaveHostState(pVM, pVCpu);
     
    14401440#endif
    14411441
    1442     /* Keep track of the CPU owning the VMCS for debugging scheduling weirdness
    1443        and ring-3 calls. */
     1442    /* Keep track of the CPU owning the VMCS for debugging scheduling weirdness and ring-3 calls. */
    14441443    if (RT_FAILURE(rc))
    14451444        pVCpu->hm.s.idEnteredCpu = NIL_RTCPUID;
     
    18951894# if HC_ARCH_BITS == 64
    18961895    uint64_t    u32Base  = X86DESC64_BASE(pDesc);
    1897 
    18981896    Log(("%s %04x - %RX64 %RX64 - base=%RX64 limit=%08x dpl=%d %s\n", pszMsg,
    18991897         Sel, pDesc->au64[0], pDesc->au64[1], u32Base, u32Limit, pDesc->Gen.u2Dpl, szMsg));
    19001898# else
    19011899    uint32_t    u32Base  = X86DESC_BASE(pDesc);
    1902 
    19031900    Log(("%s %04x - %08x %08x - base=%08x limit=%08x dpl=%d %s\n", pszMsg,
    19041901         Sel, pDesc->au32[0], pDesc->au32[1], u32Base, u32Limit, pDesc->Gen.u2Dpl, szMsg));
     
    19261923    } const s_aFlags[] =
    19271924    {
    1928         { "vip",NULL, X86_EFL_VIP },
    1929         { "vif",NULL, X86_EFL_VIF },
    1930         { "ac", NULL, X86_EFL_AC },
    1931         { "vm", NULL, X86_EFL_VM },
    1932         { "rf", NULL, X86_EFL_RF },
    1933         { "nt", NULL, X86_EFL_NT },
    1934         { "ov", "nv", X86_EFL_OF },
    1935         { "dn", "up", X86_EFL_DF },
    1936         { "ei", "di", X86_EFL_IF },
    1937         { "tf", NULL, X86_EFL_TF },
    1938         { "nt", "pl", X86_EFL_SF },
    1939         { "nz", "zr", X86_EFL_ZF },
    1940         { "ac", "na", X86_EFL_AF },
    1941         { "po", "pe", X86_EFL_PF },
    1942         { "cy", "nc", X86_EFL_CF },
     1925        { "vip", NULL, X86_EFL_VIP },
     1926        { "vif", NULL, X86_EFL_VIF },
     1927        { "ac",  NULL, X86_EFL_AC },
     1928        { "vm",  NULL, X86_EFL_VM },
     1929        { "rf",  NULL, X86_EFL_RF },
     1930        { "nt",  NULL, X86_EFL_NT },
     1931        { "ov",  "nv", X86_EFL_OF },
     1932        { "dn",  "up", X86_EFL_DF },
     1933        { "ei",  "di", X86_EFL_IF },
     1934        { "tf",  NULL, X86_EFL_TF },
     1935        { "nt",  "pl", X86_EFL_SF },
     1936        { "nz",  "zr", X86_EFL_ZF },
     1937        { "ac",  "na", X86_EFL_AF },
     1938        { "po",  "pe", X86_EFL_PF },
     1939        { "cy",  "nc", X86_EFL_CF },
    19431940    };
    19441941    char szEFlags[80];
    19451942    char *psz = szEFlags;
    1946     uint32_t efl = pCtx->eflags.u32;
     1943    uint32_t uEFlags = pCtx->eflags.u32;
    19471944    for (unsigned i = 0; i < RT_ELEMENTS(s_aFlags); i++)
    19481945    {
    1949         const char *pszAdd = s_aFlags[i].fFlag & efl ? s_aFlags[i].pszSet : s_aFlags[i].pszClear;
     1946        const char *pszAdd = s_aFlags[i].fFlag & uEFlags ? s_aFlags[i].pszSet : s_aFlags[i].pszClear;
    19501947        if (pszAdd)
    19511948        {
     
    19851982             pCtx->r8, pCtx->r9, pCtx->r10, pCtx->r11, pCtx->r12, pCtx->r13,
    19861983             pCtx->r14, pCtx->r15,
    1987              pCtx->rip, pCtx->rsp, pCtx->rbp, X86_EFL_GET_IOPL(efl), 31, szEFlags,
     1984             pCtx->rip, pCtx->rsp, pCtx->rbp, X86_EFL_GET_IOPL(uEFlags), 31, szEFlags,
    19881985             pCtx->cs.Sel, pCtx->cs.u64Base, pCtx->cs.u32Limit, pCtx->cs.Attr.u,
    19891986             pCtx->ds.Sel, pCtx->ds.u64Base, pCtx->ds.u32Limit, pCtx->ds.Attr.u,
     
    19951992             pCtx->dr[0],  pCtx->dr[1], pCtx->dr[2],  pCtx->dr[3],
    19961993             pCtx->dr[4],  pCtx->dr[5], pCtx->dr[6],  pCtx->dr[7],
    1997              pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pCtx->idtr.pIdt, pCtx->idtr.cbIdt, efl,
     1994             pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pCtx->idtr.pIdt, pCtx->idtr.cbIdt, uEFlags,
    19981995             pCtx->ldtr.Sel, pCtx->ldtr.u64Base, pCtx->ldtr.u32Limit, pCtx->ldtr.Attr.u,
    19991996             pCtx->tr.Sel, pCtx->tr.u64Base, pCtx->tr.u32Limit, pCtx->tr.Attr.u,
     
    20152012             ,
    20162013             pCtx->eax, pCtx->ebx, pCtx->ecx, pCtx->edx, pCtx->esi, pCtx->edi,
    2017              pCtx->eip, pCtx->esp, pCtx->ebp, X86_EFL_GET_IOPL(efl), 31, szEFlags,
     2014             pCtx->eip, pCtx->esp, pCtx->ebp, X86_EFL_GET_IOPL(uEFlags), 31, szEFlags,
    20182015             pCtx->cs.Sel, pCtx->cs.u64Base, pCtx->cs.u32Limit, pCtx->cs.Attr.u, pCtx->dr[0],  pCtx->dr[1],
    20192016             pCtx->ds.Sel, pCtx->ds.u64Base, pCtx->ds.u32Limit, pCtx->ds.Attr.u, pCtx->dr[2],  pCtx->dr[3],
     
    20222019             pCtx->gs.Sel, pCtx->gs.u64Base, pCtx->gs.u32Limit, pCtx->gs.Attr.u, pCtx->cr0,  pCtx->cr2,
    20232020             pCtx->ss.Sel, pCtx->ss.u64Base, pCtx->ss.u32Limit, pCtx->ss.Attr.u, pCtx->cr3,  pCtx->cr4,
    2024              pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pCtx->idtr.pIdt, pCtx->idtr.cbIdt, efl,
     2021             pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pCtx->idtr.pIdt, pCtx->idtr.cbIdt, uEFlags,
    20252022             pCtx->ldtr.Sel, pCtx->ldtr.u64Base, pCtx->ldtr.u32Limit, pCtx->ldtr.Attr.u,
    20262023             pCtx->tr.Sel, pCtx->tr.u64Base, pCtx->tr.u32Limit, pCtx->tr.Attr.u,
     
    20362033        pCtx->fpu.FPUDP, pCtx->fpu.DS, pCtx->fpu.Rsrvd2,
    20372034        pCtx->fpu.MXCSR, pCtx->fpu.MXCSR_MASK));
    2038 
    20392035
    20402036    Log(("MSR:\n"
     
    20532049        pCtx->msrSFMASK,
    20542050        pCtx->msrKERNELGSBASE));
    2055 
    20562051}
    20572052
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