VirtualBox

Changeset 82079 in vbox


Ignore:
Timestamp:
Nov 21, 2019 12:46:06 PM (5 years ago)
Author:
vboxsync
Message:

DevVGA: Map the first page of the FIFO into ring-0 so we can safely access the SVGA_FIFO_MIN, SVGA_FIFO_PITCHLOCK, and SVGA_FIFO_BUSY registers from there. bugref:9218

Location:
trunk/src/VBox/Devices/Graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp

    r82076 r82079  
    14361436
    14371437#endif /* IN_RING3 */
    1438 
    14391438#if defined(IN_RING0) || defined(IN_RING3)
     1439
    14401440/**
    14411441 * Safely updates the SVGA_FIFO_BUSY register (in shared memory).
     
    14991499        pThis->svga.u32PitchLock = pThis->svga.cbScanline;
    15001500}
    1501 #endif
     1501
     1502#endif /* IN_RING0 || IN_RING3 */
    15021503
    15031504
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h

    r82076 r82079  
    168168    /** The R3 FIFO pointer. */
    169169    R3PTRTYPE(uint32_t *)       pFIFOR3;
    170     /** The R0 FIFO pointer. */
     170    /** The R0 FIFO pointer.
     171     * @note This only points to the _first_ _page_ of the FIFO!  */
    171172    R0PTRTYPE(uint32_t *)       pFIFOR0;
    172173    /** R3 Opaque pointer to svga state. */
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r82078 r82079  
    66506650        AssertRCReturn(rc, PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
    66516651                                               N_("Failed to create VMSVGA FIFO (%u bytes)"), pThis->svga.cbFIFO));
    6652         pThis->svga.pFIFOR0 = (RTR0PTR)pThis->svga.pFIFOR3;
    66536652
    66546653        pPciDev->pfnRegionLoadChangeHookR3 = vgaR3PciRegionLoadChangeHook;
     
    73977396
    73987397    /*
    7399      * Map the VMSVGA FIFO into this context (only ring-0).
     7398     * Map the first page of the VMSVGA FIFO into this context (not raw-mode).
     7399     * We currently only access SVGA_FIFO_MIN, SVGA_FIFO_PITCHLOCK, and SVGA_FIFO_BUSY.
    74007400     */
     7401    AssertCompile((RT_MAX(SVGA_FIFO_MIN, RT_MAX(SVGA_FIFO_PITCHLOCK, SVGA_FIFO_BUSY)) + 1) * sizeof(uint32_t) < PAGE_SIZE);
    74017402# if defined(VBOX_WITH_VMSVGA) && !defined(IN_RC)
    7402 #  if defined(VBOX_WITH_2X_4GB_ADDR_SPACE)
    74037403    if (pThis->fVMSVGAEnabled)
    74047404    {
    7405         rc = PDMDevHlpMmio2SetUpContext(pDevIns, pThis->hMmio2VmSvgaFifo, 0 /* off */,  pThis->svga.cbFIFO,
     7405        rc = PDMDevHlpMmio2SetUpContext(pDevIns, pThis->hMmio2VmSvgaFifo, 0 /* off */, PAGE_SIZE,
    74067406                                        (void **)&pThis->svga.CTX_SUFF(pFIFO));
    74077407        AssertLogRelMsgRCReturn(rc, ("PDMDevHlpMapMMIO2IntoR0(%#x,) -> %Rrc\n", pThis->svga.cbFIFO, rc), rc);
    74087408    }
    7409 # endif
     7409    else
     7410        AssertReturn(pThis->hMmio2VmSvgaFifo == NIL_PGMMMIO2HANDLE, VERR_INVALID_STATE);
    74107411#endif
    74117412
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette