VirtualBox

Changeset 34326 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Nov 24, 2010 2:03:55 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
68085
Message:

VMM: Removed the XXXInitCPU and XXXTermCPU methods since all but the HWACCM ones where stubs and the XXXTermCPU bits was not called in all expected paths. The HWACCMR3InitCPU was hooked up as a VMINITCOMPLETED_RING3 hook, essentially leaving it's position in the order of things unchanged, while the HWACCMR3TermCPU call was made static without changing its position at the end of HWACCMR3Term.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/CPUM.cpp

    r33595 r34326  
    235235        return rc;
    236236    CPUMR3Reset(pVM);
    237     return VINF_SUCCESS;
    238 }
    239 
    240 
    241 /**
    242  * Initializes the per-VCPU CPUM.
    243  *
    244  * @returns VBox status code.
    245  * @param   pVM         The VM to operate on.
    246  */
    247 VMMR3DECL(int) CPUMR3InitCPU(PVM pVM)
    248 {
    249     LogFlow(("CPUMR3InitCPU\n"));
    250237    return VINF_SUCCESS;
    251238}
     
    10231010 */
    10241011VMMR3DECL(int) CPUMR3Term(PVM pVM)
    1025 {
    1026     CPUMR3TermCPU(pVM);
    1027     return 0;
    1028 }
    1029 
    1030 
    1031 /**
    1032  * Terminates the per-VCPU CPUM.
    1033  *
    1034  * Termination means cleaning up and freeing all resources,
    1035  * the VM it self is at this point powered off or suspended.
    1036  *
    1037  * @returns VBox status code.
    1038  * @param   pVM         The VM to operate on.
    1039  */
    1040 VMMR3DECL(int) CPUMR3TermCPU(PVM pVM)
    10411012{
    10421013#ifdef VBOX_WITH_CRASHDUMP_MAGIC
  • trunk/src/VBox/VMM/EM.cpp

    r33595 r34326  
    405405
    406406/**
    407  * Initializes the per-VCPU EM.
    408  *
    409  * @returns VBox status code.
    410  * @param   pVM         The VM to operate on.
    411  */
    412 VMMR3DECL(int) EMR3InitCPU(PVM pVM)
    413 {
    414     LogFlow(("EMR3InitCPU\n"));
    415     return VINF_SUCCESS;
    416 }
    417 
    418 
    419 /**
    420407 * Applies relocations to data and code managed by this
    421408 * component. This function will be called at init and
     
    488475}
    489476
    490 /**
    491  * Terminates the per-VCPU EM.
    492  *
    493  * Termination means cleaning up and freeing all resources,
    494  * the VM it self is at this point powered off or suspended.
    495  *
    496  * @returns VBox status code.
    497  * @param   pVM         The VM to operate on.
    498  */
    499 VMMR3DECL(int) EMR3TermCPU(PVM pVM)
    500 {
    501     return 0;
    502 }
    503477
    504478/**
  • trunk/src/VBox/VMM/HWACCM.cpp

    r34187 r34326  
    271271static DECLCALLBACK(int) hwaccmR3Save(PVM pVM, PSSMHANDLE pSSM);
    272272static DECLCALLBACK(int) hwaccmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
     273static int hwaccmR3InitCPU(PVM pVM);
     274static int hwaccmR3TermCPU(PVM pVM);
    273275
    274276
     
    407409    AssertRC(rc);
    408410
    409     return VINF_SUCCESS;
     411    return rc;
    410412}
    411413
     
    416418 * @param   pVM         The VM to operate on.
    417419 */
    418 VMMR3DECL(int) HWACCMR3InitCPU(PVM pVM)
     420static int hwaccmR3InitCPU(PVM pVM)
    419421{
    420422    LogFlow(("HWACCMR3InitCPU\n"));
     
    625627#endif
    626628    return VINF_SUCCESS;
     629}
     630
     631/**
     632 * Called when a init phase has completed.
     633 *
     634 * @returns VBox status code.
     635 * @param   pVM                 The VM.
     636 * @param   enmWhat             The phase that completed.
     637 */
     638VMMR3_INT_DECL(int) HWACCMR3InitCompleted(PVM pVM, VMINITCOMPLETED enmWhat)
     639{
     640    switch (enmWhat)
     641    {
     642    case VMINITCOMPLETED_RING3:
     643        return hwaccmR3InitCPU(pVM);
     644    default:
     645        return VINF_SUCCESS;
     646    }
    627647}
    628648
     
    15091529        pVM->hwaccm.s.vmx.pRealModeTSS       = 0;
    15101530    }
    1511     HWACCMR3TermCPU(pVM);
     1531    hwaccmR3TermCPU(pVM);
    15121532    return 0;
    15131533}
     
    15151535/**
    15161536 * Terminates the per-VCPU HWACCM.
    1517  *
    1518  * Termination means cleaning up and freeing all resources,
    1519  * the VM it self is at this point powered off or suspended.
    15201537 *
    15211538 * @returns VBox status code.
    15221539 * @param   pVM         The VM to operate on.
    15231540 */
    1524 VMMR3DECL(int) HWACCMR3TermCPU(PVM pVM)
     1541static int hwaccmR3TermCPU(PVM pVM)
    15251542{
    15261543    for (VMCPUID i = 0; i < pVM->cCpus; i++)
  • trunk/src/VBox/VMM/PGM.cpp

    r33999 r34326  
    14311431
    14321432    return rc;
    1433 }
    1434 
    1435 
    1436 /**
    1437  * Initializes the per-VCPU PGM.
    1438  *
    1439  * @returns VBox status code.
    1440  * @param   pVM         The VM to operate on.
    1441  */
    1442 VMMR3DECL(int) PGMR3InitCPU(PVM pVM)
    1443 {
    1444     LogFlow(("PGMR3InitCPU\n"));
    1445     return VINF_SUCCESS;
    14461433}
    14471434
     
    24952482
    24962483/**
    2497  * Terminates the per-VCPU PGM.
    2498  *
    2499  * Termination means cleaning up and freeing all resources,
    2500  * the VM it self is at this point powered off or suspended.
    2501  *
    2502  * @returns VBox status code.
    2503  * @param   pVM         The VM to operate on.
    2504  */
    2505 VMMR3DECL(int) PGMR3TermCPU(PVM pVM)
    2506 {
    2507     return 0;
    2508 }
    2509 
    2510 
    2511 /**
    25122484 * Show paging mode.
    25132485 *
  • trunk/src/VBox/VMM/TM.cpp

    r34241 r34326  
    727727
    728728/**
    729  * Initializes the per-VCPU TM.
    730  *
    731  * @returns VBox status code.
    732  * @param   pVM         The VM to operate on.
    733  */
    734 VMM_INT_DECL(int) TMR3InitCPU(PVM pVM)
    735 {
    736     LogFlow(("TMR3InitCPU\n"));
    737     return VINF_SUCCESS;
    738 }
    739 
    740 
    741 /**
    742729 * Checks if the host CPU has a fixed TSC frequency.
    743730 *
     
    10201007    }
    10211008
    1022     return VINF_SUCCESS;
    1023 }
    1024 
    1025 
    1026 /**
    1027  * Terminates the per-VCPU TM.
    1028  *
    1029  * Termination means cleaning up and freeing all resources,
    1030  * the VM it self is at this point powered off or suspended.
    1031  *
    1032  * @returns VBox status code.
    1033  * @param   pVM         The VM to operate on.
    1034  */
    1035 VMM_INT_DECL(int) TMR3TermCPU(PVM pVM)
    1036 {
    10371009    return VINF_SUCCESS;
    10381010}
  • trunk/src/VBox/VMM/VM.cpp

    r34320 r34326  
    122122static int                  vmR3CreateU(PUVM pUVM, uint32_t cCpus, PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM);
    123123static int                  vmR3InitRing3(PVM pVM, PUVM pUVM);
    124 static int                  vmR3InitVMCpu(PVM pVM);
    125124static int                  vmR3InitRing0(PVM pVM);
    126125static int                  vmR3InitGC(PVM pVM);
     
    663662                if (RT_SUCCESS(rc))
    664663                {
    665                     rc = vmR3InitVMCpu(pVM);
    666                     if (RT_SUCCESS(rc))
    667                         rc = PGMR3FinalizeMappings(pVM);
     664                    rc = PGMR3FinalizeMappings(pVM);
    668665                    if (RT_SUCCESS(rc))
    669666                    {
     
    975972
    976973/**
    977  * Initializes all VM CPU components of the VM
    978  */
    979 static int vmR3InitVMCpu(PVM pVM)
    980 {
    981     int rc = VINF_SUCCESS;
    982     int rc2;
    983 
    984     rc = CPUMR3InitCPU(pVM);
    985     if (RT_SUCCESS(rc))
    986     {
    987         rc = HWACCMR3InitCPU(pVM);
    988         if (RT_SUCCESS(rc))
    989         {
    990             rc = PGMR3InitCPU(pVM);
    991             if (RT_SUCCESS(rc))
    992             {
    993                 rc = TMR3InitCPU(pVM);
    994                 if (RT_SUCCESS(rc))
    995                 {
    996                     rc = VMMR3InitCPU(pVM);
    997                     if (RT_SUCCESS(rc))
    998                     {
    999                         rc = EMR3InitCPU(pVM);
    1000                         if (RT_SUCCESS(rc))
    1001                         {
    1002                             LogFlow(("vmR3InitVMCpu: returns %Rrc\n", VINF_SUCCESS));
    1003                             return VINF_SUCCESS;
    1004                         }
    1005 
    1006                         rc2 = VMMR3TermCPU(pVM);
    1007                         AssertRC(rc2);
    1008                     }
    1009                     rc2 = TMR3TermCPU(pVM);
    1010                     AssertRC(rc2);
    1011                 }
    1012                 rc2 = PGMR3TermCPU(pVM);
    1013                 AssertRC(rc2);
    1014             }
    1015             rc2 = HWACCMR3TermCPU(pVM);
    1016             AssertRC(rc2);
    1017         }
    1018         rc2 = CPUMR3TermCPU(pVM);
    1019         AssertRC(rc2);
    1020     }
    1021     LogFlow(("vmR3InitVMCpu: returns %Rrc\n", rc));
    1022     return rc;
    1023 }
    1024 
    1025 
    1026 /**
    1027974 * Initializes all R0 components of the VM
    1028975 */
     
    11061053{
    11071054    int rc = VMMR3InitCompleted(pVM, enmWhat);
    1108 
     1055    if (RT_SUCCESS(rc))
     1056        rc = HWACCMR3InitCompleted(pVM, enmWhat);
    11091057    return rc;
    11101058}
     
    42934241    return VINF_SUCCESS;
    42944242}
     4243
  • trunk/src/VBox/VMM/VMM.cpp

    r34322 r34326  
    447447
    448448/**
    449  * Initializes the per-VCPU VMM.
    450  *
    451  * @returns VBox status code.
    452  * @param   pVM         The VM to operate on.
    453  */
    454 VMMR3DECL(int) VMMR3InitCPU(PVM pVM)
    455 {
    456     LogFlow(("VMMR3InitCPU\n"));
    457     return VINF_SUCCESS;
    458 }
    459 
    460 
    461 /**
    462449 * Initializes the R0 VMM.
    463450 *
     
    759746#endif
    760747    return rc;
    761 }
    762 
    763 
    764 /**
    765  * Terminates the per-VCPU VMM.
    766  *
    767  * Termination means cleaning up and freeing all resources,
    768  * the VM it self is at this point powered off or suspended.
    769  *
    770  * @returns VBox status code.
    771  * @param   pVM         The VM to operate on.
    772  */
    773 VMMR3_INT_DECL(int) VMMR3TermCPU(PVM pVM)
    774 {
    775     return VINF_SUCCESS;
    776748}
    777749
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