VirtualBox

Changeset 73268 in vbox


Ignore:
Timestamp:
Jul 20, 2018 2:49:05 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123875
Message:

PGM: Working on consolidating templated code... bugref:9044

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r73266 r73268  
    593593PGMMODEDATASHW const g_aPgmShadowModeData[PGM_SHADOW_MODE_DATA_ARRAY_SIZE] =
    594594{
    595     { UINT8_MAX, NULL, NULL, NULL, NULL, NULL }, /* 0 */
    596     { UINT8_MAX, NULL, NULL, NULL, NULL, NULL }, /* PGM_TYPE_REAL */
    597     { UINT8_MAX, NULL, NULL, NULL, NULL, NULL }, /* PGM_TYPE_PROT */
     595    { UINT8_MAX, NULL, NULL, NULL, NULL }, /* 0 */
     596    { UINT8_MAX, NULL, NULL, NULL, NULL }, /* PGM_TYPE_REAL */
     597    { UINT8_MAX, NULL, NULL, NULL, NULL }, /* PGM_TYPE_PROT */
    598598    {
    599599        PGM_TYPE_32BIT,
     
    689689# define PGMMODEDATABTH_NULL_ENTRY()    { UINT32_MAX, UINT32_MAX, NULL, NULL, NULL, NULL, NULL, NULL }
    690690# define PGMMODEDATABTH_ENTRY(uShwT, uGstT, Nm) \
    691     { uShwT, uGstT, Nm(InvalidatePage), Nm(SyncCR3), Nm(PrefetchPage), Nm(VerifyAccessSyncPage), Nm(MapCR3), Nm(UnmapCR3), Nm(Enter), Nm(Relocate), }
     691    { uShwT, uGstT, Nm(InvalidatePage), Nm(SyncCR3), Nm(PrefetchPage), Nm(VerifyAccessSyncPage), Nm(MapCR3), Nm(UnmapCR3), Nm(Enter), }
    692692
    693693#elif defined(IN_RING3) && defined(VBOX_STRICT)
    694694# define PGMMODEDATABTH_NULL_ENTRY()    { UINT32_MAX, UINT32_MAX, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
    695695# define PGMMODEDATABTH_ENTRY(uShwT, uGstT, Nm) \
    696     { uShwT, uGstT, Nm(InvalidatePage), Nm(SyncCR3), Nm(PrefetchPage), Nm(VerifyAccessSyncPage), Nm(MapCR3), Nm(UnmapCR3), Nm(Enter), Nm(Relocate), Nm(AssertCR3) }
     696    { uShwT, uGstT, Nm(InvalidatePage), Nm(SyncCR3), Nm(PrefetchPage), Nm(VerifyAccessSyncPage), Nm(MapCR3), Nm(UnmapCR3), Nm(Enter), Nm(AssertCR3) }
    697697
    698698#else
     
    32483248    AssertPtrReturn(g_aPgmBothModeData[idxNewBth].pfnUnmapCR3, VERR_PGM_MODE_IPE);
    32493249    AssertPtrReturn(g_aPgmBothModeData[idxNewBth].pfnEnter, VERR_PGM_MODE_IPE);
    3250 #ifdef IN_RING3
    3251     AssertPtrReturn(g_aPgmBothModeData[idxNewBth].pfnRelocate, VERR_PGM_MODE_IPE);
    3252 #endif
    32533250#ifdef VBOX_STRICT
    32543251    AssertPtrReturn(g_aPgmBothModeData[idxNewBth].pfnAssertCR3, VERR_PGM_MODE_IPE);
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r73261 r73268  
    740740}
    741741
     742
     743#ifdef IN_RING3
     744/**
     745 * Relocate any GC pointers related to guest mode paging.
     746 *
     747 * @returns VBox status code.
     748 * @param   pVCpu       The cross context virtual CPU structure.
     749 * @param   offDelta    The relocation offset.
     750 */
     751PGM_GST_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta)
     752{
     753    pVCpu->pgm.s.pGst32BitPdRC += offDelta;
     754    for (unsigned i = 0; i < RT_ELEMENTS(pVCpu->pgm.s.apGstPaePDsRC); i++)
     755        pVCpu->pgm.s.apGstPaePDsRC[i] += offDelta;
     756    pVCpu->pgm.s.pGstPaePdptRC += offDelta;
     757
     758    return VINF_SUCCESS;
     759}
     760#endif
  • trunk/src/VBox/VMM/VMMAll/PGMAllShw.h

    r73267 r73268  
    582582}
    583583
     584
     585#ifdef IN_RING3
     586/**
     587 * Relocate any GC pointers related to shadow mode paging.
     588 *
     589 * @returns VBox status code.
     590 * @param   pVCpu       The cross context virtual CPU structure.
     591 * @param   offDelta    The relocation offset.
     592 */
     593PGM_SHW_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta)
     594{
     595    pVCpu->pgm.s.pShwPageCR3RC += offDelta;
     596    return VINF_SUCCESS;
     597}
     598#endif
     599
  • trunk/src/VBox/VMM/VMMR3/PGM.cpp

    r73266 r73268  
    26012601        else
    26022602            AssertFailed();
    2603 
    2604         uintptr_t idxBth = pVCpu->pgm.s.idxBothModeData;
    2605         if (    idxBth < RT_ELEMENTS(g_aPgmBothModeData)
    2606             && g_aPgmBothModeData[idxBth].pfnRelocate)
    2607             g_aPgmBothModeData[idxBth].pfnRelocate(pVCpu, offDelta);
    2608         else
    2609             AssertFailed();
    26102603    }
    26112604
  • trunk/src/VBox/VMM/VMMR3/PGMGst.h

    r73261 r73268  
    3333
    3434
    35 /**
    36  * Relocate any GC pointers related to guest mode paging.
    37  *
    38  * @returns VBox status code.
    39  * @param   pVCpu       The cross context virtual CPU structure.
    40  * @param   offDelta    The relocation offset.
    41  */
    42 PGM_GST_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta)
    43 {
    44     pVCpu->pgm.s.pGst32BitPdRC += offDelta;
    4535
    46     for (unsigned i = 0; i < RT_ELEMENTS(pVCpu->pgm.s.apGstPaePDsRC); i++)
    47     {
    48         pVCpu->pgm.s.apGstPaePDsRC[i] += offDelta;
    49     }
    50     pVCpu->pgm.s.pGstPaePdptRC += offDelta;
    51 
    52     return VINF_SUCCESS;
    53 }
    54 
  • trunk/src/VBox/VMM/VMMR3/PGMShw.h

    r73261 r73268  
    120120RT_C_DECLS_END
    121121
    122 
    123 /**
    124  * Relocate any GC pointers related to shadow mode paging.
    125  *
    126  * @returns VBox status code.
    127  * @param   pVCpu       The cross context virtual CPU structure.
    128  * @param   offDelta    The relocation offset.
    129  */
    130 PGM_SHW_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta)
    131 {
    132     pVCpu->pgm.s.pShwPageCR3RC += offDelta;
    133     return VINF_SUCCESS;
    134 }
    135 
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r73261 r73268  
    31583158    DECLCALLBACKMEMBER(int,         pfnEnter)(PVMCPU pVCpu, bool fIs64BitsPagingMode);
    31593159    DECLCALLBACKMEMBER(int,         pfnExit)(PVMCPU pVCpu);
     3160#ifdef IN_RING3
    31603161    DECLCALLBACKMEMBER(int,         pfnRelocate)(PVMCPU pVCpu, RTGCPTR offDelta); /**< Only in ring-3. */
     3162#endif
    31613163} PGMMODEDATASHW;
    31623164
     
    31883190    DECLCALLBACKMEMBER(int,         pfnUnmapCR3)(PVMCPU pVCpu);
    31893191    DECLCALLBACKMEMBER(int,         pfnEnter)(PVMCPU pVCpu, RTGCPHYS GCPhysCR3);
    3190 #ifdef IN_RING3
    3191     DECLCALLBACKMEMBER(int,         pfnRelocate)(PVMCPU pVCpu, RTGCPTR offDelta);
    3192 #else
     3192#ifndef IN_RING3
    31933193    DECLCALLBACKMEMBER(int,         pfnTrap0eHandler)(PVMCPU pVCpu, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, bool *pfLockTaken);
    31943194#endif
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