VirtualBox

Changeset 92162 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Oct 31, 2021 11:34:31 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147985
Message:

VMM/PGM,DevVGA: Baked MMIO2 dirty page tracking into PGM, moving it out of DevVGA. Using the handler state to record a page as dirty (PGM_PAGE_HNDL_PHYS_STATE_DISABLED). bugref:10122

Location:
trunk/include/VBox/vmm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdev.h

    r92071 r92162  
    24252425
    24262426/** Current PDMDEVHLPR3 version number. */
    2427 #define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 61, 0)
     2427#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 62, 0)
    24282428
    24292429/**
     
    26432643     *                              any number up to UINT8_MAX is fine.
    26442644     * @param   cbRegion            The size (in bytes) of the region.
    2645      * @param   fFlags              Reserved for future use, must be zero.
     2645     * @param   fFlags              PGMPHYS_MMIO2_FLAGS_XXX (see pgm.h).
    26462646     * @param   pszDesc             Pointer to description string. This must not be
    26472647     *                              freed.
     
    27232723
    27242724    /**
     2725     * Queries and resets the dirty bitmap for an MMIO2 region.
     2726     *
     2727     * The MMIO2 region must have been created with the
     2728     * PGMPHYS_MMIO2_FLAGS_TRACK_DIRTY_PAGES flag for this to work.
     2729     *
     2730     * @returns VBox status code.
     2731     * @param   pDevIns     The device instance.
     2732     * @param   hRegion     The MMIO2 region handle.
     2733     * @param   pvBitmap    Where to return the bitmap.  Must be 8-byte aligned.
     2734     *                      Can be NULL if only resetting the tracking is desired.
     2735     * @param   cbBitmap    The bitmap size.  One bit per page in the region,
     2736     *                      rounded up to 8-bytes.  If pvBitmap is NULL this must
     2737     *                      also be zero.
     2738     */
     2739    DECLR3CALLBACKMEMBER(int, pfnMmio2QueryAndResetDirtyBitmap, (PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion,
     2740                                                                 void *pvBitmap, size_t cbBitmap));
     2741
     2742    /**
     2743     * Controls the dirty page tracking for an MMIO2 region.
     2744     *
     2745     * The MMIO2 region must have been created with the
     2746     * PGMPHYS_MMIO2_FLAGS_TRACK_DIRTY_PAGES flag for this to work.
     2747     *
     2748     * @returns VBox status code.
     2749     * @param   pDevIns     The device instance.
     2750     * @param   hRegion     The MMIO2 region handle.
     2751     * @param   fEnabled    When set to @c true the dirty page tracking will be
     2752     *                      enabled if currently disabled (bitmap is reset).  When
     2753     *                      set to @c false the dirty page tracking will be
     2754     *                      disabled.
     2755     */
     2756    DECLR3CALLBACKMEMBER(int, pfnMmio2ControlDirtyPageTracking, (PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion, bool fEnabled));
     2757
     2758    /**
    27252759     * Changes the number of an MMIO2 or pre-registered MMIO region.
    27262760     *
     
    27922826     * @param   cbBinary            The size of the binary pointer.  This must
    27932827     *                              be equal or smaller than @a cbRange.
    2794      * @param   fFlags              Shadow ROM flags, PGMPHYS_ROM_FLAGS_* in pgm.h.
     2828     * @param   fFlags              PGMPHYS_ROM_FLAGS_XXX (see pgm.h).
    27952829     * @param   pszDesc             Pointer to description string. This must not be freed.
    27962830     *
     
    67466780}
    67476781
     6782/**
     6783 * @copydoc PDMDEVHLPR3::pfnMmio2QueryAndResetDirtyBitmap
     6784 */
     6785DECLINLINE(int) PDMDevHlpMmio2QueryAndResetDirtyBitmap(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion,
     6786                                                       void *pvBitmap, size_t cbBitmap)
     6787{
     6788    return pDevIns->pHlpR3->pfnMmio2QueryAndResetDirtyBitmap(pDevIns, hRegion, pvBitmap, cbBitmap);
     6789}
     6790
     6791/**
     6792 * Reset the dirty bitmap tracking for an MMIO2 region.
     6793 *
     6794 * The MMIO2 region must have been created with the
     6795 * PGMPHYS_MMIO2_FLAGS_TRACK_DIRTY_PAGES flag for this to work.
     6796 *
     6797 * @returns VBox status code.
     6798 * @param   pDevIns     The device instance.
     6799 * @param   hRegion     The MMIO2 region handle.
     6800 */
     6801DECLINLINE(int) PDMDevHlpMmio2ResetDirtyBitmap(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion)
     6802{
     6803    return pDevIns->pHlpR3->pfnMmio2QueryAndResetDirtyBitmap(pDevIns, hRegion, NULL, 0);
     6804}
     6805
     6806/**
     6807 * @copydoc PDMDEVHLPR3::pfnMmio2ControlDirtyPageTracking
     6808 */
     6809DECLINLINE(int) PDMDevHlpMmio2ControlDirtyPageTracking(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion, bool fEnabled)
     6810{
     6811    return pDevIns->pHlpR3->pfnMmio2ControlDirtyPageTracking(pDevIns, hRegion, fEnabled);
     6812}
     6813
    67486814#endif /* IN_RING3 */
    67496815
     
    79037969 *                          PCI_ADDRESS_SPACE_MEM_PREFETCH, optionally or-ing in
    79047970 *                          PCI_ADDRESS_SPACE_BAR64 or PCI_ADDRESS_SPACE_BAR32.
    7905  * @param   fMmio2Flags     To be defined, must be zero.
     7971 * @param   fMmio2Flags     PGMPHYS_MMIO2_FLAGS_XXX (see pgm.h).
    79067972 * @param   pfnMapUnmap     Callback for doing the mapping, optional.  The
    79077973 *                          callback will be invoked holding only the PDM lock.
  • trunk/include/VBox/vmm/pgm.h

    r92125 r92162  
    698698                                          RTR3PTR pvUserR3, RTR0PTR pvUserR0, RTRCPTR pvUserRC, const char *pszDesc);
    699699VMMR3DECL(int)      PGMR3PhysMMIODeregister(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb);
     700
     701/** @name PGMPHYS_MMIO2_FLAGS_XXX - MMIO2 registration flags.
     702 * @see PGMR3PhysMmio2Register, PDMDevHlpMmio2Create
     703 * @{ */
     704/** Track dirty pages.
     705 * @see PGMR3PhysMmio2QueryAndResetDirtyBitmap(), PGMR3PhysMmio2ControlDirtyPageTracking(). */
     706#define PGMPHYS_MMIO2_FLAGS_TRACK_DIRTY_PAGES       RT_BIT_32(0)
     707/** Valid flags. */
     708#define PGMPHYS_MMIO2_FLAGS_VALID_MASK              UINT32_C(0x00000001)
     709/** @} */
     710
    700711VMMR3_INT_DECL(int) PGMR3PhysMmio2Register(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev, uint32_t iRegion, RTGCPHYS cb,
    701712                                           uint32_t fFlags, const char *pszDesc, void **ppv, PGMMMIO2HANDLE *phRegion);
     
    707718VMMR3_INT_DECL(RTGCPHYS) PGMR3PhysMmio2GetMappingAddress(PVM pVM, PPDMDEVINS pDevIns, PGMMMIO2HANDLE hMmio2);
    708719VMMR3_INT_DECL(int) PGMR3PhysMmio2ChangeRegionNo(PVM pVM, PPDMDEVINS pDevIns, PGMMMIO2HANDLE hMmio2, uint32_t iNewRegion);
    709 
    710 
    711 /** @name PGMR3PhysRegisterRom flags.
     720VMMR3_INT_DECL(int) PGMR3PhysMmio2QueryAndResetDirtyBitmap(PVM pVM, PPDMDEVINS pDevIns, PGMMMIO2HANDLE hMmio2,
     721                                                           void *pvBitmap, size_t cbBitmap);
     722VMMR3_INT_DECL(int) PGMR3PhysMmio2ControlDirtyPageTracking(PVM pVM, PPDMDEVINS pDevIns, PGMMMIO2HANDLE hMmio2, bool fEnabled);
     723
     724/** @name PGMPHYS_ROM_FLAGS_XXX - ROM registration flags.
     725 * @see PGMR3PhysRegisterRom, PDMDevHlpROMRegister
    712726 * @{ */
    713727/** Inidicates that ROM shadowing should be enabled. */
     
    728742VMMDECL(void)       PGMR3PhysSetA20(PVMCPU pVCpu, bool fEnable);
    729743
    730 VMMR3_INT_DECL(int) PGMR3HandlerPhysicalTypeRegisterEx(PVM pVM, PGMPHYSHANDLERKIND enmKind,
     744VMMR3_INT_DECL(int) PGMR3HandlerPhysicalTypeRegisterEx(PVM pVM, PGMPHYSHANDLERKIND enmKind, bool fKeepPgmLock,
    731745                                                       PFNPGMPHYSHANDLER pfnHandlerR3,
    732746                                                       R0PTRTYPE(PFNPGMPHYSHANDLER)     pfnHandlerR0,
    733747                                                       R0PTRTYPE(PFNPGMRZPHYSPFHANDLER) pfnPfHandlerR0,
    734748                                                       const char *pszDesc, PPGMPHYSHANDLERTYPE phType);
    735 VMMR3DECL(int)      PGMR3HandlerPhysicalTypeRegister(PVM pVM, PGMPHYSHANDLERKIND enmKind,
     749VMMR3DECL(int)      PGMR3HandlerPhysicalTypeRegister(PVM pVM, PGMPHYSHANDLERKIND enmKind, bool fKeepPgmLock,
    736750                                                     R3PTRTYPE(PFNPGMPHYSHANDLER) pfnHandlerR3,
    737751                                                     const char *pszModR0, const char *pszHandlerR0, const char *pszPfHandlerR0,
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