VirtualBox

Changeset 82094 in vbox


Ignore:
Timestamp:
Nov 22, 2019 12:58:02 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134901
Message:

DevVGA,PGM,IOM: Conveted the legacy MMIO region to the new style, adapting the MMIO2 page aliasing code to match (seems to work). bugref:9218

Location:
trunk
Files:
8 edited

Legend:

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

    r82026 r82094  
    457457VMMDECL(VBOXSTRICTRC)   IOMMMIORead(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, uint32_t *pu32Value, size_t cbValue);
    458458VMMDECL(VBOXSTRICTRC)   IOMMMIOWrite(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, uint32_t u32Value, size_t cbValue);
    459 VMMDECL(int)            IOMMMIOMapMMIO2Page(PVMCC pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysRemapped, uint64_t fPageFlags);
     459/*VMMDECL(int)            IOMMMIOMapMMIO2Page(PVMCC pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysRemapped, uint64_t fPageFlags);*/
    460460/*VMMDECL(int)            IOMMMIOMapMMIOHCPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint64_t fPageFlags); - not used any more */
    461 VMMDECL(int)            IOMMMIOResetRegion(PVMCC pVM, RTGCPHYS GCPhys);
     461/*VMMDECL(int)            IOMMMIOResetRegion(PVMCC pVM, RTGCPHYS GCPhys);*/
    462462
    463463VMM_INT_DECL(VBOXSTRICTRC) IOMR0MmioPhysHandler(PVMCC pVM, PVMCPUCC pVCpu, uint32_t uErrorCode, RTGCPHYS GCPhysFault);
    464 VMM_INT_DECL(int)       IOMMmioMapMmio2Page(PVMCC pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion,
    465                                                 uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags);
     464VMMDECL(int)            IOMMmioMapMmio2Page(PVMCC pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion,
     465                                            uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags);
    466466VMMR0_INT_DECL(int)     IOMR0MmioMapMmioHCPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint64_t fPageFlags);
    467 VMM_INT_DECL(int)       IOMMmioResetRegion(PVMCC pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion);
     467VMMDECL(int)            IOMMmioResetRegion(PVMCC pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion);
    468468
    469469
  • trunk/include/VBox/vmm/pgm.h

    r81705 r82094  
    385385VMMDECL(int)        PGMHandlerPhysicalJoin(PVMCC pVM, RTGCPHYS GCPhys1, RTGCPHYS GCPhys2);
    386386VMMDECL(int)        PGMHandlerPhysicalPageTempOff(PVMCC pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysPage);
    387 VMMDECL(int)        PGMHandlerPhysicalPageAlias(PVMCC pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysPage, RTGCPHYS GCPhysPageRemap);
     387VMMDECL(int)        PGMHandlerPhysicalPageAliasMmio2(PVMCC pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysPage,
     388                                                     PPDMDEVINS pDevIns, PGMMMIO2HANDLE hMmio2, RTGCPHYS offMMio2PageRemap);
    388389VMMDECL(int)        PGMHandlerPhysicalPageAliasHC(PVMCC pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysPage, RTHCPHYS HCPhysPageRemap);
    389390VMMDECL(int)        PGMHandlerPhysicalReset(PVMCC pVM, RTGCPHYS GCPhys);
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r82089 r82094  
    715715            if (pThis->fRemappedVGA)
    716716            {
    717                 IOMMMIOResetRegion(PDMDevHlpGetVM(pThis->CTX_SUFF(pDevIns)), 0x000a0000);
     717                PPDMDEVINS pDevIns = pThis->CTX_SUFF(pDevIns);
     718                IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
    718719                pThis->fRemappedVGA = false;
    719720            }
     
    754755            if (pThis->fRemappedVGA)
    755756            {
    756                 IOMMMIOResetRegion(PDMDevHlpGetVM(pThis->CTX_SUFF(pDevIns)), 0x000a0000);
     757                PPDMDEVINS pDevIns = pThis->CTX_SUFF(pDevIns);
     758                IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
    757759                pThis->fRemappedVGA = false;
    758760            }
     
    10251027            if (pThis->fRemappedVGA)
    10261028            {
    1027                 IOMMMIOResetRegion(PDMDevHlpGetVM(pThis->CTX_SUFF(pDevIns)), 0x000a0000);
     1029                PPDMDEVINS pDevIns = pThis->CTX_SUFF(pDevIns);
     1030                IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
    10281031                pThis->fRemappedVGA = false;
    10291032            }
     
    11341137            if (pThis->fRemappedVGA)
    11351138            {
    1136                 IOMMMIOResetRegion(PDMDevHlpGetVM(pThis->CTX_SUFF(pDevIns)), 0x000a0000);
     1139                PPDMDEVINS pDevIns = pThis->CTX_SUFF(pDevIns);
     1140                IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
    11371141                pThis->fRemappedVGA = false;
    11381142            }
     
    11791183static uint32_t vga_mem_readb(PVGASTATE pThis, RTGCPHYS addr, int *prc)
    11801184{
    1181     int memory_map_mode, plane;
     1185    int plane;
    11821186    uint32_t ret;
    11831187
    11841188    Log3(("vga: read [0x%x] -> ", addr));
    1185     /* convert to VGA memory offset */
    1186     memory_map_mode = (pThis->gr[6] >> 2) & 3;
    1187 #ifndef IN_RC
    1188     RTGCPHYS GCPhys = addr; /* save original address */
    1189 #endif
    11901189
    11911190#ifdef VMSVGA_WITH_VGA_FB_BACKUP_AND_IN_RZ
     
    12011200#endif
    12021201
     1202
     1203    /* convert to VGA memory offset */
     1204#ifndef IN_RC
     1205    RTGCPHYS GCPhys = addr; /* save original address */
     1206#endif
    12031207    addr &= 0x1ffff;
     1208
     1209    int const memory_map_mode = (pThis->gr[6] >> 2) & 3;
    12041210    switch(memory_map_mode) {
    12051211    case 0:
     
    12331239            /** @todo only allow read access (doesn't work now) */
    12341240            STAM_COUNTER_INC(&pThis->StatMapPage);
    1235             IOMMMIOMapMMIO2Page(PDMDevHlpGetVM(pThis->CTX_SUFF(pDevIns)), GCPhys,
    1236                                 pThis->GCPhysVRAM + addr, X86_PTE_RW | X86_PTE_P);
     1241            PPDMDEVINS pDevIns = pThis->CTX_SUFF(pDevIns);
     1242            IOMMmioMapMmio2Page(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy, GCPhys - 0xa0000,
     1243                                pThis->hMmio2VRam, addr, X86_PTE_RW | X86_PTE_P);
    12371244            /* Set as dirty as write accesses won't be noticed now. */
    12381245            vgaR3MarkDirty(pThis, addr);
     
    12841291}
    12851292
    1286 /** called for accesses between 0xa0000 and 0xc0000 */
    1287 static int vga_mem_writeb(PVGASTATE pThis, RTGCPHYS addr, uint32_t val)
    1288 {
    1289     int memory_map_mode, plane, write_mode, b, func_select, mask;
     1293/**
     1294 * called for accesses between 0xa0000 and 0xc0000
     1295 */
     1296static VBOXSTRICTRC vga_mem_writeb(PVGASTATE pThis, RTGCPHYS addr, uint32_t val)
     1297{
     1298    int plane, write_mode, b, func_select, mask;
    12901299    uint32_t write_mask, bit_mask, set_mask;
    12911300
    12921301    Log3(("vga: [0x%x] = 0x%02x\n", addr, val));
    1293     /* convert to VGA memory offset */
    1294     memory_map_mode = (pThis->gr[6] >> 2) & 3;
    1295 #ifndef IN_RC
    1296     RTGCPHYS GCPhys = addr; /* save original address */
    1297 #endif
    12981302
    12991303#ifdef VMSVGA_WITH_VGA_FB_BACKUP_AND_IN_RZ
     
    13041308#endif
    13051309
     1310    /* convert to VGA memory offset */
     1311#ifndef IN_RC
     1312    RTGCPHYS const GCPhys = addr; /* save original address */
     1313#endif
    13061314    addr &= 0x1ffff;
     1315
     1316    int const memory_map_mode = (pThis->gr[6] >> 2) & 3;
    13071317    switch(memory_map_mode) {
    13081318    case 0:
     
    13381348            {
    13391349                STAM_COUNTER_INC(&pThis->StatMapPage);
    1340                 IOMMMIOMapMMIO2Page(PDMDevHlpGetVM(pThis->CTX_SUFF(pDevIns)), GCPhys,
    1341                                     pThis->GCPhysVRAM + addr, X86_PTE_RW | X86_PTE_P);
     1350                PPDMDEVINS pDevIns = pThis->CTX_SUFF(pDevIns);
     1351                IOMMmioMapMmio2Page(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy, GCPhys - 0xa0000,
     1352                                    pThis->hMmio2VRam, addr, X86_PTE_RW | X86_PTE_P);
    13421353                pThis->fRemappedVGA = true;
    13431354            }
     
    35503561}
    35513562
    3552 
    3553 /**
    3554  * @callback_method_impl{FNIOMMMIOFILL,
     3563#undef APPLY_LOGICAL_AND_MASK
     3564
     3565/**
     3566 * @callback_method_impl{FNIOMMMIONEWFILL,
    35553567 * Legacy VGA memory (0xa0000 - 0xbffff) write hook\, to be called from IOM and
    35563568 * from the inside of VGADeviceGC.cpp. This is the advanced version of
    35573569 * vga_mem_writeb function.}
    35583570 */
    3559 PDMBOTHCBDECL(int) vgaMMIOFill(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, uint32_t u32Item, unsigned cbItem, unsigned cItems)
     3571static DECLCALLBACK(VBOXSTRICTRC)
     3572vgaMmioFill(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, uint32_t u32Item, unsigned cbItem, unsigned cItems)
    35603573{
    35613574    PVGASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PVGASTATE);
    35623575    Assert(PDMDevHlpCritSectIsOwner(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)));
    35633576
    3564     return vgaInternalMMIOFill(pThis, pvUser, GCPhysAddr, u32Item, cbItem, cItems);
    3565 }
    3566 #undef APPLY_LOGICAL_AND_MASK
    3567 
    3568 
    3569 /**
    3570  * @callback_method_impl{FNIOMMMIOREAD, Legacy VGA memory (0xa0000 - 0xbffff)
    3571  *                      read hook\, to be called from IOM.}
    3572  */
    3573 PDMBOTHCBDECL(int) vgaMMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb)
     3577    return vgaInternalMMIOFill(pThis, pvUser, off, u32Item, cbItem, cItems);
     3578}
     3579
     3580
     3581/**
     3582 * @callback_method_impl{FNIOMMMIONEWREAD,
     3583 * Legacy VGA memory (0xa0000 - 0xbffff) read hook\, to be called from IOM.}
     3584 */
     3585static DECLCALLBACK(VBOXSTRICTRC) vgaMmioRead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void *pv, unsigned cb)
    35743586{
    35753587    PVGASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PVGASTATE);
     
    35823594    {
    35833595        case 1:
    3584             *(uint8_t  *)pv = vga_mem_readb(pThis, GCPhysAddr, &rc);
     3596            *(uint8_t  *)pv = vga_mem_readb(pThis, off, &rc);
    35853597            break;
    35863598        case 2:
    3587             *(uint16_t *)pv = vga_mem_readb(pThis, GCPhysAddr, &rc)
    3588                            | (vga_mem_readb(pThis, GCPhysAddr + 1, &rc) << 8);
     3599/** @todo This and the wider accesses maybe misbehave when accessing bytes
     3600 *        crossing the 512KB VRAM boundrary if the access is handled in
     3601 *        ring-0 and operating in latched mode. */
     3602            *(uint16_t *)pv = vga_mem_readb(pThis, off, &rc)
     3603                           | (vga_mem_readb(pThis, off + 1, &rc) << 8);
    35893604            break;
    35903605        case 4:
    3591             *(uint32_t *)pv = vga_mem_readb(pThis, GCPhysAddr, &rc)
    3592                            | (vga_mem_readb(pThis, GCPhysAddr + 1, &rc) <<  8)
    3593                            | (vga_mem_readb(pThis, GCPhysAddr + 2, &rc) << 16)
    3594                            | (vga_mem_readb(pThis, GCPhysAddr + 3, &rc) << 24);
     3606            *(uint32_t *)pv = vga_mem_readb(pThis, off, &rc)
     3607                           | (vga_mem_readb(pThis, off + 1, &rc) <<  8)
     3608                           | (vga_mem_readb(pThis, off + 2, &rc) << 16)
     3609                           | (vga_mem_readb(pThis, off + 3, &rc) << 24);
    35953610            break;
    35963611
    35973612        case 8:
    3598             *(uint64_t *)pv = (uint64_t)vga_mem_readb(pThis, GCPhysAddr, &rc)
    3599                            | ((uint64_t)vga_mem_readb(pThis, GCPhysAddr + 1, &rc) <<  8)
    3600                            | ((uint64_t)vga_mem_readb(pThis, GCPhysAddr + 2, &rc) << 16)
    3601                            | ((uint64_t)vga_mem_readb(pThis, GCPhysAddr + 3, &rc) << 24)
    3602                            | ((uint64_t)vga_mem_readb(pThis, GCPhysAddr + 4, &rc) << 32)
    3603                            | ((uint64_t)vga_mem_readb(pThis, GCPhysAddr + 5, &rc) << 40)
    3604                            | ((uint64_t)vga_mem_readb(pThis, GCPhysAddr + 6, &rc) << 48)
    3605                            | ((uint64_t)vga_mem_readb(pThis, GCPhysAddr + 7, &rc) << 56);
     3613            *(uint64_t *)pv = (uint64_t)vga_mem_readb(pThis, off, &rc)
     3614                           | ((uint64_t)vga_mem_readb(pThis, off + 1, &rc) <<  8)
     3615                           | ((uint64_t)vga_mem_readb(pThis, off + 2, &rc) << 16)
     3616                           | ((uint64_t)vga_mem_readb(pThis, off + 3, &rc) << 24)
     3617                           | ((uint64_t)vga_mem_readb(pThis, off + 4, &rc) << 32)
     3618                           | ((uint64_t)vga_mem_readb(pThis, off + 5, &rc) << 40)
     3619                           | ((uint64_t)vga_mem_readb(pThis, off + 6, &rc) << 48)
     3620                           | ((uint64_t)vga_mem_readb(pThis, off + 7, &rc) << 56);
    36063621            break;
    36073622
     
    36113626            while (cb-- > 0)
    36123627            {
    3613                 *pbData++ = vga_mem_readb(pThis, GCPhysAddr++, &rc);
     3628                *pbData++ = vga_mem_readb(pThis, off++, &rc);
    36143629                if (RT_UNLIKELY(rc != VINF_SUCCESS))
    36153630                    break;
     
    36233638
    36243639/**
    3625  * @callback_method_impl{FNIOMMMIOWRITE, Legacy VGA memory (0xa0000 - 0xbffff)
    3626  *                     write hook\, to be called from IOM.}
    3627  */
    3628 PDMBOTHCBDECL(int) vgaMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void const *pv, unsigned cb)
    3629 {
    3630     PVGASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PVGASTATE);
     3640 * @callback_method_impl{FNIOMMMIONEWWRITE,
     3641 * Legacy VGA memory (0xa0000 - 0xbffff) write hook\, to be called from IOM.}
     3642 */
     3643static DECLCALLBACK(VBOXSTRICTRC) vgaMmioWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb)
     3644{
     3645    PVGASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PVGASTATE);
    36313646    uint8_t const *pbSrc = (uint8_t const *)pv;
    36323647    NOREF(pvUser);
     
    36343649    Assert(PDMDevHlpCritSectIsOwner(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)));
    36353650
    3636     int rc;
     3651    VBOXSTRICTRC rc;
    36373652    switch (cb)
    36383653    {
    36393654        case 1:
    3640             rc = vga_mem_writeb(pThis, GCPhysAddr, *pbSrc);
     3655            rc = vga_mem_writeb(pThis, off, *pbSrc);
    36413656            break;
    36423657#if 1
    36433658        case 2:
    3644             rc = vga_mem_writeb(pThis, GCPhysAddr + 0, pbSrc[0]);
     3659            rc = vga_mem_writeb(pThis, off + 0, pbSrc[0]);
    36453660            if (RT_LIKELY(rc == VINF_SUCCESS))
    3646                 rc = vga_mem_writeb(pThis, GCPhysAddr + 1, pbSrc[1]);
     3661                rc = vga_mem_writeb(pThis, off + 1, pbSrc[1]);
    36473662            break;
    36483663        case 4:
    3649             rc = vga_mem_writeb(pThis, GCPhysAddr + 0, pbSrc[0]);
     3664            rc = vga_mem_writeb(pThis, off + 0, pbSrc[0]);
    36503665            if (RT_LIKELY(rc == VINF_SUCCESS))
    3651                 rc = vga_mem_writeb(pThis, GCPhysAddr + 1, pbSrc[1]);
     3666                rc = vga_mem_writeb(pThis, off + 1, pbSrc[1]);
    36523667            if (RT_LIKELY(rc == VINF_SUCCESS))
    3653                 rc = vga_mem_writeb(pThis, GCPhysAddr + 2, pbSrc[2]);
     3668                rc = vga_mem_writeb(pThis, off + 2, pbSrc[2]);
    36543669            if (RT_LIKELY(rc == VINF_SUCCESS))
    3655                 rc = vga_mem_writeb(pThis, GCPhysAddr + 3, pbSrc[3]);
     3670                rc = vga_mem_writeb(pThis, off + 3, pbSrc[3]);
    36563671            break;
    36573672        case 8:
    3658             rc = vga_mem_writeb(pThis, GCPhysAddr + 0, pbSrc[0]);
     3673            rc = vga_mem_writeb(pThis, off + 0, pbSrc[0]);
    36593674            if (RT_LIKELY(rc == VINF_SUCCESS))
    3660                 rc = vga_mem_writeb(pThis, GCPhysAddr + 1, pbSrc[1]);
     3675                rc = vga_mem_writeb(pThis, off + 1, pbSrc[1]);
    36613676            if (RT_LIKELY(rc == VINF_SUCCESS))
    3662                 rc = vga_mem_writeb(pThis, GCPhysAddr + 2, pbSrc[2]);
     3677                rc = vga_mem_writeb(pThis, off + 2, pbSrc[2]);
    36633678            if (RT_LIKELY(rc == VINF_SUCCESS))
    3664                 rc = vga_mem_writeb(pThis, GCPhysAddr + 3, pbSrc[3]);
     3679                rc = vga_mem_writeb(pThis, off + 3, pbSrc[3]);
    36653680            if (RT_LIKELY(rc == VINF_SUCCESS))
    3666                 rc = vga_mem_writeb(pThis, GCPhysAddr + 4, pbSrc[4]);
     3681                rc = vga_mem_writeb(pThis, off + 4, pbSrc[4]);
    36673682            if (RT_LIKELY(rc == VINF_SUCCESS))
    3668                 rc = vga_mem_writeb(pThis, GCPhysAddr + 5, pbSrc[5]);
     3683                rc = vga_mem_writeb(pThis, off + 5, pbSrc[5]);
    36693684            if (RT_LIKELY(rc == VINF_SUCCESS))
    3670                 rc = vga_mem_writeb(pThis, GCPhysAddr + 6, pbSrc[6]);
     3685                rc = vga_mem_writeb(pThis, off + 6, pbSrc[6]);
    36713686            if (RT_LIKELY(rc == VINF_SUCCESS))
    3672                 rc = vga_mem_writeb(pThis, GCPhysAddr + 7, pbSrc[7]);
     3687                rc = vga_mem_writeb(pThis, off + 7, pbSrc[7]);
    36733688            break;
    36743689#else
    36753690        case 2:
    3676             rc = vgaMMIOFill(pDevIns, GCPhysAddr, *(uint16_t *)pv, 2, 1);
     3691            rc = vgaMmioFill(pDevIns, off, *(uint16_t *)pv, 2, 1);
    36773692            break;
    36783693        case 4:
    3679             rc = vgaMMIOFill(pDevIns, GCPhysAddr, *(uint32_t *)pv, 4, 1);
     3694            rc = vgaMmioFill(pDevIns, off, *(uint32_t *)pv, 4, 1);
    36803695            break;
    36813696        case 8:
    3682             rc = vgaMMIOFill(pDevIns, GCPhysAddr, *(uint64_t *)pv, 8, 1);
     3697            rc = vgaMmioFill(pDevIns, off, *(uint64_t *)pv, 8, 1);
    36833698            break;
    36843699#endif
     
    36863701            rc = VINF_SUCCESS;
    36873702            while (cb-- > 0 && rc == VINF_SUCCESS)
    3688                 rc = vga_mem_writeb(pThis, GCPhysAddr++, *pbSrc++);
     3703                rc = vga_mem_writeb(pThis, off++, *pbSrc++);
    36893704            break;
    36903705
     
    36973712/**
    36983713 * Handle LFB access.
    3699  * @returns VBox status code.
     3714 *
     3715 * @returns Strict VBox status code.
    37003716 * @param   pVM         VM handle.
    37013717 * @param   pThis       VGA device instance data.
     
    37033719 * @param   GCPtr       The access virtual address (only GC).
    37043720 */
    3705 static int vgaLFBAccess(PVMCC pVM, PVGASTATE pThis, RTGCPHYS GCPhys, RTGCPTR GCPtr)
    3706 {
    3707     int rc = PDMDevHlpCritSectEnter(pThis->CTX_SUFF(pDevIns), &pThis->CritSect, VINF_EM_RAW_EMULATE_INSTR);
    3708     if (rc != VINF_SUCCESS)
    3709         return rc;
    3710 
    3711     /*
    3712      * Set page dirty bit.
    3713      */
    3714     vgaR3MarkDirty(pThis, GCPhys - pThis->GCPhysVRAM);
    3715     pThis->fLFBUpdated = true;
    3716 
    3717     /*
    3718      * Turn of the write handler for this particular page and make it R/W.
    3719      * Then return telling the caller to restart the guest instruction.
    3720      * ASSUME: the guest always maps video memory RW.
    3721      */
    3722     rc = PGMHandlerPhysicalPageTempOff(pVM, pThis->GCPhysVRAM, GCPhys);
    3723     if (RT_SUCCESS(rc))
    3724     {
     3721static VBOXSTRICTRC vgaLFBAccess(PVMCC pVM, PVGASTATE pThis, RTGCPHYS GCPhys, RTGCPTR GCPtr)
     3722{
     3723    VBOXSTRICTRC rc = PDMDevHlpCritSectEnter(pThis->CTX_SUFF(pDevIns), &pThis->CritSect, VINF_EM_RAW_EMULATE_INSTR);
     3724    if (rc == VINF_SUCCESS)
     3725    {
     3726        /*
     3727         * Set page dirty bit.
     3728         */
     3729        vgaR3MarkDirty(pThis, GCPhys - pThis->GCPhysVRAM);
     3730        pThis->fLFBUpdated = true;
     3731
     3732        /*
     3733         * Turn of the write handler for this particular page and make it R/W.
     3734         * Then return telling the caller to restart the guest instruction.
     3735         * ASSUME: the guest always maps video memory RW.
     3736         */
     3737        rc = PGMHandlerPhysicalPageTempOff(pVM, pThis->GCPhysVRAM, GCPhys);
     3738        if (RT_SUCCESS(rc))
     3739        {
    37253740#ifndef IN_RING3
    3726         rc = PGMShwMakePageWritable(PDMDevHlpGetVMCPU(pThis->CTX_SUFF(pDevIns)), GCPtr,
    3727                                     PGM_MK_PG_IS_MMIO2 | PGM_MK_PG_IS_WRITE_FAULT);
     3741            rc = PGMShwMakePageWritable(PDMDevHlpGetVMCPU(pThis->CTX_SUFF(pDevIns)), GCPtr,
     3742                                        PGM_MK_PG_IS_MMIO2 | PGM_MK_PG_IS_WRITE_FAULT);
     3743            PDMDevHlpCritSectLeave(pThis->CTX_SUFF(pDevIns), &pThis->CritSect);
     3744            AssertMsgReturn(    rc == VINF_SUCCESS
     3745                            /* In the SMP case the page table might be removed while we wait for the PGM lock in the trap handler. */
     3746                            ||  rc == VERR_PAGE_TABLE_NOT_PRESENT
     3747                            ||  rc == VERR_PAGE_NOT_PRESENT,
     3748                            ("PGMShwModifyPage -> GCPtr=%RGv rc=%d\n", GCPtr, rc),
     3749                            rc);
     3750#else  /* IN_RING3 - We don't have any virtual page address of the access here. */
     3751            PDMDevHlpCritSectLeave(pThis->CTX_SUFF(pDevIns), &pThis->CritSect);
     3752            Assert(GCPtr == 0);
     3753            RT_NOREF1(GCPtr);
     3754#endif
     3755            return VINF_SUCCESS;
     3756        }
     3757
    37283758        PDMDevHlpCritSectLeave(pThis->CTX_SUFF(pDevIns), &pThis->CritSect);
    3729         AssertMsgReturn(    rc == VINF_SUCCESS
    3730                         /* In the SMP case the page table might be removed while we wait for the PGM lock in the trap handler. */
    3731                         ||  rc == VERR_PAGE_TABLE_NOT_PRESENT
    3732                         ||  rc == VERR_PAGE_NOT_PRESENT,
    3733                         ("PGMShwModifyPage -> GCPtr=%RGv rc=%d\n", GCPtr, rc),
    3734                         rc);
    3735 #else /* IN_RING3 : We don't have any virtual page address of the access here. */
    3736         PDMDevHlpCritSectLeave(pThis->CTX_SUFF(pDevIns), &pThis->CritSect);
    3737         Assert(GCPtr == 0);
    3738         RT_NOREF1(GCPtr);
    3739 #endif
    3740         return VINF_SUCCESS;
    3741     }
    3742 
    3743     PDMDevHlpCritSectLeave(pThis->CTX_SUFF(pDevIns), &pThis->CritSect);
    3744     AssertMsgFailed(("PGMHandlerPhysicalPageTempOff -> rc=%d\n", rc));
     3759        AssertMsgFailed(("PGMHandlerPhysicalPageTempOff -> rc=%d\n", rc));
     3760    }
    37453761    return rc;
    37463762}
     
    37693785 *      VBE LFB write access handler for the dirty tracking.}
    37703786 */
    3771 PGM_ALL_CB_DECL(VBOXSTRICTRC) vgaLFBAccessHandler(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf,
    3772                                                   PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser)
    3773 {
    3774     PVGASTATE   pThis = (PVGASTATE)pvUser;
    3775     int         rc;
     3787PGM_ALL_CB_DECL(VBOXSTRICTRC) vgaLFBAccessHandler(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys, void *pvPhys,
     3788                                                  void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType,
     3789                                                  PGMACCESSORIGIN enmOrigin, void *pvUser)
     3790{
     3791    PVGASTATE pThis = (PVGASTATE)pvUser;
    37763792    Assert(pThis);
    37773793    Assert(GCPhys >= pThis->GCPhysVRAM);
    3778     NOREF(pVCpu); NOREF(pvPhys); NOREF(pvBuf); NOREF(cbBuf); NOREF(enmAccessType); NOREF(enmOrigin);
    3779 
    3780     rc = vgaLFBAccess(pVM, pThis, GCPhys, 0);
    3781     if (RT_SUCCESS(rc))
    3782         return VINF_PGM_HANDLER_DO_DEFAULT;
    3783     AssertMsg(rc <= VINF_SUCCESS, ("rc=%Rrc\n", rc));
     3794    RT_NOREF(pVCpu, pvPhys, pvBuf, cbBuf, enmAccessType, enmOrigin);
     3795
     3796    VBOXSTRICTRC rc = vgaLFBAccess(pVM, pThis, GCPhys, 0);
     3797    if (rc == VINF_SUCCESS)
     3798        rc = VINF_PGM_HANDLER_DO_DEFAULT;
     3799#ifdef IN_RING3
     3800    else
     3801        AssertMsg(rc < VINF_SUCCESS, ("rc=%Rrc\n", VBOXSTRICTRC_VAL(rc)));
     3802#endif
    37843803    return rc;
    37853804}
     
    48284847    /* This should be called only in non VBVA mode. */
    48294848# else
    4830     if (VBVAUpdateDisplay (pThis) == VINF_SUCCESS)
     4849    if (VBVAUpdateDisplay(pThis) == VINF_SUCCESS)
    48314850    {
    48324851        PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
     
    48434862    if (pThis->fRemappedVGA)
    48444863    {
    4845         IOMMMIOResetRegion(PDMDevHlpGetVM(pDevIns), 0x000a0000);
     4864        IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
    48464865        pThis->fRemappedVGA = false;
    48474866    }
     
    48744893    if (pThis->fRemappedVGA)
    48754894    {
    4876         IOMMMIOResetRegion(PDMDevHlpGetVM(pDevIns), 0x000a0000);
     4895        IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
    48774896        pThis->fRemappedVGA = false;
    48784897    }
     
    60556074    if (pThis->fRemappedVGA)
    60566075    {
    6057         IOMMMIOResetRegion(PDMDevHlpGetVM(pDevIns), 0x000a0000);
     6076        IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
    60586077        pThis->fRemappedVGA = false;
    60596078    }
     
    66246643# undef REG_PORT
    66256644
    6626     /* vga mmio */
    6627     rc = PDMDevHlpMMIORegisterEx(pDevIns, 0x000a0000, 0x00020000, NULL /*pvUser*/,
    6628                                  IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
    6629                                  vgaMMIOWrite, vgaMMIORead, vgaMMIOFill, "VGA - VGA Video Buffer");
    6630     AssertRCReturn(rc, rc);
    6631     if (pDevIns->fRCEnabled)
    6632     {
    6633         rc = PDMDevHlpMMIORegisterRCEx(pDevIns, 0x000a0000, 0x00020000, NIL_RTRCPTR /*pvUser*/,
    6634                                        "vgaMMIOWrite", "vgaMMIORead", "vgaMMIOFill");
    6635         if (RT_FAILURE(rc))
    6636             return rc;
    6637     }
    6638     if (pDevIns->fR0Enabled)
    6639     {
    6640         rc = PDMDevHlpMMIORegisterR0Ex(pDevIns, 0x000a0000, 0x00020000, NIL_RTR0PTR /*pvUser*/,
    6641                                        "vgaMMIOWrite", "vgaMMIORead", "vgaMMIOFill");
    6642         if (RT_FAILURE(rc))
    6643             return rc;
    6644     }
    6645 
    66466645    /* vga bios */
    66476646    rc = PDMDevHlpIoPortCreateAndMap(pDevIns, VBE_PRINTF_PORT, 1 /*cPorts*/, vgaIoPortWriteBios, vgaIoPortReadBios,
    66486647                                     "VGA BIOS debug/panic", NULL /*paExtDescs*/, &pThis->hIoPortBios);
     6648    AssertRCReturn(rc, rc);
     6649
     6650    /*
     6651     * The MDA/CGA/EGA/VGA/whatever fixed MMIO area.
     6652     */
     6653    rc = PDMDevHlpMmioCreateExAndMap(pDevIns, 0x000a0000, 0x00020000,
     6654                                     IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU | IOMMMIO_FLAGS_ABS,
     6655                                     NULL /*pPciDev*/, UINT32_MAX /*iPciRegion*/,
     6656                                     vgaMmioWrite, vgaMmioRead, vgaMmioFill, NULL /*pvUser*/,
     6657                                     "VGA - VGA Video Buffer", &pThis->hMmioLegacy);
    66496658    AssertRCReturn(rc, rc);
    66506659
     
    70147023        LogoHdr.fu8FadeIn = 1;
    70157024    else if (RT_FAILURE(rc))
    7016         return PDMDEV_SET_ERROR(pDevIns, rc,
    7017                                 N_("Configuration error: Querying \"FadeIn\" as integer failed"));
     7025        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Querying \"FadeIn\" as integer failed"));
    70187026
    70197027    rc = pHlp->pfnCFGMQueryU8(pCfg, "FadeOut", &LogoHdr.fu8FadeOut);
     
    70217029        LogoHdr.fu8FadeOut = 1;
    70227030    else if (RT_FAILURE(rc))
    7023         return PDMDEV_SET_ERROR(pDevIns, rc,
    7024                                 N_("Configuration error: Querying \"FadeOut\" as integer failed"));
     7031        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Querying \"FadeOut\" as integer failed"));
    70257032
    70267033    rc = pHlp->pfnCFGMQueryU16(pCfg, "LogoTime", &LogoHdr.u16LogoMillies);
     
    70287035        LogoHdr.u16LogoMillies = 0;
    70297036    else if (RT_FAILURE(rc))
    7030         return PDMDEV_SET_ERROR(pDevIns, rc,
    7031                                 N_("Configuration error: Querying \"LogoTime\" as integer failed"));
     7037        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Querying \"LogoTime\" as integer failed"));
    70327038
    70337039    rc = pHlp->pfnCFGMQueryU8(pCfg, "ShowBootMenu", &LogoHdr.fu8ShowBootMenu);
     
    70357041        LogoHdr.fu8ShowBootMenu = 0;
    70367042    else if (RT_FAILURE(rc))
    7037         return PDMDEV_SET_ERROR(pDevIns, rc,
    7038                                 N_("Configuration error: Querying \"ShowBootMenu\" as integer failed"));
     7043        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Querying \"ShowBootMenu\" as integer failed"));
    70397044
    70407045# if defined(DEBUG) && !defined(DEBUG_sunlover) && !defined(DEBUG_michael)
     
    72097214    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatRZMemoryWrite, STAMTYPE_PROFILE, "RZ/MMIO-Write", STAMUNIT_TICKS_PER_CALL, "Profiling of the VGAGCMemoryWrite() body.");
    72107215    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatR3MemoryWrite, STAMTYPE_PROFILE, "R3/MMIO-Write", STAMUNIT_TICKS_PER_CALL, "Profiling of the VGAGCMemoryWrite() body.");
    7211     PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMapPage,       STAMTYPE_COUNTER, "MapPageCalls",  STAMUNIT_OCCURENCES,     "Calls to IOMMMIOMapMMIO2Page.");
     7216    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMapPage,       STAMTYPE_COUNTER, "MapPageCalls",  STAMUNIT_OCCURENCES,     "Calls to IOMMmioMapMmio2Page.");
    72127217    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatUpdateDisp,    STAMTYPE_COUNTER, "UpdateDisplay", STAMUNIT_OCCURENCES,     "Calls to vgaR3PortUpdateDisplay().");
    72137218# endif
     
    72987303        AssertReturn(!pThis->fVMSVGAEnabled, VERR_INVALID_STATE);
    72997304# endif
     7305
     7306    /*
     7307     * MMIO.
     7308     */
     7309    rc = PDMDevHlpMmioSetUpContextEx(pDevIns, pThis->hMmioLegacy, vgaMmioWrite, vgaMmioRead, vgaMmioFill, NULL /*pvUser*/);
     7310    AssertRCReturn(rc, rc);
    73007311
    73017312    /*
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r82088 r82094  
    563563    } pendingVhwaCommands;
    564564
     565    /** The MMIO handle of the legacy graphics buffer/regs at 0xa0000-0xbffff. */
     566    PGMMMIO2HANDLE              hMmioLegacy;
     567
    565568    /** @name I/O ports for range 0x3c0-3cf.
    566569     * @{ */
  • trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp

    r82026 r82094  
    813813
    814814
     815#if 0  /* not used any more */
    815816/**
    816817 * Mapping an MMIO2 page in place of an MMIO page for direct access.
     
    884885    return VINF_SUCCESS;
    885886}
     887#endif /* unused */
    886888
    887889#if 0  /* not used any more */
     
    942944#endif
    943945
    944 
     946#if 0 /* unused */
    945947/**
    946948 * Reset a previously modified MMIO region; restore the access flags.
     
    10031005    return rc;
    10041006}
    1005 
     1007#endif /*unused */
  • trunk/src/VBox/VMM/VMMAll/IOMAllMmioNew.cpp

    r82026 r82094  
    10561056 *                          for the time being.
    10571057 */
    1058 VMM_INT_DECL(int) IOMMmioMapMmio2Page(PVMCC pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion,
    1059                                       uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags)
     1058VMMDECL(int) IOMMmioMapMmio2Page(PVMCC pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion,
     1059                                 uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags)
    10601060{
    10611061    /* Currently only called from the VGA device during MMIO. */
     
    11091109             * Do the aliasing; page align the addresses since PGM is picky.
    11101110             */
    1111 #if 0 /** @todo fix when DevVGA is converted to new model.  */
    1112             rc = PGMHandlerPhysicalPageAlias(pVM, GCPhys, GCPhys + (offRange & ~(RTGCPHYS)PAGE_OFFSET_MASK),
    1113                                              pDevIns, hMmio2, offMmio2);
    1114 #else
    1115             AssertFailed();
    1116             rc = VERR_NOT_IMPLEMENTED;
    1117             RT_NOREF(offMmio2, hMmio2);
    1118 #endif
     1111            rc = PGMHandlerPhysicalPageAliasMmio2(pVM, GCPhys, GCPhys + (offRegion & ~(RTGCPHYS)PAGE_OFFSET_MASK),
     1112                                                  pDevIns, hMmio2, offMmio2);
    11191113        }
    11201114        else
     
    12301224 * @param   hRegion         The handle to the MMIO region.
    12311225 */
    1232 VMM_INT_DECL(int) IOMMmioResetRegion(PVMCC pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion)
     1226VMMDECL(int) IOMMmioResetRegion(PVMCC pVM, PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion)
    12331227{
    12341228    Log(("IOMMMIOResetRegion %#RX64\n", hRegion));
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r81153 r82094  
    2929#include <VBox/vmm/stam.h>
    3030#include <VBox/vmm/dbgf.h>
     31#ifdef IN_RING0
     32# include <VBox/vmm/pdmdev.h>
     33#endif
    3134#include "PGMInternal.h"
    3235#include <VBox/vmm/vmcc.h>
     
    11031106 *
    11041107 * This is used in pair with PGMHandlerPhysicalPageTempOff(),
    1105  * PGMHandlerPhysicalPageAlias() or PGMHandlerPhysicalPageAliasHC().
     1108 * PGMHandlerPhysicalPageAliasMmio2() or PGMHandlerPhysicalPageAliasHC().
    11061109 *
    11071110 * @returns VBox status code.
     
    12831286
    12841287/**
     1288 * Resolves an MMIO2 page.
     1289 *
     1290 * Caller as taken the PGM lock.
     1291 *
     1292 * @returns Pointer to the page if valid, NULL otherwise
     1293 * @param   pVM             The cross context VM structure.
     1294 * @param   pDevIns         The device owning it.
     1295 * @param   hMmio2          The MMIO2 region.
     1296 * @param   offMmio2Page    The offset into the region.
     1297 */
     1298static PPGMPAGE pgmPhysResolveMmio2PageLocked(PVMCC pVM, PPDMDEVINS pDevIns, PGMMMIO2HANDLE hMmio2, RTGCPHYS offMmio2Page)
     1299{
     1300    /* Only works if the handle is in the handle table! */
     1301    AssertReturn(hMmio2 != 0, NULL);
     1302    hMmio2--;
     1303
     1304    /* Must check the first one for PGMREGMMIO2RANGE_F_FIRST_CHUNK. */
     1305    AssertReturn(hMmio2 < RT_ELEMENTS(pVM->pgm.s.apMmio2RangesR3), NULL);
     1306    PPGMREGMMIO2RANGE pCur = pVM->pgm.s.CTX_SUFF(apMmio2Ranges)[hMmio2];
     1307    AssertReturn(pCur, NULL);
     1308    AssertReturn(pCur->fFlags & PGMREGMMIO2RANGE_F_FIRST_CHUNK, NULL);
     1309
     1310    /* Loop thru the sub-ranges till we find the one covering offMmio2. */
     1311    for (;;)
     1312    {
     1313        AssertReturn(pCur->fFlags & PGMREGMMIO2RANGE_F_MMIO2, NULL);
     1314#ifdef IN_RING3
     1315        AssertReturn(pCur->pDevInsR3 == pDevIns, NULL);
     1316#else
     1317        AssertReturn(pCur->pDevInsR3 == pDevIns->pDevInsForR3, NULL);
     1318#endif
     1319
     1320        /* Does it match the offset? */
     1321        if (offMmio2Page < pCur->cbReal)
     1322            return &pCur->RamRange.aPages[offMmio2Page >> PAGE_SHIFT];
     1323
     1324        /* Advance if we can. */
     1325        AssertReturn(!(pCur->fFlags & PGMREGMMIO2RANGE_F_LAST_CHUNK), NULL);
     1326        offMmio2Page -= pCur->cbReal;
     1327        hMmio2++;
     1328        AssertReturn(hMmio2 < RT_ELEMENTS(pVM->pgm.s.apMmio2RangesR3), NULL);
     1329        pCur = pVM->pgm.s.CTX_SUFF(apMmio2Ranges)[hMmio2];
     1330        AssertReturn(pCur, NULL);
     1331    }
     1332}
     1333
     1334/**
    12851335 * Replaces an MMIO page with an MMIO2 page.
    12861336 *
     
    13091359 *                              start and end pages.
    13101360 * @param   GCPhysPage          The physical address of the page to turn off
    1311  *                              access monitoring for.
     1361 *                              access monitoring for and replace with the MMIO2
     1362 *                              page.
    13121363 * @param   GCPhysPageRemap     The physical address of the MMIO2 page that
    13131364 *                              serves as backing memory.
     
    13221373 *
    13231374 */
    1324 VMMDECL(int)  PGMHandlerPhysicalPageAlias(PVMCC pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysPage, RTGCPHYS GCPhysPageRemap)
    1325 {
    1326 ///    Assert(!IOMIsLockOwner(pVM)); /* We mustn't own any other locks when calling this */
     1375VMMDECL(int)  PGMHandlerPhysicalPageAliasMmio2(PVMCC pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysPage,
     1376                                               PPDMDEVINS pDevIns, PGMMMIO2HANDLE hMmio2, RTGCPHYS offMMio2PageRemap)
     1377{
    13271378    pgmLock(pVM);
     1379
     1380    /*
     1381     * Resolve the MMIO2 reference.
     1382     */
     1383    PPGMPAGE pPageRemap = pgmPhysResolveMmio2PageLocked(pVM, pDevIns, hMmio2, offMMio2PageRemap);
     1384    if (RT_LIKELY(pPageRemap))
     1385        AssertMsgReturnStmt(PGM_PAGE_GET_TYPE(pPageRemap) == PGMPAGETYPE_MMIO2,
     1386                            ("hMmio2=%RU64 offMMio2PageRemap=%RGp %R[pgmpage]\n", hMmio2, offMMio2PageRemap, pPageRemap),
     1387                            pgmUnlock(pVM), VERR_PGM_PHYS_NOT_MMIO2);
     1388    else
     1389    {
     1390        pgmUnlock(pVM);
     1391        return VERR_OUT_OF_RANGE;
     1392    }
    13281393
    13291394    /*
     
    13421407
    13431408            /*
    1344              * Get and validate the two pages.
     1409             * Validate the page.
    13451410             */
    1346             PPGMPAGE pPageRemap;
    1347             int rc = pgmPhysGetPageEx(pVM, GCPhysPageRemap, &pPageRemap);
    1348             AssertReturnStmt(RT_SUCCESS_NP(rc), pgmUnlock(pVM), rc);
    1349             AssertMsgReturnStmt(PGM_PAGE_GET_TYPE(pPageRemap) == PGMPAGETYPE_MMIO2,
    1350                             ("GCPhysPageRemap=%RGp %R[pgmpage]\n", GCPhysPageRemap, pPageRemap),
    1351                             pgmUnlock(pVM), VERR_PGM_PHYS_NOT_MMIO2);
    1352 
    13531411            PPGMPAGE pPage;
    1354             rc = pgmPhysGetPageEx(pVM, GCPhysPage, &pPage);
     1412            int rc = pgmPhysGetPageEx(pVM, GCPhysPage, &pPage);
    13551413            AssertReturnStmt(RT_SUCCESS_NP(rc), pgmUnlock(pVM), rc);
    13561414            if (PGM_PAGE_GET_TYPE(pPage) != PGMPAGETYPE_MMIO)
     
    13691427                 * to an MMIO/ZERO page before doing the new mapping.
    13701428                 */
    1371                 Log(("PGMHandlerPhysicalPageAlias: GCPhysPage=%RGp (%R[pgmpage]; %RHp -> %RHp\n",
     1429                Log(("PGMHandlerPhysicalPageAliasMmio2: GCPhysPage=%RGp (%R[pgmpage]; %RHp -> %RHp\n",
    13721430                     GCPhysPage, pPage, PGM_PAGE_GET_HCPHYS(pPage), PGM_PAGE_GET_HCPHYS(pPageRemap)));
    13731431                pgmHandlerPhysicalResetAliasedPage(pVM, pPage, GCPhysPage, false /*fDoAccounting*/);
     
    13801438             * This page now serves as an alias for the backing memory specified.
    13811439             */
    1382             LogFlow(("PGMHandlerPhysicalPageAlias: %RGp (%R[pgmpage]) alias for %RGp (%R[pgmpage])\n",
    1383                      GCPhysPage, pPage, GCPhysPageRemap, pPageRemap ));
     1440            LogFlow(("PGMHandlerPhysicalPageAliasMmio2: %RGp (%R[pgmpage]) alias for %RU64/%RGp (%R[pgmpage])\n",
     1441                     GCPhysPage, pPage, hMmio2, offMMio2PageRemap, pPageRemap ));
    13841442            PGM_PAGE_SET_HCPHYS(pVM, pPage, PGM_PAGE_GET_HCPHYS(pPageRemap));
    13851443            PGM_PAGE_SET_TYPE(pVM, pPage, PGMPAGETYPE_MMIO2_ALIAS_MMIO);
     
    14021460                PGM_PAGE_SET_NEM_STATE(pPage, u2State);
    14031461            }
    1404             LogFlow(("PGMHandlerPhysicalPageAlias: => %R[pgmpage]\n", pPage));
     1462            LogFlow(("PGMHandlerPhysicalPageAliasMmio2: => %R[pgmpage]\n", pPage));
    14051463            pgmUnlock(pVM);
    14061464            return VINF_SUCCESS;
     
    14221480 * Replaces an MMIO page with an arbitrary HC page in the shadow page tables.
    14231481 *
    1424  * This differs from PGMHandlerPhysicalPageAlias in that the page doesn't need
    1425  * to be a known MMIO2 page and that only shadow paging may access the page.
    1426  * The latter distinction is important because the only use for this feature is
    1427  * for mapping the special APIC access page that VT-x uses to detect APIC MMIO
    1428  * operations, the page is shared between all guest CPUs and actually not
    1429  * written to. At least at the moment.
     1482 * This differs from PGMHandlerPhysicalPageAliasMmio2 in that the page doesn't
     1483 * need to be a known MMIO2 page and that only shadow paging may access the
     1484 * page. The latter distinction is important because the only use for this
     1485 * feature is for mapping the special APIC access page that VT-x uses to detect
     1486 * APIC MMIO operations, the page is shared between all guest CPUs and actually
     1487 * not written to. At least at the moment.
    14301488 *
    14311489 * The caller must do required page table modifications. You can get away
     
    14901548             * specified as far as shadow paging is concerned.
    14911549             */
    1492             LogFlow(("PGMHandlerPhysicalPageAlias: %RGp (%R[pgmpage]) alias for %RHp\n",
     1550            LogFlow(("PGMHandlerPhysicalPageAliasHC: %RGp (%R[pgmpage]) alias for %RHp\n",
    14931551                     GCPhysPage, pPage, HCPhysPageRemap));
    14941552            PGM_PAGE_SET_HCPHYS(pVM, pPage, HCPhysPageRemap);
  • trunk/src/VBox/VMM/VMMR0/VMMR0.def

    r80531 r82094  
    3939    PDMR0DeviceRegisterModule
    4040    PDMR0DeviceDeregisterModule
    41     IOMMMIOResetRegion
    42     IOMMMIOMapMMIO2Page
     41    IOMMmioResetRegion
     42    IOMMmioMapMmio2Page
    4343    RTLogDefaultInstance
    4444    RTLogDefaultInstanceEx
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