VirtualBox

Changeset 108132 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Feb 10, 2025 11:05:23 AM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167432
Message:

VMM/PGM: Merge and deduplicate code targeting x86 & amd64 in PGM.cpp. Don't bother compiling pool stuff on arm and darwin.amd64. jiraref:VBP-1531

Location:
trunk/src/VBox/VMM/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/PDMInternal.h

    r107308 r108132  
    4848#include <VBox/vmm/pdmcommon.h>
    4949#include <VBox/vmm/pdmtask.h>
    50 #ifdef VBOX_VMM_TARGET_ARMV8
     50#if defined(VBOX_VMM_TARGET_X86) || defined(VBOX_VMM_TARGET_AGNOSTIC)
     51# include <VBox/vmm/pdmapic.h>
     52#endif
     53#if defined(VBOX_VMM_TARGET_ARMV8) || defined(VBOX_VMM_TARGET_AGNOSTIC)
    5154# include <VBox/vmm/pdmgic.h>
    52 #else
    53 # include <VBox/vmm/pdmapic.h>
    5455#endif
    5556#include <VBox/sup.h>
     
    18281829#  define PDM_TO_APICBACKEND(a_pVM)          (&((a_pVM)->pdm.s.Ic.u.x86.ApicBackend))
    18291830#  define PDMCPU_TO_APICBACKEND(a_pVCpu)     (&((a_pVCpu)->CTX_SUFF(pVM)->pdm.s.Ic.u.x86.ApicBackend))
    1830 #else
     1831# else
    18311832#  define PDM_TO_APICBACKEND(a_pVM)          (&((a_pVM)->pdmr0.s.Ic.u.x86.ApicBackend))
    18321833#  define PDMCPU_TO_APICBACKEND(a_pVCpu)     (&((a_pVCpu)->CTX_SUFF(pVM)->pdmr0.s.Ic.u.x86.ApicBackend))
    1833 #endif
     1834# endif
    18341835#else
    18351836# ifdef IN_RING3
    18361837#  define PDM_TO_GICBACKEND(a_pVM)           (&((a_pVM)->pdm.s.Ic.u.armv8.GicBackend))
    18371838#  define PDMCPU_TO_GICBACKEND(a_pVCpu)      (&((a_pVCpu)->CTX_SUFF(pVM)->pdm.s.Ic.u.armv8.GicBackend))
    1838 #else
    1839 # error "Implement me"
    1840 #endif
     1839# else
     1840#  ifndef VBOX_WITH_MINIMAL_R0 /* hack for AllPdbTypeHack.cpp */
     1841#   error "Implement me"
     1842#  endif
     1843# endif
    18411844#endif
    18421845
  • trunk/src/VBox/VMM/include/PGMInline.h

    r107171 r108132  
    11621162}
    11631163
     1164#ifndef VBOX_WITH_ONLY_PGM_NEM_MODE
    11641165
    11651166/**
     
    11901191     * Just deal with the simple case here.
    11911192     */
    1192 #ifdef VBOX_STRICT
     1193# ifdef VBOX_STRICT
    11931194    PVMCC pVM = pPool->CTX_SUFF(pVM); NOREF(pVM);
    1194 #endif
    1195 #ifdef LOG_ENABLED
     1195# endif
     1196# ifdef LOG_ENABLED
    11961197    const unsigned uOrg = PGM_PAGE_GET_TRACKING(pPhysPage);
    1197 #endif
     1198# endif
    11981199    const unsigned cRefs = PGM_PAGE_GET_TD_CREFS(pPhysPage);
    11991200    if (cRefs == 1)
    12001201    {
    1201 #if 0 /* for more debug info */
     1202# if 0 /* for more debug info */
    12021203        AssertMsg(   pPoolPage->idx == PGM_PAGE_GET_TD_IDX(pPhysPage)
    12031204                  && iPte == PGM_PAGE_GET_PTE_INDEX(pPhysPage),
     
    12071208                   pPool->aPages[PGM_PAGE_GET_TD_IDX(pPhysPage)].enmKind,
    12081209                   ((uint64_t *)pPoolPage->CTX_SUFF(pvPage))[iPte]));
    1209 #else
     1210# else
    12101211        Assert(pPoolPage->idx == PGM_PAGE_GET_TD_IDX(pPhysPage));
    12111212        Assert(iPte == PGM_PAGE_GET_PTE_INDEX(pPhysPage));
    1212 #endif
     1213# endif
    12131214        /* Invalidate the tracking data. */
    12141215        PGM_PAGE_SET_TRACKING(pVM, pPhysPage, 0);
     
    13161317}
    13171318
     1319#endif /* !VBOX_WITH_ONLY_PGM_NEM_MODE */
    13181320
    13191321/** @} */
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r107194 r108132  
    7676 * Optimization for PAE page tables that are modified often
    7777 */
    78 #ifndef VBOX_VMM_TARGET_ARMV8
     78#if !defined(VBOX_VMM_TARGET_ARMV8) && !defined(VBOX_WITH_ONLY_PGM_NEM_MODE)
    7979# define PGMPOOL_WITH_OPTIMIZED_DIRTY_PT
    8080#endif
     
    25132513/** @name A20 gate macros
    25142514 * @{ */
    2515 #define PGM_WITH_A20
     2515#if defined(VBOX_VMM_TARGET_X86) || defined(DOXYGEN_RUNNING)
     2516# define PGM_WITH_A20
     2517#elif !defined(VBOX_VMM_TARGET_ARMV8) && !defined(IN_TSTVMSTRUCT)
     2518# error "Misconfig"
     2519#endif
    25162520#ifdef PGM_WITH_A20
    25172521# define PGM_A20_IS_ENABLED(a_pVCpu)                        ((a_pVCpu)->pgm.s.fA20Enabled)
     
    40004004void            pgmR3PhysAssertSharedPageChecksums(PVM pVM);
    40014005
     4006# ifndef VBOX_WITH_ONLY_PGM_NEM_MODE
    40024007int             pgmR3PoolInit(PVM pVM);
    40034008void            pgmR3PoolRelocate(PVM pVM);
     
    40074012DECLCALLBACK(VBOXSTRICTRC) pgmR3PoolClearAllRendezvous(PVM pVM, PVMCPU pVCpu, void *fpvFlushRemTbl);
    40084013void            pgmR3PoolWriteProtectPages(PVM pVM);
     4014# endif
    40094015
    40104016#endif /* IN_RING3 */
    4011 #ifdef IN_RING0
     4017#ifndef VBOX_WITH_ONLY_PGM_NEM_MODE
     4018# ifdef IN_RING0
    40124019int             pgmR0PoolInitVM(PGVM pGVM);
    4013 #endif
     4020# endif
    40144021int             pgmPoolAlloc(PVMCC pVM, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, bool fA20Enabled,
    40154022                             uint16_t iUser, uint32_t iUserTable, bool fLockPage, PPPGMPOOLPAGE ppPage);
     
    40764083int             pgmR3ReEnterShadowModeAfterPoolFlush(PVM pVM, PVMCPU pVCpu);
    40774084void            pgmR3RefreshShadowModeAfterA20Change(PVMCPU pVCpu);
     4085#endif  /* !VBOX_WITH_ONLY_PGM_NEM_MODE */
    40784086
    40794087int             pgmShwMakePageSupervisorAndWritable(PVMCPUCC pVCpu, RTGCPTR GCPtr, bool fBigPage, uint32_t fOpFlags);
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