VirtualBox

Changeset 93944 in vbox for trunk


Ignore:
Timestamp:
Feb 24, 2022 9:15:14 PM (3 years ago)
Author:
vboxsync
Message:

Devices: Must not use PAGE_SIZE, PAGE_SHIFT, PAGE_OFFSET_MASK, PAGE_ADDRESS or PHYS_PAGE_ADDRESS here either. bugref:9898

Location:
trunk/src/VBox/Devices
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/.scm-settings

    r93115 r93944  
    1818/*.h: --guard-relative-to-dir .
    1919/Graphics/vmsvga_glext/*.h|/Graphics/vmsvga/*.h: --guard-relative-to-dir ''
     20/*.h: --only-guest-host-page
    2021
     22# Same as for the VMM, careful with page stuff.
     23/*.h:   --only-guest-host-page --no-ASMMemPage-use
     24/*.cpp: --only-guest-host-page --no-ASMMemPage-use
     25/*.m:   --only-guest-host-page --no-ASMMemPage-use
     26
     27# This defines it's own PAGE_XXX macros.
     28/PC/ipxe/src/include/ipxe/virtio-ring.h: --no-page-restrictions
  • trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp

    r93115 r93944  
    159159    /* DrvAudioHlpClearBuf: */
    160160    uint8_t *pbPage;
    161     int rc = RTTestGuardedAlloc(hTest, PAGE_SIZE, 0, false /*fHead*/, (void **)&pbPage);
     161    int rc = RTTestGuardedAlloc(hTest, HOST_PAGE_SIZE, 0, false /*fHead*/, (void **)&pbPage);
    162162    RTTESTI_CHECK_RC_OK_RETV(rc);
    163163
    164     memset(pbPage, 0x42, PAGE_SIZE);
    165     PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, PAGE_SIZE, PAGE_SIZE / 4);
    166     RTTESTI_CHECK(ASMMemIsZero(pbPage, PAGE_SIZE));
    167 
    168     memset(pbPage, 0x42, PAGE_SIZE);
    169     PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, PAGE_SIZE, PAGE_SIZE / 4);
    170     for (uint32_t off = 0; off < PAGE_SIZE; off += 2)
     164    memset(pbPage, 0x42, HOST_PAGE_SIZE);
     165    PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE / 4);
     166    RTTESTI_CHECK(ASMMemIsZero(pbPage, HOST_PAGE_SIZE));
     167
     168    memset(pbPage, 0x42, HOST_PAGE_SIZE);
     169    PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE / 4);
     170    for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 2)
    171171        RTTESTI_CHECK_MSG(pbPage[off] == 0 && pbPage[off + 1] == 0x80, ("off=%#x: %#x %x\n", off, pbPage[off], pbPage[off + 1]));
    172172
    173     memset(pbPage, 0x42, PAGE_SIZE);
    174     PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, PAGE_SIZE, PAGE_SIZE / 8);
    175     for (uint32_t off = 0; off < PAGE_SIZE; off += 4)
     173    memset(pbPage, 0x42, HOST_PAGE_SIZE);
     174    PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE / 8);
     175    for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 4)
    176176        RTTESTI_CHECK(pbPage[off] == 0 && pbPage[off + 1] == 0 && pbPage[off + 2] == 0 && pbPage[off + 3] == 0x80);
    177177
    178178
    179179    RTTestDisableAssertions(hTest);
    180     memset(pbPage, 0x42, PAGE_SIZE);
    181     PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, PAGE_SIZE, PAGE_SIZE); /* should adjust down the frame count. */
    182     RTTESTI_CHECK(ASMMemIsZero(pbPage, PAGE_SIZE));
    183 
    184     memset(pbPage, 0x42, PAGE_SIZE);
    185     PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, PAGE_SIZE, PAGE_SIZE); /* should adjust down the frame count. */
    186     for (uint32_t off = 0; off < PAGE_SIZE; off += 2)
     180    memset(pbPage, 0x42, HOST_PAGE_SIZE);
     181    PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE); /* should adjust down the frame count. */
     182    RTTESTI_CHECK(ASMMemIsZero(pbPage, HOST_PAGE_SIZE));
     183
     184    memset(pbPage, 0x42, HOST_PAGE_SIZE);
     185    PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE); /* should adjust down the frame count. */
     186    for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 2)
    187187        RTTESTI_CHECK_MSG(pbPage[off] == 0 && pbPage[off + 1] == 0x80, ("off=%#x: %#x %x\n", off, pbPage[off], pbPage[off + 1]));
    188188
    189     memset(pbPage, 0x42, PAGE_SIZE);
    190     PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, PAGE_SIZE, PAGE_SIZE); /* should adjust down the frame count. */
    191     for (uint32_t off = 0; off < PAGE_SIZE; off += 4)
     189    memset(pbPage, 0x42, HOST_PAGE_SIZE);
     190    PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE); /* should adjust down the frame count. */
     191    for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 4)
    192192        RTTESTI_CHECK(pbPage[off] == 0 && pbPage[off + 1] == 0 && pbPage[off + 2] == 0 && pbPage[off + 3] == 0x80);
    193193    RTTestRestoreAssertions(hTest);
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r93115 r93944  
    956956     * Re-shadow the Firmware Volume and make it RAM/RAM.
    957957     */
    958     uint32_t    cPages = RT_ALIGN_64(pThisCC->cbEfiRom, PAGE_SIZE) >> PAGE_SHIFT;
     958    uint32_t    cPages = RT_ALIGN_64(pThisCC->cbEfiRom, GUEST_PAGE_SIZE) >> GUEST_PAGE_SHIFT;
    959959    RTGCPHYS    GCPhys = pThisCC->GCLoadAddress;
    960960    while (cPages > 0)
    961961    {
    962         uint8_t abPage[PAGE_SIZE];
     962        uint8_t abPage[GUEST_PAGE_SIZE];
    963963
    964964        /* Read the (original) ROM page and write it back to the RAM page. */
    965         int rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, PAGE_SIZE, PGMROMPROT_READ_ROM_WRITE_RAM);
     965        int rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, GUEST_PAGE_SIZE, PGMROMPROT_READ_ROM_WRITE_RAM);
    966966        AssertLogRelRC(rc);
    967967
    968         rc = PDMDevHlpPhysRead(pDevIns, GCPhys, abPage, PAGE_SIZE);
     968        rc = PDMDevHlpPhysRead(pDevIns, GCPhys, abPage, GUEST_PAGE_SIZE);
    969969        AssertLogRelRC(rc);
    970970        if (RT_FAILURE(rc))
    971971            memset(abPage, 0xcc, sizeof(abPage));
    972972
    973         rc = PDMDevHlpPhysWrite(pDevIns, GCPhys, abPage, PAGE_SIZE);
     973        rc = PDMDevHlpPhysWrite(pDevIns, GCPhys, abPage, GUEST_PAGE_SIZE);
    974974        AssertLogRelRC(rc);
    975975
    976976        /* Switch to the RAM/RAM mode. */
    977         rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, PAGE_SIZE, PGMROMPROT_READ_RAM_WRITE_RAM);
     977        rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, GUEST_PAGE_SIZE, PGMROMPROT_READ_RAM_WRITE_RAM);
    978978        AssertLogRelRC(rc);
    979979
    980980        /* Advance */
    981         GCPhys += PAGE_SIZE;
     981        GCPhys += GUEST_PAGE_SIZE;
    982982        cPages--;
    983983    }
     
    11531153                          VERR_INVALID_PARAMETER);
    11541154
    1155     AssertLogRelMsgReturn(!(pThisCC->cbEfiRom & PAGE_OFFSET_MASK), ("%RX64\n", pThisCC->cbEfiRom), VERR_INVALID_PARAMETER);
     1155    AssertLogRelMsgReturn(!(pThisCC->cbEfiRom & GUEST_PAGE_OFFSET_MASK), ("%RX64\n", pThisCC->cbEfiRom), VERR_INVALID_PARAMETER);
    11561156
    11571157    LogRel(("Found EFI FW Volume, %u bytes (%u %u-byte blocks)\n", pFwVolHdr->FvLength, pFwVolHdr->BlockMap[0].NumBlocks, pFwVolHdr->BlockMap[0].Length));
     
    11651165    pThisCC->offEfiRom   = pFwVolHdr->FvLength;
    11661166    pThisCC->cbNvram     = pFwVolHdr->FvLength;
    1167     pThisCC->GCPhysNvram = UINT32_C(0xfffff000) - pThisCC->cbEfiRom + PAGE_SIZE;
     1167    pThisCC->GCPhysNvram = UINT32_C(0xfffff000) - pThisCC->cbEfiRom + GUEST_PAGE_SIZE;
    11681168    pThisCC->cbEfiRom   -= pThisCC->cbNvram;
    11691169
     
    12841284
    12851285    uint32_t const  cbChunk = pThisCC->cbNvram + pThisCC->cbEfiRom >= _2M ? _512K
    1286                             : (uint32_t)RT_ALIGN_64((pThisCC->cbNvram + pThisCC->cbEfiRom) / 4, PAGE_SIZE);
     1286                            : (uint32_t)RT_ALIGN_64((pThisCC->cbNvram + pThisCC->cbEfiRom) / 4, GUEST_PAGE_SIZE);
    12871287    uint32_t        cbLeft  = pThisCC->cbEfiRom;           /* ASSUMES NVRAM comes first! */
    12881288    uint32_t        off     = pThisCC->offEfiRom + cbLeft; /* ASSUMES NVRAM comes first! */
     
    13281328
    13291329#else
    1330     RTGCPHYS cbQuart = RT_ALIGN_64(pThisCC->cbEfiRom / 4, PAGE_SIZE);
     1330    RTGCPHYS cbQuart = RT_ALIGN_64(pThisCC->cbEfiRom / 4, GUEST_PAGE_SIZE);
    13311331    rc = PDMDevHlpROMRegister(pDevIns,
    13321332                              pThisCC->GCLoadAddress,
  • trunk/src/VBox/Devices/EFI/DevSmc.cpp

    r93115 r93944  
    3636# include <iprt/once.h>
    3737#endif
    38 #if defined(RT_OS_DARWIN) && defined(IN_RING3) && !defined(VBOX_DEVICE_STRUCT_TESTCASE) /* drags in bad PAGE_SIZE */
     38#if defined(RT_OS_DARWIN) && defined(IN_RING3) && !defined(VBOX_DEVICE_STRUCT_TESTCASE) /* drags in bad page size define */
    3939# include "IOKit/IOKitLib.h"
    4040#endif
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp

    r93636 r93944  
    393393            {
    394394                if (   GCPhys >= pGbo->paDescriptors[j].GCPhys
    395                     && GCPhys < pGbo->paDescriptors[j].GCPhys + pGbo->paDescriptors[j].cPages * PAGE_SIZE)
     395                    && GCPhys < pGbo->paDescriptors[j].GCPhys + pGbo->paDescriptors[j].cPages * GUEST_PAGE_SIZE)
    396396                {
    397397                    switch (i)
     
    595595        for (uint32_t i = 0; i < pGbo->cDescriptors; ++i)
    596596        {
    597             rc = PDMDevHlpPGMHandlerPhysicalRegister(pSvgaR3State->pDevIns, pGbo->paDescriptors[i].GCPhys,
    598                                                      pGbo->paDescriptors[i].GCPhys + pGbo->paDescriptors[i].cPages * PAGE_SIZE - 1,
     597            rc = PDMDevHlpPGMHandlerPhysicalRegister(pSvgaR3State->pDevIns,
     598                                                     pGbo->paDescriptors[i].GCPhys,
     599                                                       pGbo->paDescriptors[i].GCPhys
     600                                                     + pGbo->paDescriptors[i].cPages * GUEST_PAGE_SIZE - 1,
    599601                                                     pSvgaR3State->hGboAccessHandlerType, "VMSVGA GBO");
    600602            AssertRC(rc);
     
    69486950            GCPhys = (paPages64[0] << X86_PAGE_SHIFT) & UINT64_C(0x00000FFFFFFFFFFF); /* Seeing rubbish in the top bits with certain linux guests. */
    69496951        else
    6950             GCPhys = (RTGCPHYS)paPages32[0] << PAGE_SHIFT;
     6952            GCPhys = (RTGCPHYS)paPages32[0] << GUEST_PAGE_SHIFT;
    69516953        paDescs[0].GCPhys    = GCPhys;
    69526954        paDescs[0].numPages  = 1;
     
    72187220
    72197221        /* Find the right descriptor */
    7220         while (offDesc + paDesc[iDesc].numPages * PAGE_SIZE <= offGmrCurrent)
     7222        while (offDesc + paDesc[iDesc].numPages * GUEST_PAGE_SIZE <= offGmrCurrent)
    72217223        {
    7222             offDesc += paDesc[iDesc].numPages * PAGE_SIZE;
     7224            offDesc += paDesc[iDesc].numPages * GUEST_PAGE_SIZE;
    72237225            AssertReturn(offDesc < pGMR->cbTotal, VERR_INTERNAL_ERROR); /* overflow protection */
    72247226            ++iDesc;
     
    72307232            uint32_t cbToCopy;
    72317233
    7232             if (offGmrCurrent + cbCurrentWidth <= offDesc + paDesc[iDesc].numPages * PAGE_SIZE)
    7233             {
     7234            if (offGmrCurrent + cbCurrentWidth <= offDesc + paDesc[iDesc].numPages * GUEST_PAGE_SIZE)
    72347235                cbToCopy = cbCurrentWidth;
    7235             }
    72367236            else
    72377237            {
    7238                 cbToCopy = (offDesc + paDesc[iDesc].numPages * PAGE_SIZE - offGmrCurrent);
     7238                cbToCopy = (offDesc + paDesc[iDesc].numPages * GUEST_PAGE_SIZE - offGmrCurrent);
    72397239                AssertReturn(cbToCopy <= cbCurrentWidth, VERR_INVALID_PARAMETER);
    72407240            }
     
    72627262            if (cbCurrentWidth)
    72637263            {
    7264                 offDesc += paDesc[iDesc].numPages * PAGE_SIZE;
     7264                offDesc += paDesc[iDesc].numPages * GUEST_PAGE_SIZE;
    72657265                AssertReturn(offDesc < pGMR->cbTotal, VERR_INTERNAL_ERROR);
    72667266                ++iDesc;
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp

    r93650 r93944  
    21022102
    21032103            /* Just undefine the GMR? */
    2104             RTGCPHYS GCPhys = (RTGCPHYS)u32 << PAGE_SHIFT;
     2104            RTGCPHYS GCPhys = (RTGCPHYS)u32 << GUEST_PAGE_SHIFT;
    21052105            if (GCPhys == 0)
    21062106            {
     
    21172117            uint32_t                cLoops      = 0;
    21182118            RTGCPHYS                GCPhysBase  = GCPhys;
    2119             while (PHYS_PAGE_ADDRESS(GCPhys) == PHYS_PAGE_ADDRESS(GCPhysBase))
     2119            while ((GCPhys >> GUEST_PAGE_SHIFT) == (GCPhysBase >> GUEST_PAGE_SHIFT))
    21202120            {
    21212121                /* Read descriptor. */
     
    21372137                    }
    21382138
    2139                     paDescs[iDesc].GCPhys     = (RTGCPHYS)desc.ppn << PAGE_SHIFT;
     2139                    paDescs[iDesc].GCPhys     = (RTGCPHYS)desc.ppn << GUEST_PAGE_SHIFT;
    21402140                    paDescs[iDesc++].numPages = desc.numPages;
    21412141
     
    21462146                    break;  /* terminator */
    21472147                else /* Pointer to the next physical page of descriptors. */
    2148                     GCPhys = GCPhysBase = (RTGCPHYS)desc.ppn << PAGE_SHIFT;
     2148                    GCPhys = GCPhysBase = (RTGCPHYS)desc.ppn << GUEST_PAGE_SHIFT;
    21492149
    21502150                cLoops++;
     
    21592159                pSVGAState->paGMR[idGMR].numDescriptors = iDesc;
    21602160                pSVGAState->paGMR[idGMR].cMaxPages      = cPagesTotal;
    2161                 pSVGAState->paGMR[idGMR].cbTotal        = cPagesTotal * PAGE_SIZE;
    2162                 Assert((pSVGAState->paGMR[idGMR].cbTotal >> PAGE_SHIFT) == cPagesTotal);
     2161                pSVGAState->paGMR[idGMR].cbTotal        = cPagesTotal * GUEST_PAGE_SIZE;
     2162                Assert((pSVGAState->paGMR[idGMR].cbTotal >> GUEST_PAGE_SHIFT) == cPagesTotal);
    21632163                Log(("Defined new gmr %x numDescriptors=%d cbTotal=%x (%#x pages)\n",
    21642164                     idGMR, iDesc, pSVGAState->paGMR[idGMR].cbTotal, cPagesTotal));
     
    28342834            {
    28352835                if (    GCPhys >= pGMR->paDesc[j].GCPhys
    2836                     &&  GCPhys < pGMR->paDesc[j].GCPhys + pGMR->paDesc[j].numPages * PAGE_SIZE)
     2836                    &&  GCPhys < pGMR->paDesc[j].GCPhys + pGMR->paDesc[j].numPages * GUEST_PAGE_SIZE)
    28372837                {
    28382838                    /*
     
    28612861    for (uint32_t i = 0; i < pGMR->numDescriptors; i++)
    28622862    {
    2863         rc = PDMDevHlpPGMHandlerPhysicalRegister(pDevIns,
    2864                                                  pGMR->paDesc[i].GCPhys, pGMR->paDesc[i].GCPhys + pGMR->paDesc[i].numPages * PAGE_SIZE - 1,
     2863        rc = PDMDevHlpPGMHandlerPhysicalRegister(pDevIns, pGMR->paDesc[i].GCPhys,
     2864                                                 pGMR->paDesc[i].GCPhys + pGMR->paDesc[i].numPages * GUEST_PAGE_SIZE - 1,
    28652865                                                 pThis->svga.hGmrAccessHandlerType, pThis, NIL_RTR0PTR, NIL_RTRCPTR, "VMSVGA GMR");
    28662866        AssertRC(rc);
     
    51475147            /* Hardware enabled; return real framebuffer size .*/
    51485148            cbFrameBuffer = (uint32_t)pThis->svga.uHeight * pThis->svga.cbScanline;
    5149             cbFrameBuffer = RT_ALIGN(cbFrameBuffer, PAGE_SIZE);
     5149            cbFrameBuffer = RT_ALIGN(cbFrameBuffer, GUEST_PAGE_SIZE);
    51505150        }
    51515151
     
    52005200                                                     GCPhysAddress + (pThis->svga.cbFIFO - 1),
    52015201#  else
    5202                                                      GCPhysAddress + PAGE_SIZE - 1,
     5202                                                     GCPhysAddress + GUEST_PAGE_SIZE - 1,
    52035203#  endif
    52045204                                                     pThis->svga.hFifoAccessHandlerType, pThis, NIL_RTR0PTR, NIL_RTRCPTR,
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r93840 r93944  
    309309{
    310310    AssertMsg(offVRAM < pThis->vram_size, ("offVRAM = %p, pThis->vram_size = %p\n", offVRAM, pThis->vram_size));
    311     ASMBitSet(&pThis->bmDirtyBitmap[0], offVRAM >> PAGE_SHIFT);
     311    ASMBitSet(&pThis->bmDirtyBitmap[0], offVRAM >> GUEST_PAGE_SHIFT);
    312312    pThis->fHasDirtyBits = true;
    313313}
     
    324324{
    325325    AssertMsg(offVRAM < pThis->vram_size, ("offVRAM = %p, pThis->vram_size = %p\n", offVRAM, pThis->vram_size));
    326     return ASMBitTest(&pThis->bmDirtyBitmap[0], offVRAM >> PAGE_SHIFT);
     326    return ASMBitTest(&pThis->bmDirtyBitmap[0], offVRAM >> GUEST_PAGE_SHIFT);
    327327}
    328328
     
    341341    Assert(offVRAMEnd <= pThis->vram_size);
    342342    Assert(offVRAMStart < offVRAMEnd);
    343     ASMBitClearRange(&pThis->bmDirtyBitmap[0], offVRAMStart >> PAGE_SHIFT, offVRAMEnd >> PAGE_SHIFT);
     343    ASMBitClearRange(&pThis->bmDirtyBitmap[0], offVRAMStart >> GUEST_PAGE_SHIFT, offVRAMEnd >> GUEST_PAGE_SHIFT);
    344344}
    345345
     
    350350static void vgaR3UpdateDirtyBitsAndResetMonitoring(PPDMDEVINS pDevIns, PVGASTATE pThis)
    351351{
    352     size_t const cbBitmap = RT_ALIGN_Z(RT_MIN(pThis->vram_size, VGA_VRAM_MAX), PAGE_SIZE * 64) / PAGE_SIZE / 8;
     352    size_t const cbBitmap = RT_ALIGN_Z(RT_MIN(pThis->vram_size, VGA_VRAM_MAX), GUEST_PAGE_SIZE * 64) / GUEST_PAGE_SIZE / 8;
    353353
    354354    /*
     
    366366    else
    367367    {
    368         uint64_t bmDirtyPages[VGA_VRAM_MAX / PAGE_SIZE / 64]; /* (256 MB VRAM -> 8KB bitmap) */
     368        uint64_t bmDirtyPages[VGA_VRAM_MAX / GUEST_PAGE_SIZE / 64]; /* (256 MB VRAM -> 8KB bitmap) */
    369369        int rc = PDMDevHlpMmio2QueryAndResetDirtyBitmap(pDevIns, pThis->hMmio2VRam, bmDirtyPages, cbBitmap);
    370370        if (RT_SUCCESS(rc))
     
    22872287    {
    22882288        uint32_t offSrcLine = offSrcStart + y * cbScanline;
    2289         uint32_t offPage0   = offSrcLine & ~PAGE_OFFSET_MASK;
    2290         uint32_t offPage1   = (offSrcLine + cbScanline - 1) & ~PAGE_OFFSET_MASK;
     2289        uint32_t offPage0   = offSrcLine & ~(uint32_t)GUEST_PAGE_OFFSET_MASK;
     2290        uint32_t offPage1   = (offSrcLine + cbScanline - 1) & ~(uint32_t)GUEST_PAGE_OFFSET_MASK;
    22912291        /** @todo r=klaus this assumes that a line is fully covered by 3 pages,
    22922292         * irrespective of alignment. Not guaranteed for high res modes, i.e.
     
    22942294         * between the first and last one. */
    22952295        bool     fUpdate    = fFullUpdate | vgaIsDirty(pThis, offPage0) | vgaIsDirty(pThis, offPage1);
    2296         if (offPage1 - offPage0 > PAGE_SIZE)
     2296        if (offPage1 - offPage0 > GUEST_PAGE_SIZE)
    22972297            /* if wide line, can use another page */
    2298             fUpdate |= vgaIsDirty(pThis, offPage0 + PAGE_SIZE);
     2298            fUpdate |= vgaIsDirty(pThis, offPage0 + GUEST_PAGE_SIZE);
    22992299        /* explicit invalidation for the hardware cursor */
    23002300        fUpdate |= (pThis->invalidated_y_table[y >> 5] >> (y & 0x1f)) & 1;
     
    23302330    /* reset modified pages */
    23312331    if (offPageMax != -1 && reset_dirty)
    2332         vgaR3ResetDirty(pThis, offPageMin, offPageMax + PAGE_SIZE);
     2332        vgaR3ResetDirty(pThis, offPageMin, offPageMax + GUEST_PAGE_SIZE);
    23332333    memset(pThis->invalidated_y_table, 0, ((cy + 31) >> 5) * 4);
    23342334
     
    24862486        }
    24872487        addr &= pThis->vga_addr_mask;
    2488         page0 = addr & ~PAGE_OFFSET_MASK;
    2489         page1 = (addr + bwidth - 1) & ~PAGE_OFFSET_MASK;
     2488        page0 = addr & ~(uint32_t)GUEST_PAGE_OFFSET_MASK;
     2489        page1 = (addr + bwidth - 1) & ~(uint32_t)GUEST_PAGE_OFFSET_MASK;
    24902490        /** @todo r=klaus this assumes that a line is fully covered by 3 pages,
    24912491         * irrespective of alignment. Not guaranteed for high res modes, i.e.
     
    24932493         * between the first and last one. */
    24942494        bool update = full_update | vgaIsDirty(pThis, page0) | vgaIsDirty(pThis, page1);
    2495         if (page1 - page0 > PAGE_SIZE) {
     2495        if (page1 - page0 > GUEST_PAGE_SIZE) {
    24962496            /* if wide line, can use another page */
    2497             update |= vgaIsDirty(pThis, page0 + PAGE_SIZE);
     2497            update |= vgaIsDirty(pThis, page0 + GUEST_PAGE_SIZE);
    24982498        }
    24992499        /* explicit invalidation for the hardware cursor */
     
    25412541    /* reset modified pages */
    25422542    if (page_max != -1 && reset_dirty) {
    2543         vgaR3ResetDirty(pThis, page_min, page_max + PAGE_SIZE);
     2543        vgaR3ResetDirty(pThis, page_min, page_max + GUEST_PAGE_SIZE);
    25442544    }
    25452545    memset(pThis->invalidated_y_table, 0, ((height + 31) >> 5) * 4);
     
    25742574    if (reset_dirty && pThis->last_scr_height > 0)
    25752575    {
    2576         page_min = (pThis->start_addr * 4) & ~PAGE_OFFSET_MASK;
    2577         /* round up page_max by one page, as otherwise this can be -PAGE_SIZE,
     2576        page_min = (pThis->start_addr * 4) & ~(uint32_t)GUEST_PAGE_OFFSET_MASK;
     2577        /* round up page_max by one page, as otherwise this can be -GUEST_PAGE_SIZE,
    25782578         * which causes assertion trouble in vgaR3ResetDirty. */
    2579         page_max = (pThis->start_addr * 4 + pThis->line_offset * pThis->last_scr_height - 1 + PAGE_SIZE) & ~PAGE_OFFSET_MASK;
    2580         vgaR3ResetDirty(pThis, page_min, page_max + PAGE_SIZE);
     2579        page_max = (pThis->start_addr * 4 + pThis->line_offset * pThis->last_scr_height - 1 + GUEST_PAGE_SIZE)
     2580                 & ~(uint32_t)GUEST_PAGE_OFFSET_MASK;
     2581        vgaR3ResetDirty(pThis, page_min, page_max + GUEST_PAGE_SIZE);
    25812582    }
    25822583    if (pDrv->pbData == pThisCC->pbVRam) /* Do not clear the VRAM itself. */
     
    42104211                {
    42114212                    vgaR3MarkDirty(pThis, offDirty);
    4212                     offDirty += PAGE_SIZE;
     4213                    offDirty += GUEST_PAGE_SIZE;
    42134214                }
    42144215                break;
     
    67546755
    67556756    AssertReleaseMsg(cbVgaBiosBinary <= _64K && cbVgaBiosBinary >= 32*_1K, ("cbVgaBiosBinary=%#x\n", cbVgaBiosBinary));
    6756     AssertReleaseMsg(RT_ALIGN_Z(cbVgaBiosBinary, PAGE_SIZE) == cbVgaBiosBinary, ("cbVgaBiosBinary=%#x\n", cbVgaBiosBinary));
     6757    AssertReleaseMsg(RT_ALIGN_Z(cbVgaBiosBinary, GUEST_PAGE_SIZE) == cbVgaBiosBinary, ("cbVgaBiosBinary=%#x\n", cbVgaBiosBinary));
    67576758    /* Note! Because of old saved states we'll always register at least 36KB of ROM. */
    67586759    rc = PDMDevHlpROMRegister(pDevIns, 0x000c0000, RT_MAX(cbVgaBiosBinary, 36*_1K), pbVgaBiosBinary, cbVgaBiosBinary,
     
    73097310     */
    73107311# if defined(VBOX_WITH_VMSVGA) && !defined(IN_RC)
    7311     AssertCompile((RT_MAX(SVGA_FIFO_MIN, RT_MAX(SVGA_FIFO_PITCHLOCK, SVGA_FIFO_BUSY)) + 1) * sizeof(uint32_t) < PAGE_SIZE);
     7312    AssertCompile((RT_MAX(SVGA_FIFO_MIN, RT_MAX(SVGA_FIFO_PITCHLOCK, SVGA_FIFO_BUSY)) + 1) * sizeof(uint32_t) < GUEST_PAGE_SIZE);
    73127313    if (pThis->fVMSVGAEnabled)
    73137314    {
    7314         rc = PDMDevHlpMmio2SetUpContext(pDevIns, pThis->hMmio2VmSvgaFifo, 0 /* off */, PAGE_SIZE,
     7315        rc = PDMDevHlpMmio2SetUpContext(pDevIns, pThis->hMmio2VmSvgaFifo, 0 /* off */, GUEST_PAGE_SIZE,
    73157316                                        (void **)&pThisCC->svga.pau32FIFO);
    73167317        AssertLogRelMsgRCReturn(rc, ("PDMDevHlpMapMMIO2IntoR0(%#x,) -> %Rrc\n", pThis->svga.cbFIFO, rc), rc);
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r93840 r93944  
    351351    uint32_t                    cMilliesRefreshInterval;
    352352    /** Bitmap tracking dirty pages. */
    353     uint64_t                    bmDirtyBitmap[VGA_VRAM_MAX / PAGE_SIZE / 64];
     353    uint64_t                    bmDirtyBitmap[VGA_VRAM_MAX / GUEST_PAGE_SIZE / 64];
    354354
    355355    /** Flag indicating that there are dirty bits. This is used to optimize the handler resetting. */
  • trunk/src/VBox/Devices/Misc/DevVirtualKD.cpp

    r93115 r93944  
    7878} VIRTUALKD;
    7979
    80 #define VIRTUALKB_CMDBODY_SIZE          _256K           /**< Size of buffer pointed to by VIRTUALKB::pbCmdBody */
    81 #define VIRTUALKB_CMDBODY_PRE_FENCE     (PAGE_SIZE * 4) /**< Size of the eletrict fence before the command body. */
    82 #define VIRTUALKB_CMDBODY_POST_FENCE    (PAGE_SIZE * 8) /**< Size of the eletrict fence after the command body. */
     80#define VIRTUALKB_CMDBODY_SIZE          _256K                /**< Size of buffer pointed to by VIRTUALKB::pbCmdBody */
     81#define VIRTUALKB_CMDBODY_PRE_FENCE     (HOST_PAGE_SIZE * 4) /**< Size of the eletrict fence before the command body. */
     82#define VIRTUALKB_CMDBODY_POST_FENCE    (HOST_PAGE_SIZE * 8) /**< Size of the eletrict fence after the command body. */
    8383
    8484
     
    193193    {
    194194        if (pThis->fFencedCmdBody)
    195             RTMemPageFree((uint8_t *)pThis->pbCmdBody - RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, PAGE_SIZE),
    196                             RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE,  PAGE_SIZE)
    197                           + RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE,       PAGE_SIZE)
    198                           + RT_ALIGN_Z(VIRTUALKB_CMDBODY_POST_FENCE, PAGE_SIZE));
     195            RTMemPageFree((uint8_t *)pThis->pbCmdBody - RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, HOST_PAGE_SIZE),
     196                            RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE,  HOST_PAGE_SIZE)
     197                          + RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE,       HOST_PAGE_SIZE)
     198                          + RT_ALIGN_Z(VIRTUALKB_CMDBODY_POST_FENCE, HOST_PAGE_SIZE));
    199199        else
    200200            RTMemFree(pThis->pbCmdBody);
     
    246246            {
    247247                /* We allocate a fenced buffer for reasons of paranoia. */
    248                 uint8_t *pbCmdBody = (uint8_t *)RTMemPageAlloc(  RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE,  PAGE_SIZE)
    249                                                                + RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE,       PAGE_SIZE)
    250                                                                + RT_ALIGN_Z(VIRTUALKB_CMDBODY_POST_FENCE, PAGE_SIZE));
     248                uint8_t *pbCmdBody = (uint8_t *)RTMemPageAlloc(  RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE,  HOST_PAGE_SIZE)
     249                                                               + RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE,       HOST_PAGE_SIZE)
     250                                                               + RT_ALIGN_Z(VIRTUALKB_CMDBODY_POST_FENCE, HOST_PAGE_SIZE));
    251251                if (pbCmdBody)
    252252                {
    253                     rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, PAGE_SIZE), RTMEM_PROT_NONE);
    254                     pbCmdBody += RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, PAGE_SIZE);
     253                    rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, HOST_PAGE_SIZE), RTMEM_PROT_NONE);
     254                    pbCmdBody += RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, HOST_PAGE_SIZE);
    255255
    256256                    pThis->fFencedCmdBody = true;
    257257                    pThis->pbCmdBody = (char *)pbCmdBody;
    258                     rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, PAGE_SIZE), RTMEM_PROT_READ | RTMEM_PROT_WRITE);
     258                    rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, HOST_PAGE_SIZE),
     259                                      RTMEM_PROT_READ | RTMEM_PROT_WRITE);
    259260                    AssertLogRelRC(rc);
    260                     pbCmdBody += RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, PAGE_SIZE);
    261 
    262                     rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, PAGE_SIZE), RTMEM_PROT_NONE);
     261                    pbCmdBody += RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, HOST_PAGE_SIZE);
     262
     263                    rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, HOST_PAGE_SIZE),
     264                                      RTMEM_PROT_NONE);
    263265                    AssertLogRelRC(rc);
    264266                }
  • trunk/src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h

    r87289 r93944  
    4646#endif
    4747#else /* VBOX */
    48 # include <iprt/param.h>
     48# include <VBox/param.h>
    4949# include "misc.h"
    5050# include "ext.h"
     
    7676/*
    7777 * Constants related to network buffer management.
    78  * MCLBYTES must be no larger than PAGE_SIZE.
     78 * MCLBYTES must be no larger than HOST_PAGE_SIZE.
    7979 */
    8080# ifndef        MSIZE
     
    9191
    9292# if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    93 #  define       MJUMPAGESIZE    PAGE_SIZE       /* jumbo cluster 4k */
     93#  define       MJUMPAGESIZE    HOST_PAGE_SIZE  /* jumbo cluster 4k */
    9494# else
    9595#  define       MJUMPAGESIZE    (4 * 1024)      /* jumbo cluster 4k */
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r93115 r93944  
    10921092     * the chipset support for this we do it here (and in the constructor).
    10931093     */
    1094     uint32_t    cPages = RT_ALIGN_64(pThis->cbLanBoot, PAGE_SIZE) >> PAGE_SHIFT;
     1094    uint32_t    cPages = RT_ALIGN_64(pThis->cbLanBoot, GUEST_PAGE_SIZE) >> GUEST_PAGE_SHIFT;
    10951095    RTGCPHYS    GCPhys = VBOX_LANBOOT_SEG << 4;
    10961096    while (cPages > 0)
    10971097    {
    1098         uint8_t abPage[PAGE_SIZE];
     1098        uint8_t abPage[GUEST_PAGE_SIZE];
    10991099        int     rc;
    11001100
    11011101        /* Read the (original) ROM page and write it back to the RAM page. */
    1102         rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, PAGE_SIZE, PGMROMPROT_READ_ROM_WRITE_RAM);
     1102        rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, GUEST_PAGE_SIZE, PGMROMPROT_READ_ROM_WRITE_RAM);
    11031103        AssertLogRelRC(rc);
    11041104
    1105         rc = PDMDevHlpPhysRead(pDevIns, GCPhys, abPage, PAGE_SIZE);
     1105        rc = PDMDevHlpPhysRead(pDevIns, GCPhys, abPage, GUEST_PAGE_SIZE);
    11061106        AssertLogRelRC(rc);
    11071107        if (RT_FAILURE(rc))
    11081108            memset(abPage, 0xcc, sizeof(abPage));
    11091109
    1110         rc = PDMDevHlpPhysWrite(pDevIns, GCPhys, abPage, PAGE_SIZE);
     1110        rc = PDMDevHlpPhysWrite(pDevIns, GCPhys, abPage, GUEST_PAGE_SIZE);
    11111111        AssertLogRelRC(rc);
    11121112
    11131113        /* Switch to the RAM/RAM mode. */
    1114         rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, PAGE_SIZE, PGMROMPROT_READ_RAM_WRITE_RAM);
     1114        rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, GUEST_PAGE_SIZE, PGMROMPROT_READ_RAM_WRITE_RAM);
    11151115        AssertLogRelRC(rc);
    11161116
    11171117        /* Advance */
    1118         GCPhys += PAGE_SIZE;
     1118        GCPhys += GUEST_PAGE_SIZE;
    11191119        cPages--;
    11201120    }
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r93115 r93944  
    59215921    /*
    59225922     * The non-fake PCI I/O regions:
    5923      * Note! The 4352 byte MMIO region will be rounded up to PAGE_SIZE.
     5923     * Note! The 4352 byte MMIO region will be rounded up to GUEST_PAGE_SIZE.
    59245924     */
    59255925    rc = PDMDevHlpPCIIORegionCreateIo(pDevIns, 4 /*iPciRegion*/, 0x10 /*cPorts*/,
  • trunk/src/VBox/Devices/USB/DevOHCI.cpp

    r93914 r93944  
    243243    RTGCPHYS            GCPhysReadCacheAddr;
    244244    /** Copy of last read physical page. */
    245     uint8_t             abPhysReadCache[PAGE_SIZE];
     245    uint8_t             abPhysReadCache[GUEST_PAGE_SIZE];
    246246} OHCIPAGECACHE;
    247247typedef OHCIPAGECACHE *POHCIPAGECACHE;
     
    14391439static void ohciR3PhysReadCacheRead(PPDMDEVINS pDevIns, POHCIPAGECACHE pPageCache, RTGCPHYS GCPhys, void *pvBuf, size_t cbBuf)
    14401440{
    1441     const RTGCPHYS PageAddr = PAGE_ADDRESS(GCPhys);
    1442 
    1443     if (PageAddr == PAGE_ADDRESS(GCPhys + cbBuf))
     1441    const RTGCPHYS PageAddr = GCPhys & ~(RTGCPHYS)GUEST_PAGE_OFFSET_MASK;
     1442
     1443    if (PageAddr == ((GCPhys + cbBuf) & ~(RTGCPHYS)GUEST_PAGE_OFFSET_MASK))
    14441444    {
    14451445        if (PageAddr != pPageCache->GCPhysReadCacheAddr)
     
    14521452        }
    14531453
    1454         memcpy(pvBuf, &pPageCache->abPhysReadCache[GCPhys & PAGE_OFFSET_MASK], cbBuf);
     1454        memcpy(pvBuf, &pPageCache->abPhysReadCache[GCPhys & GUEST_PAGE_OFFSET_MASK], cbBuf);
    14551455#  ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
    14561456        ++g_PhysReadState.cCacheReads;
     
    14791479static void ohciR3PhysCacheUpdate(POHCIPAGECACHE pPageCache, RTGCPHYS GCPhys, const void *pvBuf, size_t cbBuf)
    14801480{
    1481     const RTGCPHYS GCPhysPage = PAGE_ADDRESS(GCPhys);
     1481    const RTGCPHYS GCPhysPage = GCPhys & ~(RTGCPHYS)GUEST_PAGE_OFFSET_MASK;
    14821482
    14831483    if (GCPhysPage == pPageCache->GCPhysReadCacheAddr)
    14841484    {
    1485         uint32_t offPage = GCPhys & PAGE_OFFSET_MASK;
    1486         memcpy(&pPageCache->abPhysReadCache[offPage], pvBuf, RT_MIN(PAGE_SIZE - offPage, cbBuf));
     1485        uint32_t offPage = GCPhys & GUEST_PAGE_OFFSET_MASK;
     1486        memcpy(&pPageCache->abPhysReadCache[offPage], pvBuf, RT_MIN(GUEST_PAGE_SIZE - offPage, cbBuf));
    14871487    }
    14881488}
  • trunk/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp

    r93217 r93944  
    9999    /** The buffers.
    100100     * The number of buffers here is decided by pvFrame begin allocated in
    101      * PAGE_SIZE chunks. The size of IOUSBLowLatencyIsocFrame is 16 bytes
    102      * and we require 8 of those per buffer. PAGE_SIZE / (16 * 8) = 32.
     101     * GUEST_PAGE_SIZE chunks. The size of IOUSBLowLatencyIsocFrame is 16 bytes
     102     * and we require 8 of those per buffer. GUEST_PAGE_SIZE / (16 * 8) = 32.
    103103     * @remarks  Don't allocate too many as it may temporarily halt the system if
    104104     *           some pool is low / exhausted. (Contiguous memory woes on mach.)
     
    457457    if (irc == kIOReturnSuccess)
    458458    {
    459         irc = (*pIf->ppIfI)->LowLatencyCreateBuffer(pIf->ppIfI, &pNew->pvFrames, PAGE_SIZE, kUSBLowLatencyFrameListBuffer);
     459        /** @todo GUEST_PAGE_SIZE or HOST_PAGE_SIZE or just 4K? */
     460        irc = (*pIf->ppIfI)->LowLatencyCreateBuffer(pIf->ppIfI, &pNew->pvFrames, GUEST_PAGE_SIZE, kUSBLowLatencyFrameListBuffer);
    460461        if ((irc == kIOReturnSuccess) != RT_VALID_PTR(pNew->pvFrames))
    461462        {
  • trunk/src/VBox/Devices/USB/testcase/tstOhciRegisterAccess.cpp

    r93115 r93944  
    454454            if (fDone)
    455455            {
    456                 for (int iWord = ((uintptr_t)uPtr.pv & PAGE_OFFSET_MASK) == 0; iWord < 3; iWord++)
     456                for (int iWord = (uPtr.u & HOST_PAGE_OFFSET_MASK) == 0; iWord < 3; iWord++)
    457457                {
    458458                    u32A = *uPtr.pu32;
     
    483483            if (fDone)
    484484            {
    485                 for (int iByte = ((uintptr_t)uPtr.pv & PAGE_OFFSET_MASK) == 0 ? 0 : -3; iByte < 4; iByte++)
     485                for (int iByte = (uPtr.u & HOST_PAGE_OFFSET_MASK) == 0 ? 0 : -3; iByte < 4; iByte++)
    486486                {
    487487                    u32A = *uPtr.pu32;
     
    549549     */
    550550    RTR0MEMOBJ hMemObj;
    551     int rc = RTR0MemObjEnterPhys(&hMemObj, HCPhysOHCI, PAGE_SIZE, RTMEM_CACHE_POLICY_MMIO);
     551    int rc = RTR0MemObjEnterPhys(&hMemObj, HCPhysOHCI, HOST_PAGE_SIZE, RTMEM_CACHE_POLICY_MMIO);
    552552    if (RT_FAILURE(rc))
    553553    {
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r93115 r93944  
    49844984     * can handle interrupt acknowledge requests more timely (vmmdevFastRequestIrqAck).
    49854985     */
    4986     rc = PDMDevHlpMmio2SetUpContext(pDevIns, pThis->hMmio2VMMDevRAM, 0, PAGE_SIZE, (void **)&pThisCC->CTX_SUFF(pVMMDevRAM));
     4986    rc = PDMDevHlpMmio2SetUpContext(pDevIns, pThis->hMmio2VMMDevRAM, 0, GUEST_PAGE_SIZE, (void **)&pThisCC->CTX_SUFF(pVMMDevRAM));
    49874987    AssertRCReturn(rc, rc);
    49884988
  • trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp

    r93931 r93944  
    681681    if (pPtr->cPages == 1)
    682682        return true;
    683     RTGCPHYS64 Phys = pPtr->paPages[0] + PAGE_SIZE;
     683    RTGCPHYS64 Phys = pPtr->paPages[0] + GUEST_PAGE_SIZE;
    684684    if (Phys != pPtr->paPages[1])
    685685        return false;
     
    689689        do
    690690        {
    691             Phys += PAGE_SIZE;
     691            Phys += GUEST_PAGE_SIZE;
    692692            if (Phys != pPtr->paPages[iPage])
    693693                return false;
     
    724724    for (uint32_t iPage = 0; iPage < pPtr->cPages && cbRemaining > 0; ++iPage)
    725725    {
    726         uint32_t cbToRead = PAGE_SIZE - offPage;
     726        uint32_t cbToRead = GUEST_PAGE_SIZE - offPage;
    727727        if (cbToRead > cbRemaining)
    728728            cbToRead = cbRemaining;
     
    763763    for (iPage = 0; iPage < pPtr->cPages && cbRemaining > 0; ++iPage)
    764764    {
    765         uint32_t cbToWrite = PAGE_SIZE - offPage;
     765        uint32_t cbToWrite = GUEST_PAGE_SIZE - offPage;
    766766        if (cbToWrite > cbRemaining)
    767767            cbToWrite = cbRemaining;
     
    10881088                ASSERT_GUEST_RETURN(cbData <= VMMDEV_MAX_HGCM_DATA_SIZE, VERR_INVALID_PARAMETER);
    10891089
    1090                 const uint32_t offFirstPage = cbData > 0 ? GCPtr & PAGE_OFFSET_MASK : 0;
    1091                 const uint32_t cPages       = cbData > 0 ? (offFirstPage + cbData + PAGE_SIZE - 1) / PAGE_SIZE : 0;
     1090                const uint32_t offFirstPage = cbData > 0 ? GCPtr & GUEST_PAGE_OFFSET_MASK : 0;
     1091                const uint32_t cPages       = cbData > 0 ? (offFirstPage + cbData + GUEST_PAGE_SIZE - 1) / GUEST_PAGE_SIZE : 0;
    10921092
    10931093                pGuestParm->u.ptr.cbData        = cbData;
     
    11241124
    11251125                        pGuestParm->u.ptr.paPages[iPage] = GCPhys;
    1126                         GCPtr += PAGE_SIZE;
     1126                        GCPtr += GUEST_PAGE_SIZE;
    11271127                    }
    11281128                }
     
    11691169                                        ("%#x\n", pPageListInfo->flags), VERR_INVALID_FLAGS);
    11701170                /* First page offset. */
    1171                 ASSERT_GUEST_MSG_RETURN(pPageListInfo->offFirstPage < PAGE_SIZE,
     1171                ASSERT_GUEST_MSG_RETURN(pPageListInfo->offFirstPage < GUEST_PAGE_SIZE,
    11721172                                        ("%#x\n", pPageListInfo->offFirstPage), VERR_INVALID_PARAMETER);
    11731173
     
    11771177                ASSERT_GUEST_MSG_RETURN(      pPageListInfo->cPages
    11781178                                           == (pGuestParm->enmType == VMMDevHGCMParmType_ContiguousPageList ? 1
    1179                                                : RT_ALIGN_32(pPageListInfo->offFirstPage + cbData, PAGE_SIZE) >> PAGE_SHIFT)
     1179                                               :    RT_ALIGN_32(pPageListInfo->offFirstPage + cbData, GUEST_PAGE_SIZE)
     1180                                                 >> GUEST_PAGE_SHIFT)
    11801181                                        || pGuestParm->enmType == VMMDevHGCMParmType_PageList,
    11811182                                        ("offFirstPage=%#x cbData=%#x cPages=%#x enmType=%d\n",
     
    11921193                {
    11931194                    /* Validate page offsets */
    1194                     ASSERT_GUEST_MSG_RETURN(   !(pPageListInfo->aPages[0] & PAGE_OFFSET_MASK)
    1195                                             || (pPageListInfo->aPages[0] & PAGE_OFFSET_MASK) == pPageListInfo->offFirstPage,
     1195                    ASSERT_GUEST_MSG_RETURN(   !(pPageListInfo->aPages[0] & GUEST_PAGE_OFFSET_MASK)
     1196                                            || (pPageListInfo->aPages[0] & GUEST_PAGE_OFFSET_MASK) == pPageListInfo->offFirstPage,
    11961197                                            ("%#RX64 offFirstPage=%#x\n", pPageListInfo->aPages[0], pPageListInfo->offFirstPage),
    11971198                                            VERR_INVALID_POINTER);
    11981199                    uint32_t const cPages = pPageListInfo->cPages;
    11991200                    for (uint32_t iPage = 1; iPage < cPages; iPage++)
    1200                         ASSERT_GUEST_MSG_RETURN(!(pPageListInfo->aPages[iPage] & PAGE_OFFSET_MASK),
     1201                        ASSERT_GUEST_MSG_RETURN(!(pPageListInfo->aPages[iPage] & GUEST_PAGE_OFFSET_MASK),
    12011202                                                ("[%#zx]=%#RX64\n", iPage, pPageListInfo->aPages[iPage]), VERR_INVALID_POINTER);
    12021203                    RT_UNTRUSTED_VALIDATED_FENCE();
  • trunk/src/VBox/Devices/VirtIO/Virtio.cpp

    r93115 r93944  
    4747static void vqueueInit(PVQUEUE pQueue, uint32_t uPageNumber)
    4848{
    49     pQueue->VRing.addrDescriptors = (uint64_t)uPageNumber << PAGE_SHIFT;
     49    pQueue->VRing.addrDescriptors = (uint64_t)uPageNumber << GUEST_PAGE_SHIFT;
    5050    pQueue->VRing.addrAvail       = pQueue->VRing.addrDescriptors + sizeof(VRINGDESC) * pQueue->VRing.uSize;
    5151    pQueue->VRing.addrUsed        = RT_ALIGN(pQueue->VRing.addrAvail + RT_UOFFSETOF_DYN(VRINGAVAIL, auRing[pQueue->VRing.uSize]),
    52                                              PAGE_SIZE); /* The used ring must start from the next page. */
     52                                             GUEST_PAGE_SIZE); /* The used ring must start from the next page. */
    5353    pQueue->uNextAvailIndex       = 0;
    5454    pQueue->uNextUsedIndex        = 0;
  • trunk/src/VBox/Devices/VirtIO/VirtioCore.cpp

    r93115 r93944  
    15971597    {
    15981598        PVIRTQUEUE pVirtQueue = &pVirtio->aVirtqueues[uVirtq];
    1599         *pu32 = pVirtQueue->GCPhysVirtqDesc >> PAGE_SHIFT;
     1599        *pu32 = pVirtQueue->GCPhysVirtqDesc >> GUEST_PAGE_SHIFT;
    16001600        Log(("%-23s: Guest read  uVirtqPfn .................... %#x\n",   __FUNCTION__, *pu32));
    16011601    }
  • trunk/src/VBox/Devices/testcase/tstDeviceR0.cpp

    r93115 r93944  
    4848
    4949
    50 /*********************************************************************************************************************************
    51 *   Defined Constants And Macros                                                                                                 *
    52 *********************************************************************************************************************************/
    53 
    54 
    55 /*********************************************************************************************************************************
    56 *   Structures and Typedefs                                                                                                      *
    57 *********************************************************************************************************************************/
    58 
    59 
    60 /*********************************************************************************************************************************
    61 *   Global Variables                                                                                                             *
    62 *********************************************************************************************************************************/
    63 
    64 
    65 /*********************************************************************************************************************************
    66 *   Internal Functions                                                                                                           *
    67 *********************************************************************************************************************************/
    6850
    6951/**
     
    8264    if (RT_LIKELY(pPdmDev))
    8365    {
    84         uint32_t const cbRing0     = RT_ALIGN_32(RT_UOFFSETOF(PDMDEVINSR0, achInstanceData) + pPdmDevR0->cbInstanceCC, PAGE_SIZE);
     66        uint32_t const cbRing0     = RT_ALIGN_32(RT_UOFFSETOF(PDMDEVINSR0, achInstanceData) + pPdmDevR0->cbInstanceCC,
     67                                                 HOST_PAGE_SIZE);
    8568        uint32_t const cbRing3     = RT_ALIGN_32(RT_UOFFSETOF(PDMDEVINSR3, achInstanceData) + pPdmDev->pReg->cbInstanceCC,
    86                                                  fRCEnabled ? PAGE_SIZE : 64);
     69                                                 fRCEnabled ? HOST_PAGE_SIZE : 64);
    8770        uint32_t const cbRC        = fRCEnabled ? 0
    8871                                   : RT_ALIGN_32(RT_UOFFSETOF(PDMDEVINSRC, achInstanceData) + pPdmDevR0->cbInstanceRC, 64);
     
    9376        uint32_t const cPciDevs    = RT_MIN(pPdmDev->pReg->cMaxPciDevices, 8);
    9477        uint32_t const cbPciDevs   = cbPciDev * cPciDevs;
    95         uint32_t const cbTotal     = RT_ALIGN_32(cbRing0 + cbRing3 + cbRC + cbShared + cbCritSect + cbPciDevs, PAGE_SIZE);
     78        uint32_t const cbTotal     = RT_ALIGN_32(cbRing0 + cbRing3 + cbRC + cbShared + cbCritSect + cbPciDevs, HOST_PAGE_SIZE);
    9679        AssertLogRelMsgReturn(cbTotal <= PDM_MAX_DEVICE_INSTANCE_SIZE,
    9780                              ("Instance of '%s' is too big: cbTotal=%u, max %u\n",
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp

    r93115 r93944  
    396396    GEN_CHECK_OFF(VGASTATE, au32DirtyBitmap);
    397397    GEN_CHECK_OFF(VGASTATE, au32DirtyBitmap[1]);
    398     GEN_CHECK_OFF(VGASTATE, au32DirtyBitmap[(VGA_VRAM_MAX / PAGE_SIZE / 32) - 1]);
     398    GEN_CHECK_OFF(VGASTATE, au32DirtyBitmap[(VGA_VRAM_MAX / GUEST_PAGE_SIZE / 32) - 1]);
    399399    GEN_CHECK_OFF(VGASTATE, fHasDirtyBits);
    400400    GEN_CHECK_OFF(VGASTATE, fLFBUpdated);
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