PGMR0SharedPage.cpp revision 0c437bb10c61b229407a7517efde04dfe3b1e4a1
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * PGM - Page Manager and Monitor, Page Sharing, Ring-0.
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * Copyright (C) 2010 Oracle Corporation
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * available from http://www.virtualbox.org. This file is free software;
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * you can redistribute it and/or modify it under the terms of the GNU
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * General Public License (GPL) as published by the Free Software
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync/*******************************************************************************
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync* Header Files *
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync*******************************************************************************/
54d2d2606d7c83a456819cd038a73e0f9a600ca4vboxsync * Check a registered module for shared page changes
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * @returns The following VBox status codes.
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * @param pVM The VM handle.
54d2d2606d7c83a456819cd038a73e0f9a600ca4vboxsync * @param pGVM Pointer to the GVM instance data.
54d2d2606d7c83a456819cd038a73e0f9a600ca4vboxsync * @param idCpu VCPU id
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * @param pModule Module description
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync * @param cRegions Number of regions
54d2d2606d7c83a456819cd038a73e0f9a600ca4vboxsync * @param pRegions Region array
54d2d2606d7c83a456819cd038a73e0f9a600ca4vboxsyncVMMR0DECL(int) PGMR0SharedModuleCheck(PVM pVM, PGVM pGVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, uint32_t cRegions, PGMMSHAREDREGIONDESC pRegions)
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync bool fFlushTLBs = false;
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync Log(("PGMR0SharedModuleCheck: check %s %s base=%RGv size=%x\n", pModule->szName, pModule->szVersion, pModule->Core.Key, pModule->cbModule));
21ed663b2593e86addd983bf645b49774cfb2e68vboxsync Assert(PGMIsLockOwner(pVM)); /* This cannot fail as we grab the lock in pgmR3SharedModuleRegRendezvous before calling into ring-0. */
unsigned idxPage = 0;
while (cbRegion)
if ( pPage
Log(("PGMR0SharedModuleCheck: shared page gc virt=%RGv phys %RGp host %RHp->%RHp\n", pRegions[idxRegion].GCRegionAddr + idxPage * PAGE_SIZE, PageDesc.GCPhys, PGM_PAGE_GET_HCPHYS(pPage), PageDesc.HCPhys));
bool fFlush = false;
Assert(rc == VINF_SUCCESS || (VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3) && (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL)));
idxPage++;
if (fFlushTLBs)
return rc;