VirtualBox

Changeset 45378 in vbox


Ignore:
Timestamp:
Apr 5, 2013 2:43:12 PM (11 years ago)
Author:
vboxsync
Message:

VMM/VMMR0: HM bits. Some stats and adjustments.

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

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

    r45091 r45378  
    14001400    PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    14011401
     1402#ifdef VBOX_WITH_OLD_VTX_CODE
    14021403    /* Always load the guest's FPU/XMM state on-demand. */
    14031404    CPUMDeactivateGuestFPUState(pVCpu);
     
    14051406    /* Always load the guest's debug state on-demand. */
    14061407    CPUMDeactivateGuestDebugState(pVCpu);
    1407 
    1408     /* Always reload the host context and the guest's CR0 register. (!!!!) */
     1408#else
     1409    Assert(!CPUMIsGuestFPUStateActive(pVCpu));
     1410    Assert(!CPUMIsGuestDebugStateActive(pVCpu));
     1411#endif
     1412
     1413    /* Always reload the host context and the guest's CR0 register (for the FPU bits). */
    14091414    pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0 | HM_CHANGED_HOST_CONTEXT;
    14101415
     
    14711476    AssertReturn(!ASMAtomicReadBool(&g_HvmR0.fSuspended), VERR_HM_SUSPEND_PENDING);
    14721477
     1478    /* The new code does FPU restoration in the VMX R0 code. */
     1479#ifdef VBOX_WITH_OLD_VTX_CODE
    14731480    /*
    14741481     * Save the guest FPU and XMM state if necessary.
     
    14871494        Assert(!CPUMIsGuestFPUStateActive(pVCpu));
    14881495    }
     1496#endif
    14891497
    14901498    rc = g_HvmR0.pfnLeaveSession(pVM, pVCpu, pCtx);
     
    14941502       time it executes code. */
    14951503    if (    pVM->hm.s.fNestedPaging
    1496         &&  CPUMIsGuestInPagedProtectedModeEx(pCtx))
     1504#ifdef VBOX_WITH_OLD_VTX_CODE
     1505        &&  CPUMIsGuestInPagedProtectedModeEx(pCtx)
     1506#else
     1507        &&  CPUMIsGuestPagingEnabledEx(pCtx)
     1508#endif
     1509       )
     1510    {
    14971511        CPUMSetChangedFlags(pVCpu, CPUM_CHANGED_GLOBAL_TLB_FLUSH);
     1512    }
    14981513
    14991514    /* Keep track of the CPU owning the VMCS for debugging scheduling weirdness
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r45305 r45378  
    17481748 * shortly before a VM entry and execution MUST NOT be rescheduled between a call to
    17491749 * this function and a VM entry without calling this function again.
    1750  * 
     1750 *
    17511751 * @returns VBox status code.
    17521752 * @param   pVM         Pointer to the VM.
     
    18271827    int         rc = VINF_SUCCESS;
    18281828    RTGCUINTPTR val;
     1829
     1830    STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatLoadGuestState, x);
    18291831
    18301832    /*
     
    24202422    /* Minimal guest state update (ESP, EIP, EFLAGS mostly) */
    24212423    VMXR0LoadMinimalGuestState(pVM, pVCpu, pCtx);
     2424
     2425    STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatLoadGuestState, x);
    24222426    return rc;
    24232427}
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r45349 r45378  
    487487                             "/PROF/HM/CPU%d/StatEntry", i);
    488488        AssertRC(rc);
    489         /** @todo r=ramshankar: should be sorted out for the new-code which doesn't
    490          *        have 2 exit parts. */
    491489        rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit1, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL,
    492490                             "Profiling of VMXR0RunGuestCode exit part 1",
     
    497495                             "/PROF/HM/CPU%d/SwitchFromGC_2", i);
    498496        AssertRC(rc);
    499 # if 1 /* temporary for tracking down darwin holdup. */
     497# ifdef VBOX_WITH_OLD_VTX_CODE
     498        /* temporary for tracking down darwin holdup. */
    500499        rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2Sub1, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL,
    501500                             "Temporary - I/O",
     
    511510        AssertRC(rc);
    512511# endif
     512        rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatLoadGuestState, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL,
     513                             "Profiling of VMXR0LoadGuestState",
     514                             "/PROF/HM/CPU%d/StatLoadGuestState", i);
     515        AssertRC(rc);
    513516        rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatInGC, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL,
    514                              "Profiling of vmlaunch",
     517                             "Profiling of vmlaunch/vmresume",
    515518                             "/PROF/HM/CPU%d/InGC", i);
    516519        AssertRC(rc);
  • trunk/src/VBox/VMM/include/HMInternal.h

    r45351 r45378  
    789789    STAMPROFILEADV          StatExit1;
    790790    STAMPROFILEADV          StatExit2;
    791 #if 1 /* temporary for tracking down darwin issues. */
     791#ifdef VBOX_WITH_OLD_VTX_CODE /* temporary for tracking down darwin issues. */
    792792    STAMPROFILEADV          StatExit2Sub1;
    793793    STAMPROFILEADV          StatExit2Sub2;
    794794    STAMPROFILEADV          StatExit2Sub3;
    795795#endif
     796    STAMPROFILEADV          StatLoadGuestState;
    796797    STAMPROFILEADV          StatInGC;
    797798
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