VirtualBox

Changeset 91930 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Oct 21, 2021 10:12:30 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147735
Message:

VMM,Devices: Eliminate direct calls to IOMMmioResetRegion and IOMMmioMapMmio2Page APIs and introduce callbacks in the device helper callback table, bugref:10074

File:
1 edited

Legend:

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

    r91928 r91930  
    24242424
    24252425/** Current PDMDEVHLPR3 version number. */
    2426 #define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 55, 0)
     2426#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 56, 0)
    24272427
    24282428/**
     
    27152715     */
    27162716    DECLR3CALLBACKMEMBER(int, pfnMmio2ChangeRegionNo,(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion, uint32_t iNewRegion));
     2717
     2718    /**
     2719     * Mapping an MMIO2 page in place of an MMIO page for direct access.
     2720     *
     2721     * This is a special optimization used by the VGA device.  Call
     2722     * PDMDevHlpMmioResetRegion() to undo the mapping.
     2723     *
     2724     * @returns VBox status code.  This API may return VINF_SUCCESS even if no
     2725     *          remapping is made.
     2726     * @retval  VERR_SEM_BUSY in ring-0 if we cannot get the IOM lock.
     2727     *
     2728     * @param   pDevIns         The device instance @a hRegion and @a hMmio2 are
     2729     *                          associated with.
     2730     * @param   hRegion         The handle to the MMIO region.
     2731     * @param   offRegion       The offset into @a hRegion of the page to be
     2732     *                          remapped.
     2733     * @param   hMmio2          The MMIO2 handle.
     2734     * @param   offMmio2        Offset into @a hMmio2 of the page to be use for the
     2735     *                          mapping.
     2736     * @param   fPageFlags      Page flags to set. Must be (X86_PTE_RW | X86_PTE_P)
     2737     *                          for the time being.
     2738     */
     2739    DECLR3CALLBACKMEMBER(int, pfnMmioMapMmio2Page,(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion,
     2740                                                   uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags));
     2741
     2742    /**
     2743     * Reset a previously modified MMIO region; restore the access flags.
     2744     *
     2745     * This undoes the effects of PDMDevHlpMmioMapMmio2Page() and is currently only
     2746     * intended for some ancient VGA hack.  However, it would be great to extend it
     2747     * beyond VT-x and/or nested-paging.
     2748     *
     2749     * @returns VBox status code.
     2750     *
     2751     * @param   pDevIns         The device instance @a hRegion is associated with.
     2752     * @param   hRegion         The handle to the MMIO region.
     2753     */
     2754    DECLR3CALLBACKMEMBER(int, pfnMmioResetRegion, (PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion));
    27172755    /** @} */
    27182756
     
    57045742    DECLR0CALLBACKMEMBER(int, pfnPGMHandlerPhysicalPageTempOff,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPHYS GCPhysPage));
    57055743
     5744    /**
     5745     * Mapping an MMIO2 page in place of an MMIO page for direct access.
     5746     *
     5747     * This is a special optimization used by the VGA device.  Call
     5748     * PDMDevHlpMmioResetRegion() to undo the mapping.
     5749     *
     5750     * @returns VBox status code.  This API may return VINF_SUCCESS even if no
     5751     *          remapping is made.
     5752     * @retval  VERR_SEM_BUSY in ring-0 if we cannot get the IOM lock.
     5753     *
     5754     * @param   pDevIns         The device instance @a hRegion and @a hMmio2 are
     5755     *                          associated with.
     5756     * @param   hRegion         The handle to the MMIO region.
     5757     * @param   offRegion       The offset into @a hRegion of the page to be
     5758     *                          remapped.
     5759     * @param   hMmio2          The MMIO2 handle.
     5760     * @param   offMmio2        Offset into @a hMmio2 of the page to be use for the
     5761     *                          mapping.
     5762     * @param   fPageFlags      Page flags to set. Must be (X86_PTE_RW | X86_PTE_P)
     5763     *                          for the time being.
     5764     */
     5765    DECLR0CALLBACKMEMBER(int, pfnMmioMapMmio2Page,(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion,
     5766                                                   uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags));
     5767
     5768    /**
     5769     * Reset a previously modified MMIO region; restore the access flags.
     5770     *
     5771     * This undoes the effects of PDMDevHlpMmioMapMmio2Page() and is currently only
     5772     * intended for some ancient VGA hack.  However, it would be great to extend it
     5773     * beyond VT-x and/or nested-paging.
     5774     *
     5775     * @returns VBox status code.
     5776     *
     5777     * @param   pDevIns         The device instance @a hRegion is associated with.
     5778     * @param   hRegion         The handle to the MMIO region.
     5779     */
     5780    DECLR0CALLBACKMEMBER(int, pfnMmioResetRegion, (PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion));
     5781
    57065782    /** Space reserved for future members.
    57075783     * @{ */
     
    57275803
    57285804/** Current PDMDEVHLP version number. */
    5729 #define PDM_DEVHLPR0_VERSION                    PDM_VERSION_MAKE(0xffe5, 23, 0)
     5805#define PDM_DEVHLPR0_VERSION                    PDM_VERSION_MAKE(0xffe5, 24, 0)
    57305806
    57315807
     
    64716547
    64726548#endif /* IN_RING3 */
     6549
     6550/**
     6551 * @copydoc PDMDEVHLPR3::pfnMmioMapMmio2Page
     6552 */
     6553DECLINLINE(RTGCPHYS) PDMDevHlpMmioMapMmio2Page(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion,
     6554                                               uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags)
     6555{
     6556    return pDevIns->CTX_SUFF(pHlp)->pfnMmioMapMmio2Page(pDevIns, hRegion, offRegion, hMmio2, offMmio2, fPageFlags);
     6557}
     6558
     6559/**
     6560 * @copydoc PDMDEVHLPR3::pfnMmioResetRegion
     6561 */
     6562DECLINLINE(RTGCPHYS) PDMDevHlpMmioResetRegion(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion)
     6563{
     6564    return pDevIns->CTX_SUFF(pHlp)->pfnMmioResetRegion(pDevIns, hRegion);
     6565}
     6566
    64736567#if !defined(IN_RING3) || defined(DOXYGEN_RUNNING)
    64746568
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