VirtualBox

Changeset 92170 in vbox for trunk/include


Ignore:
Timestamp:
Nov 1, 2021 10:06:25 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147993
Message:

VMM/PGM,NEM: Let NEM handle dirty VRAM (MMIO2) page tracking. Saves lots of exits when using the VBoxVGA device or VMSVGA in non-VMSVGA mode. Added a 32-bit NEM field to the PGMRAMRANGE structure called uNemRange. bugref:10122

Location:
trunk/include/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/err.h

    r91848 r92170  
    30113011/** NEM init failed because of missing kernel API (\#5). */
    30123012#define VERR_NEM_MISSING_KERNEL_API_5               (-6815)
     3013/** NEM failed to query dirty page bitmap. */
     3014#define VERR_NEM_QUERY_DIRTY_BITMAP_FAILED          (-6816)
    30133015
    30143016/** NEM internal processing error \#0. */
  • trunk/include/VBox/vmm/nem.h

    r92129 r92170  
    6262VMMR3_INT_DECL(void) NEMR3NotifyFF(PVM pVM, PVMCPU pVCpu, uint32_t fFlags);
    6363
    64 VMMR3_INT_DECL(int)  NEMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, void *pvR3, uint8_t *pu2State);
     64/**
     65 * Checks if dirty page tracking for MMIO2 ranges is supported.
     66 *
     67 * If it is, PGM will not install a physical write access handler for the MMIO2
     68 * region and instead just forward dirty bit queries NEMR3QueryMmio2DirtyBits.
     69 * The enable/disable control of the tracking will be ignored, and PGM will
     70 * always set NEM_NOTIFY_PHYS_MMIO_EX_F_TRACK_DIRTY_PAGES for such ranges.
     71 *
     72 * @retval  true if supported.
     73 * @retval  false if not.
     74 * @param   pVM     The cross context VM structure.
     75 */
     76VMMR3_INT_DECL(bool) NEMR3IsMmio2DirtyPageTrackingSupported(PVM pVM);
     77
     78/**
     79 * Worker for PGMR3PhysMmio2QueryAndResetDirtyBitmap.
     80 *
     81 * @returns VBox status code.
     82 * @param   pVM         The cross context VM structure.
     83 * @param   GCPhys      The address of the MMIO2 range.
     84 * @param   cb          The size of the MMIO2 range.
     85 * @param   uNemRange   The NEM internal range number.
     86 * @param   pvBitmap    The output bitmap.  Must be 8-byte aligned.  Ignored
     87 *                      when @a cbBitmap is zero.
     88 * @param   cbBitmap    The size of the bitmap.  Must be the size of the whole
     89 *                      MMIO2 range, rounded up to the nearest 8 bytes.
     90 *                      When zero only a reset is done.
     91 */
     92VMMR3_INT_DECL(int)  NEMR3PhysMmio2QueryAndResetDirtyBitmap(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t uNemRange,
     93                                                            void *pvBitmap, size_t cbBitmap);
     94
     95VMMR3_INT_DECL(int)  NEMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, void *pvR3,
     96                                                uint8_t *pu2State, uint32_t *puNemRange);
    6597VMMR3_INT_DECL(int)  NEMR3NotifyPhysMmioExMapEarly(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags,
    66                                                    void *pvRam, void *pvMmio2, uint8_t *pu2State);
     98                                                   void *pvRam, void *pvMmio2, uint8_t *pu2State, uint32_t *puNemRange);
    6799VMMR3_INT_DECL(int)  NEMR3NotifyPhysMmioExMapLate(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags,
    68                                                   void *pvRam, void *pvMmio2);
     100                                                  void *pvRam, void *pvMmio2, uint32_t *puNemRange);
    69101VMMR3_INT_DECL(int)  NEMR3NotifyPhysMmioExUnmap(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags,
    70102                                                void *pvRam, void *pvMmio2, uint8_t *pu2State);
    71103/** @name Flags for NEMR3NotifyPhysMmioExMap and NEMR3NotifyPhysMmioExUnmap.
    72104 * @{ */
     105/** Set if the range is replacing RAM rather that unused space. */
     106#define NEM_NOTIFY_PHYS_MMIO_EX_F_REPLACE               RT_BIT(0)
    73107/** Set if it's MMIO2 being mapped or unmapped. */
    74 #define NEM_NOTIFY_PHYS_MMIO_EX_F_MMIO2     RT_BIT(0)
    75 /** Set if the range is replacing RAM rather that unused space. */
    76 #define NEM_NOTIFY_PHYS_MMIO_EX_F_REPLACE   RT_BIT(1)
     108#define NEM_NOTIFY_PHYS_MMIO_EX_F_MMIO2                 RT_BIT(1)
     109/** Set if MMIO2 and dirty page tracking is configured. */
     110#define NEM_NOTIFY_PHYS_MMIO_EX_F_TRACK_DIRTY_PAGES     RT_BIT(2)
    77111/** @} */
    78112
  • trunk/include/VBox/vmm/vm.h

    r91702 r92170  
    13461346        struct NEM  s;
    13471347#endif
    1348         uint8_t     padding[256];       /* multiple of 64 */
     1348        uint8_t     padding[512];       /* multiple of 64 */
    13491349    } nem;
    13501350
     
    14541454
    14551455    /** Padding for aligning the structure size on a page boundrary. */
    1456     uint8_t         abAlignment2[2008 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
     1456    uint8_t         abAlignment2[1752 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
    14571457
    14581458    /* ---- end small stuff ---- */
  • trunk/include/VBox/vmm/vm.mac

    r91702 r92170  
    149149    .em                     resb 256
    150150    alignb 64
    151     .nem                    resb 256
     151    .nem                    resb 512
    152152    alignb 64
    153153    .tm                     resb 10112
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