VirtualBox

Changeset 37298 in vbox


Ignore:
Timestamp:
Jun 1, 2011 4:30:11 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72042
Message:

HWACCM: Added todo on race in HWACCMR0EnableAllCpus. Hide dummy methods.

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

Legend:

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

    r37231 r37298  
    209209
    210210
     211/** @name Dummy callback handlers.
     212 * @{ */
     213
     214static DECLCALLBACK(int) hwaccmR0DummyEnter(PVM pVM, PVMCPU pVCpu, PHWACCM_CPUINFO pCpu)
     215{
     216    return VINF_SUCCESS;
     217}
     218
     219static DECLCALLBACK(int) hwaccmR0DummyLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
     220{
     221    return VINF_SUCCESS;
     222}
     223
     224static DECLCALLBACK(int) hwaccmR0DummyEnableCpu(PHWACCM_CPUINFO pCpu, PVM pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys)
     225{
     226    return VINF_SUCCESS;
     227}
     228
     229static DECLCALLBACK(int) hwaccmR0DummyDisableCpu(PHWACCM_CPUINFO pCpu, void *pvPageCpu, RTHCPHYS pPageCpuPhys)
     230{
     231    return VINF_SUCCESS;
     232}
     233
     234static DECLCALLBACK(int) hwaccmR0DummyInitVM(PVM pVM)
     235{
     236    return VINF_SUCCESS;
     237}
     238
     239static DECLCALLBACK(int) hwaccmR0DummyTermVM(PVM pVM)
     240{
     241    return VINF_SUCCESS;
     242}
     243
     244static DECLCALLBACK(int) hwaccmR0DummySetupVM(PVM pVM)
     245{
     246    return VINF_SUCCESS;
     247}
     248
     249static DECLCALLBACK(int) hwaccmR0DummyRunGuestCode(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
     250{
     251    return VINF_SUCCESS;
     252}
     253
     254static DECLCALLBACK(int) hwaccmR0DummySaveHostState(PVM pVM, PVMCPU pVCpu)
     255{
     256    return VINF_SUCCESS;
     257}
     258
     259static DECLCALLBACK(int) hwaccmR0DummyLoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
     260{
     261    return VINF_SUCCESS;
     262}
     263
     264/** @} */
     265
     266
     267
    211268/**
    212269 * Does global Ring-0 HWACCM initialization.
     
    224281
    225282    /* Fill in all callbacks with placeholders. */
    226     HWACCMR0Globals.pfnEnterSession     = HWACCMR0DummyEnter;
    227     HWACCMR0Globals.pfnLeaveSession     = HWACCMR0DummyLeave;
    228     HWACCMR0Globals.pfnSaveHostState    = HWACCMR0DummySaveHostState;
    229     HWACCMR0Globals.pfnLoadGuestState   = HWACCMR0DummyLoadGuestState;
    230     HWACCMR0Globals.pfnRunGuestCode     = HWACCMR0DummyRunGuestCode;
    231     HWACCMR0Globals.pfnEnableCpu        = HWACCMR0DummyEnableCpu;
    232     HWACCMR0Globals.pfnDisableCpu       = HWACCMR0DummyDisableCpu;
    233     HWACCMR0Globals.pfnInitVM           = HWACCMR0DummyInitVM;
    234     HWACCMR0Globals.pfnTermVM           = HWACCMR0DummyTermVM;
    235     HWACCMR0Globals.pfnSetupVM          = HWACCMR0DummySetupVM;
     283    HWACCMR0Globals.pfnEnterSession     = hwaccmR0DummyEnter;
     284    HWACCMR0Globals.pfnLeaveSession     = hwaccmR0DummyLeave;
     285    HWACCMR0Globals.pfnSaveHostState    = hwaccmR0DummySaveHostState;
     286    HWACCMR0Globals.pfnLoadGuestState   = hwaccmR0DummyLoadGuestState;
     287    HWACCMR0Globals.pfnRunGuestCode     = hwaccmR0DummyRunGuestCode;
     288    HWACCMR0Globals.pfnEnableCpu        = hwaccmR0DummyEnableCpu;
     289    HWACCMR0Globals.pfnDisableCpu       = hwaccmR0DummyDisableCpu;
     290    HWACCMR0Globals.pfnInitVM           = hwaccmR0DummyInitVM;
     291    HWACCMR0Globals.pfnTermVM           = hwaccmR0DummyTermVM;
     292    HWACCMR0Globals.pfnSetupVM          = hwaccmR0DummySetupVM;
    236293
    237294    /* Default is global VT-x/AMD-V init */
     
    707764        return VERR_HWACCM_SUSPEND_PENDING;
    708765
     766/** @todo r=bird: Here be dragons and they are racing one another...
     767 *  The problem is that allocating memory for the 128 CPUs might take longer
     768 *  than for the 2nd and 3rd cpu to get into the HWACCMR0SetupVM code. So, they
     769 *  may end up there without having enabled VT-x and #UD on a VMCLEAN for
     770 *  instance.   Or that's what it looks like at least. */
    709771    if (ASMAtomicCmpXchgU32((volatile uint32_t *)&HWACCMR0Globals.enmHwAccmState, HWACCMSTATE_ENABLED, HWACCMSTATE_UNINITIALIZED))
    710772    {
     
    18211883#endif /* VBOX_STRICT */
    18221884
    1823 /* Dummy callback handlers. */
    1824 VMMR0DECL(int) HWACCMR0DummyEnter(PVM pVM, PVMCPU pVCpu, PHWACCM_CPUINFO pCpu)
    1825 {
    1826     return VINF_SUCCESS;
    1827 }
    1828 
    1829 VMMR0DECL(int) HWACCMR0DummyLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
    1830 {
    1831     return VINF_SUCCESS;
    1832 }
    1833 
    1834 VMMR0DECL(int) HWACCMR0DummyEnableCpu(PHWACCM_CPUINFO pCpu, PVM pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys)
    1835 {
    1836     return VINF_SUCCESS;
    1837 }
    1838 
    1839 VMMR0DECL(int) HWACCMR0DummyDisableCpu(PHWACCM_CPUINFO pCpu, void *pvPageCpu, RTHCPHYS pPageCpuPhys)
    1840 {
    1841     return VINF_SUCCESS;
    1842 }
    1843 
    1844 VMMR0DECL(int) HWACCMR0DummyInitVM(PVM pVM)
    1845 {
    1846     return VINF_SUCCESS;
    1847 }
    1848 
    1849 VMMR0DECL(int) HWACCMR0DummyTermVM(PVM pVM)
    1850 {
    1851     return VINF_SUCCESS;
    1852 }
    1853 
    1854 VMMR0DECL(int) HWACCMR0DummySetupVM(PVM pVM)
    1855 {
    1856     return VINF_SUCCESS;
    1857 }
    1858 
    1859 VMMR0DECL(int) HWACCMR0DummyRunGuestCode(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
    1860 {
    1861     return VINF_SUCCESS;
    1862 }
    1863 
    1864 VMMR0DECL(int) HWACCMR0DummySaveHostState(PVM pVM, PVMCPU pVCpu)
    1865 {
    1866     return VINF_SUCCESS;
    1867 }
    1868 
    1869 VMMR0DECL(int) HWACCMR0DummyLoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
    1870 {
    1871     return VINF_SUCCESS;
    1872 }
  • trunk/src/VBox/VMM/include/HWACCMInternal.h

    r35346 r37298  
    895895#endif
    896896
    897 /* Dummy callback handlers. */
    898 VMMR0DECL(int) HWACCMR0DummyEnter(PVM pVM, PVMCPU pVCpu, PHWACCM_CPUINFO pCpu);
    899 VMMR0DECL(int) HWACCMR0DummyLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
    900 VMMR0DECL(int) HWACCMR0DummyEnableCpu(PHWACCM_CPUINFO pCpu, PVM pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys);
    901 VMMR0DECL(int) HWACCMR0DummyDisableCpu(PHWACCM_CPUINFO pCpu, void *pvPageCpu, RTHCPHYS pPageCpuPhys);
    902 VMMR0DECL(int) HWACCMR0DummyInitVM(PVM pVM);
    903 VMMR0DECL(int) HWACCMR0DummyTermVM(PVM pVM);
    904 VMMR0DECL(int) HWACCMR0DummySetupVM(PVM pVM);
    905 VMMR0DECL(int) HWACCMR0DummyRunGuestCode(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
    906 VMMR0DECL(int) HWACCMR0DummySaveHostState(PVM pVM, PVMCPU pVCpu);
    907 VMMR0DECL(int) HWACCMR0DummyLoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
    908 
    909897# ifdef VBOX_WITH_KERNEL_USING_XMM
    910898DECLASM(int)   hwaccmR0VMXStartVMWrapXMM(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu, PFNHWACCMVMXSTARTVM pfnStartVM);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette