VirtualBox

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


Ignore:
Timestamp:
Aug 29, 2013 12:57:00 PM (11 years ago)
Author:
vboxsync
Message:

VMM/HM: More dead code path elimination.

Location:
trunk/src/VBox/VMM/VMMR0
Files:
5 edited

Legend:

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

    r48135 r48153  
    8989    DECLR0CALLBACKMEMBER(void, pfnThreadCtxCallback,(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit));
    9090    DECLR0CALLBACKMEMBER(int,  pfnSaveHostState,(PVM pVM, PVMCPU pVCpu));
    91     DECLR0CALLBACKMEMBER(int,  pfnLoadGuestState,(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx));
    9291    DECLR0CALLBACKMEMBER(int,  pfnRunGuestCode,(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx));
    9392    DECLR0CALLBACKMEMBER(int,  pfnEnableCpu,(PHMGLOBALCPUINFO pCpu, PVM pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage,
     
    529528                g_HvmR0.pfnThreadCtxCallback = VMXR0ThreadCtxCallback;
    530529                g_HvmR0.pfnSaveHostState     = VMXR0SaveHostState;
    531                 g_HvmR0.pfnLoadGuestState    = VMXR0LoadGuestState;
    532530                g_HvmR0.pfnRunGuestCode      = VMXR0RunGuestCode;
    533531                g_HvmR0.pfnEnableCpu         = VMXR0EnableCpu;
     
    594592        g_HvmR0.pfnThreadCtxCallback = SVMR0ThreadCtxCallback;
    595593        g_HvmR0.pfnSaveHostState     = SVMR0SaveHostState;
    596         g_HvmR0.pfnLoadGuestState    = SVMR0LoadGuestState;
    597594        g_HvmR0.pfnRunGuestCode      = SVMR0RunGuestCode;
    598595        g_HvmR0.pfnEnableCpu         = SVMR0EnableCpu;
     
    658655    g_HvmR0.pfnThreadCtxCallback = hmR0DummyThreadCtxCallback;
    659656    g_HvmR0.pfnSaveHostState     = hmR0DummySaveHostState;
    660     g_HvmR0.pfnLoadGuestState    = hmR0DummyLoadGuestState;
    661657    g_HvmR0.pfnRunGuestCode      = hmR0DummyRunGuestCode;
    662658    g_HvmR0.pfnEnableCpu         = hmR0DummyEnableCpu;
     
    14591455
    14601456    /* Load the host as we may be resuming code after a longjmp and quite
    1461        possibly be scheduled on a different CPU. */
     1457       possibly now be scheduled on a different CPU. */
    14621458    rc = g_HvmR0.pfnSaveHostState(pVM, pVCpu);
    14631459    AssertMsgRCReturn(rc, ("pfnSaveHostState failed. rc=%Rrc pVCpu=%p HostCpuId=%u\n", rc, pVCpu, idCpu), rc);
    1464 
    1465     /** @todo This is not needed to be done here anymore, can fix/optimize later. */
    1466     rc = g_HvmR0.pfnLoadGuestState(pVM, pVCpu, pCtx);
    1467     AssertMsgRCReturn(rc, ("pfnLoadGuestState failed. rc=%Rrc pVCpu=%p HostCpuId=%u\n", rc, pVCpu, idCpu), rc);
    14681460
    14691461#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r48140 r48153  
    17181718
    17191719/**
    1720  * Loads the guest state on the way from ring-3.
    1721  *
    1722  * @returns VBox status code.
    1723  * @param   pVM         Pointer to the VM.
    1724  * @param   pVCpu       Pointer to the VMCPU.
    1725  * @param   pCtx        Pointer to the guest-CPU context.
    1726  *
    1727  * @remarks No-long-jump zone!!!
    1728  */
    1729 VMMR0DECL(int) SVMR0LoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
    1730 {
    1731     /*
    1732      * Avoid reloading the guest state on longjmp reentrants and do it lazily just before executing the guest.
    1733      * This only helps when we get rescheduled more than once to a different host CPU on a longjmp trip before
    1734      * finally executing guest code.
    1735      */
    1736     return VINF_SUCCESS;
    1737 }
    1738 
    1739 
    1740 /**
    17411720 * Saves the entire guest state from the VMCB into the
    17421721 * guest-CPU context. Currently there is no residual state left in the CPU that
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.h

    r47771 r48153  
    4141VMMR0DECL(void) SVMR0GlobalTerm(void);
    4242VMMR0DECL(int)  SVMR0Enter(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pCpu);
    43 VMMR0DECL(int)  SVMR0Leave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
    4443VMMR0DECL(void) SVMR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit);
    4544VMMR0DECL(int)  SVMR0EnableCpu(PHMGLOBALCPUINFO pCpu, PVM pVM, void *pvPageCpu, RTHCPHYS HCPhysCpuPage, bool fEnabledBySystem);
     
    5049VMMR0DECL(int)  SVMR0RunGuestCode(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
    5150VMMR0DECL(int)  SVMR0SaveHostState(PVM pVM, PVMCPU pVCpu);
    52 VMMR0DECL(int)  SVMR0LoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
    5351
    5452#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r48140 r48153  
    72007200    AssertMsg(!(pVCpu->hm.s.fContextUseFlags & HM_CHANGED_HOST_GUEST_SHARED_STATE), ("fContextUseFlags=%#x\n",
    72017201                                                                                     pVCpu->hm.s.fContextUseFlags));
    7202 }
    7203 
    7204 
    7205 /**
    7206  * Loads the guest state into the VMCS guest-state area.
    7207  *
    7208  * @returns VBox status code.
    7209  * @param   pVM         Pointer to the VM.
    7210  * @param   pVCpu       Pointer to the VMCPU.
    7211  * @param   pMixedCtx   Pointer to the guest-CPU context. The data may be
    7212  *                      out-of-sync. Make sure to update the required fields
    7213  *                      before using them.
    7214  *
    7215  * @remarks No-long-jump zone!!!
    7216  */
    7217 VMMR0DECL(int) VMXR0LoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)
    7218 {
    7219     /*
    7220      * Avoid reloading the guest state on longjmp reentrants and do it lazily just before executing the guest.
    7221      * When thread-context hooks are not used: This only helps when we get rescheduled more than once to a
    7222      * different host CPU on a longjmp trip before finally executing guest code.
    7223      *
    7224      * When thread-context hooks are used: We avoid loading the guest state here for the above reason plus
    7225      * we can avoid doing it while preemption is disabled (which it is here).
    7226      */
    7227     return VINF_SUCCESS;
    72287202}
    72297203
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.h

    r47771 r48153  
    3030
    3131VMMR0DECL(int)  VMXR0Enter(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pCpu);
    32 VMMR0DECL(int)  VMXR0Leave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
    3332VMMR0DECL(void) VMXR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit);
    3433VMMR0DECL(int)  VMXR0EnableCpu(PHMGLOBALCPUINFO pCpu, PVM pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys, bool fEnabledBySystem);
     
    4039VMMR0DECL(int)  VMXR0SetupVM(PVM pVM);
    4140VMMR0DECL(int)  VMXR0SaveHostState(PVM pVM, PVMCPU pVCpu);
    42 VMMR0DECL(int)  VMXR0LoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
    4341VMMR0DECL(int)  VMXR0RunGuestCode(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
    4442DECLASM(int)    VMXR0StartVM32(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu);
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