gmm.h revision e095310efd245e6d6dac0e28d920a4c82aa9888a
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * GMM - The Global Memory Manager. (VMM)
cce0c6096dee0c5353bb74431dc47b05f87a1c6dvboxsync * Copyright (C) 2007 Oracle Corporation
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * available from http://www.virtualbox.org. This file is free software;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * you can redistribute it and/or modify it under the terms of the GNU
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * General Public License (GPL) as published by the Free Software
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * The contents of this file may alternatively be used under the terms
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * of the Common Development and Distribution License Version 1.0
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VirtualBox OSE distribution, in which case the provisions of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * CDDL are applicable instead of those of the GPL.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * You may elect to license modified versions of this file under the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * terms and conditions of either the GPL or the CDDL or both.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#include <VBox/VMMDev.h> /* for VMMDEVSHAREDREGIONDESC */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @defgroup grp_gmm GMM - The Global Memory Manager
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @def IN_GMM_R0
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Used to indicate whether we're inside the same link module as the ring 0
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * part of the Global Memory Manager or not.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @def GMMR0DECL
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Ring 0 GMM export or import declaration.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param type The return type of the function declaration.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @def IN_GMM_R3
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Used to indicate whether we're inside the same link module as the ring 3
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * part of the Global Memory Manager or not.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @def GMMR3DECL
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Ring 3 GMM export or import declaration.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param type The return type of the function declaration.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** The chunk shift. (2^21 = 2 MB) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** The allocation chunk size. */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync/** The allocation chunk size in pages. */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync#define GMM_CHUNK_NUM_PAGES (1U << (GMM_CHUNK_SHIFT - PAGE_SHIFT))
b84a3f2aac9529d5c5840512b12d81bc62d0e665vboxsync/** The shift factor for converting a page id into a chunk id. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define GMM_CHUNKID_SHIFT (GMM_CHUNK_SHIFT - PAGE_SHIFT)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** The last valid Chunk ID value. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define GMM_CHUNKID_LAST (GMM_PAGEID_LAST >> GMM_CHUNKID_SHIFT)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** The last valid Page ID value.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * The current limit is 2^28 - 1, or almost 1TB if you like.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * The constraints are currently dictated by PGMPAGE. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Mask out the page index from the Page ID. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define GMM_PAGEID_IDX_MASK ((1U << GMM_CHUNKID_SHIFT) - 1)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** The NIL Chunk ID value. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** The NIL Page ID value. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#if 0 /* wrong - these are guest page pfns and not page ids! */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Special Page ID used by unassigned pages. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Special Page ID used by unsharable pages.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Like MMIO2, shadow and heap. This is for later, obviously. */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync/** The end of the valid Page IDs. This is the first special one. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @def GMM_GCPHYS_LAST
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * The last of the valid guest physical address as it applies to GMM pages.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This must reflect the constraints imposed by the RTGCPHYS type and
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * the guest page frame number used internally in GMMPAGE.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @note Note this corresponds to GMM_PAGE_PFN_LAST. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define GMM_GCPHYS_LAST UINT64_C(0x00000fffffff0000) /* 2^44 (16TB) - 0x10000 */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define GMM_GCPHYS_LAST UINT64_C(0x0000000fffff0000) /* 2^36 (64GB) - 0x10000 */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Over-commitment policy.
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync /** The usual invalid 0 value. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** No over-commitment, fully backed.
fb9af443dbf06990f4956d683286ddce29c4dca6vboxsync * The GMM guarantees that it will be able to allocate all of the
fb9af443dbf06990f4956d683286ddce29c4dca6vboxsync * guest RAM for a VM with OC policy. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** to-be-determined. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The end of the valid policy range. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The usual 32-bit hack. */
b84a3f2aac9529d5c5840512b12d81bc62d0e665vboxsync * VM / Memory priority.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The usual invalid 0 value. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * When ballooning, ask these VMs last.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * When running out of memory, try not to interrupt these VMs. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Normal.
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync * When ballooning, don't wait to ask these.
b84a3f2aac9529d5c5840512b12d81bc62d0e665vboxsync * When running out of memory, pause, save and/or kill these VMs. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * When ballooning, maximize these first.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * When running out of memory, save or kill these VMs. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The end of the valid priority range. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The custom 32-bit type blowup. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * GMM Memory Accounts.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The customary invalid zero entry. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Account with the base allocations. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Account with the shadow allocations. */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync /** Account with the fixed allocations. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The end of the valid values. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The usual 32-bit value to finish it off. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Balloon actions.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef enum
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Invalid zero entry. */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync /** Inflate the balloon. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Deflate the balloon. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Puncture the balloon because of VM reset. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** End of the valid actions. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** hack forcing the size of the enum to 32-bits. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * A page descriptor for use when freeing pages.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * See GMMR0FreePages, GMMR0BalloonedPages.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The Page ID of the page to be freed. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a page descriptor for freeing pages. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * A page descriptor for use when updating and allocating pages.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This is a bit complicated because we want to do as much as possible
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * with the same structure.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef struct GMMPAGEDESC
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The physical address of the page.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @input GMMR0AllocateHandyPages expects the guest physical address
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * to update the GMMPAGE structure with. Pass GMM_GCPHYS_UNSHAREABLE
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * when appropriate and NIL_RTHCPHYS when the page wasn't used
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync * for any specific guest address.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * GMMR0AllocatePage expects the guest physical address to put in
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * the GMMPAGE structure for the page it allocates for this entry.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Pass NIL_RTHCPHYS and GMM_GCPHYS_UNSHAREABLE as above.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @output The host physical address of the allocated page.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * NIL_RTHCPHYS on allocation failure.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * ASSUMES: sizeof(RTHCPHYS) >= sizeof(RTGCPHYS).
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The Page ID.
b84a3f2aac9529d5c5840512b12d81bc62d0e665vboxsync * @intput GMMR0AllocateHandyPages expects the Page ID of the page to
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * update here. NIL_GMM_PAGEID means no page should be updated.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * GMMR0AllocatePages requires this to be initialized to
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * NIL_GMM_PAGEID currently.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @output The ID of the page, NIL_GMM_PAGEID if the allocation failed.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The Page ID of the shared page was replaced by this page.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @input GMMR0AllocateHandyPages expects this to indicate a shared
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync * page that has been replaced by this page and should have its
b84a3f2aac9529d5c5840512b12d81bc62d0e665vboxsync * reference counter decremented and perhaps be freed up. Use
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * NIL_GMM_PAGEID if no shared page was involved.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * All other APIs expects NIL_GMM_PAGEID here.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @output All APIs sets this to NIL_GMM_PAGEID.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a page allocation. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** GMMPAGEDESC::HCPhysGCPhys value that indicates that the page is unsharable.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @note This corresponds to GMM_PAGE_PFN_UNSHAREABLE. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define GMM_GCPHYS_UNSHAREABLE UINT64_C(0x00000fffffff1000)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define GMM_GCPHYS_UNSHAREABLE UINT64_C(0x0000000fffff1000)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0InitialReservation(PVM pVM, VMCPUID idCpu, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0UpdateReservation(PVM pVM, VMCPUID idCpu, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0AllocateHandyPages(PVM pVM, VMCPUID idCpu, uint32_t cPagesToUpdate, uint32_t cPagesToAlloc, PGMMPAGEDESC paPages);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0AllocatePages(PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMPAGEDESC paPages, GMMACCOUNT enmAccount);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0AllocateLargePage(PVM pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pIdPage, RTHCPHYS *pHCPhys);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0FreePages(PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMFREEPAGEDESC paPages, GMMACCOUNT enmAccount);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0FreeLargePage(PVM pVM, VMCPUID idCpu, uint32_t idPage);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0BalloonedPages(PVM pVM, VMCPUID idCpu, GMMBALLOONACTION enmAction, uint32_t cBalloonedPages);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0MapUnmapChunk(PVM pVM, VMCPUID idCpu, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0SeedChunk(PVM pVM, VMCPUID idCpu, RTR3PTR pvR3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0RegisterSharedModule(PVM pVM, VMCPUID idCpu, VBOXOSFAMILY enmGuestOS, char *pszModuleName, char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule, unsigned cRegions, VMMDEVSHAREDREGIONDESC *pRegions);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0UnregisterSharedModule(PVM pVM, VMCPUID idCpu, char *pszModuleName, char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0UnregisterAllSharedModules(PVM pVM, VMCPUID idCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0CheckSharedModules(PVM pVM, VMCPUID idCpu);
b84a3f2aac9529d5c5840512b12d81bc62d0e665vboxsyncGMMR0DECL(int) GMMR0ResetSharedModules(PVM pVM, VMCPUID idCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request buffer for GMMR0InitialReservationReq / VMMR0_DO_GMM_INITIAL_RESERVATION.
b84a3f2aac9529d5c5840512b12d81bc62d0e665vboxsync * @see GMMR0InitialReservation
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync /** The header. */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync uint64_t cBasePages; /**< @see GMMR0InitialReservation */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync uint32_t cShadowPages; /**< @see GMMR0InitialReservation */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync uint32_t cFixedPages; /**< @see GMMR0InitialReservation */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync GMMOCPOLICY enmPolicy; /**< @see GMMR0InitialReservation */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync GMMPRIORITY enmPriority; /**< @see GMMR0InitialReservation */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync/** Pointer to a GMMR0InitialReservationReq / VMMR0_DO_GMM_INITIAL_RESERVATION request buffer. */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsynctypedef GMMINITIALRESERVATIONREQ *PGMMINITIALRESERVATIONREQ;
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsyncGMMR0DECL(int) GMMR0InitialReservationReq(PVM pVM, VMCPUID idCpu, PGMMINITIALRESERVATIONREQ pReq);
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync * Request buffer for GMMR0UpdateReservationReq / VMMR0_DO_GMM_UPDATE_RESERVATION.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @see GMMR0UpdateReservation
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync /** The header. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync uint64_t cBasePages; /**< @see GMMR0UpdateReservation */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync uint32_t cShadowPages; /**< @see GMMR0UpdateReservation */
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync uint32_t cFixedPages; /**< @see GMMR0UpdateReservation */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMR0InitialReservationReq / VMMR0_DO_GMM_INITIAL_RESERVATION request buffer. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef GMMUPDATERESERVATIONREQ *PGMMUPDATERESERVATIONREQ;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0UpdateReservationReq(PVM pVM, VMCPUID idCpu, PGMMUPDATERESERVATIONREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request buffer for GMMR0AllocatePagesReq / VMMR0_DO_GMM_ALLOCATE_PAGES.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @see GMMR0AllocatePages.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The header. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The account to charge the allocation to. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The number of pages to allocate. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Array of page descriptors. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMR0AllocatePagesReq / VMMR0_DO_GMM_ALLOCATE_PAGES request buffer. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0AllocatePagesReq(PVM pVM, VMCPUID idCpu, PGMMALLOCATEPAGESREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request buffer for GMMR0FreePagesReq / VMMR0_DO_GMM_FREE_PAGES.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @see GMMR0FreePages.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The header. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The account this relates to. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The number of pages to free. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Array of free page descriptors. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMR0FreePagesReq / VMMR0_DO_GMM_FREE_PAGES request buffer. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0FreePagesReq(PVM pVM, VMCPUID idCpu, PGMMFREEPAGESREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request buffer for GMMR0BalloonedPagesReq / VMMR0_DO_GMM_BALLOONED_PAGES.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @see GMMR0BalloonedPages.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The header. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The number of ballooned pages. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Inflate or deflate the balloon. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMR0BalloonedPagesReq / VMMR0_DO_GMM_BALLOONED_PAGES request buffer. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef GMMBALLOONEDPAGESREQ *PGMMBALLOONEDPAGESREQ;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0BalloonedPagesReq(PVM pVM, VMCPUID idCpu, PGMMBALLOONEDPAGESREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request buffer for GMMR0QueryHypervisorMemoryStatsReq / VMMR0_DO_GMM_QUERY_VMM_MEM_STATS.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @see GMMR0QueryHypervisorMemoryStatsReq.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The header. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The number of allocated pages (out). */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The number of free pages (out). */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The number of ballooned pages (out). */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Maximum nr of pages (out). */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMR0QueryHypervisorMemoryStatsReq / VMMR0_DO_GMM_QUERY_HYPERVISOR_MEM_STATS request buffer. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0QueryHypervisorMemoryStatsReq(PVM pVM, PGMMMEMSTATSREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0QueryMemoryStatsReq(PVM pVM, VMCPUID idCpu, PGMMMEMSTATSREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request buffer for GMMR0MapUnmapChunkReq / VMMR0_DO_GMM_MAP_UNMAP_CHUNK.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @see GMMR0MapUnmapChunk
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The header. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The chunk to map, NIL_GMM_CHUNKID if unmap only. (IN) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The chunk to unmap, NIL_GMM_CHUNKID if map only. (IN) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Where the mapping address is returned. (OUT) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMR0MapUnmapChunkReq / VMMR0_DO_GMM_MAP_UNMAP_CHUNK request buffer. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0MapUnmapChunkReq(PVM pVM, VMCPUID idCpu, PGMMMAPUNMAPCHUNKREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request buffer for GMMR0FreeLargePageReq / VMMR0_DO_GMM_FREE_LARGE_PAGE.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @see GMMR0FreeLargePage.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The header. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The Page ID. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMR0FreePagesReq / VMMR0_DO_GMM_FREE_PAGES request buffer. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0FreeLargePageReq(PVM pVM, VMCPUID idCpu, PGMMFREELARGEPAGEREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Maximum length of the shared module name string. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Maximum length of the shared module version string. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request buffer for GMMR0RegisterSharedModuleReq / VMMR0_DO_GMM_REGISTER_SHARED_MODULE.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @see GMMR0RegisterSharedModule.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The header. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Shared module size. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Number of included region descriptors */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Base address of the shared module. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Guest OS type. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Alignment. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Module name */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Module version */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync char szVersion[GMM_SHARED_MODULE_MAX_VERSION_STRING];
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Shared region descriptor(s). */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMR0RegisterSharedModuleReq / VMMR0_DO_GMM_REGISTER_SHARED_MODULE request buffer. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef GMMREGISTERSHAREDMODULEREQ *PGMMREGISTERSHAREDMODULEREQ;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0RegisterSharedModuleReq(PVM pVM, VMCPUID idCpu, PGMMREGISTERSHAREDMODULEREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Shared region descriptor
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Region base address. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Region size. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Alignment. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Pointer to physical page id array. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMSHAREDREGIONDESC. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Shared module registration info (global)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /* Tree node. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Shared module size. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Number of included region descriptors */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Number of users (VMs). */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Guest OS family type. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Module name */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Module version */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync char szVersion[GMM_SHARED_MODULE_MAX_VERSION_STRING];
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Shared region descriptor(s). */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMSHAREDMODULE. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Page descriptor for GMMR0SharedModuleCheckRange
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** HC Physical address (in/out) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** GC Physical address (in) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** GMM page id. (in/out) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Align at 8 byte boundary. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMSHAREDPAGEDESC. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0SharedModuleCheckRange(PGVM pGVM, PGMMSHAREDMODULE pModule, unsigned idxRegion, unsigned cPages, PGMMSHAREDPAGEDESC paPageDesc);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request buffer for GMMR0UnregisterSharedModuleReq / VMMR0_DO_GMM_UNREGISTER_SHARED_MODULE.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @see GMMR0UnregisterSharedModule.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The header. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Shared module size. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Align at 8 byte boundary. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Base address of the shared module. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Module name */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Module version */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync char szVersion[GMM_SHARED_MODULE_MAX_VERSION_STRING];
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a GMMR0UnregisterSharedModuleReq / VMMR0_DO_GMM_UNREGISTER_SHARED_MODULE request buffer. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef GMMUNREGISTERSHAREDMODULEREQ *PGMMUNREGISTERSHAREDMODULEREQ;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR0DECL(int) GMMR0UnregisterSharedModuleReq(PVM pVM, VMCPUID idCpu, PGMMUNREGISTERSHAREDMODULEREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @defgroup grp_gmm_r3 The Global Memory Manager Ring-3 API Wrappers
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @ingroup grp_gmm
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3InitialReservation(PVM pVM, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3UpdateReservation(PVM pVM, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3AllocatePagesPrepare(PVM pVM, PGMMALLOCATEPAGESREQ *ppReq, uint32_t cPages, GMMACCOUNT enmAccount);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3AllocatePagesPerform(PVM pVM, PGMMALLOCATEPAGESREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(void) GMMR3AllocatePagesCleanup(PGMMALLOCATEPAGESREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3FreePagesPrepare(PVM pVM, PGMMFREEPAGESREQ *ppReq, uint32_t cPages, GMMACCOUNT enmAccount);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(void) GMMR3FreePagesRePrep(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t cPages, GMMACCOUNT enmAccount);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3FreePagesPerform(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t cActualPages);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(void) GMMR3FreePagesCleanup(PGMMFREEPAGESREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(void) GMMR3FreeAllocatedPages(PVM pVM, GMMALLOCATEPAGESREQ const *pAllocReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3AllocateLargePage(PVM pVM, uint32_t cbPage);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3FreeLargePage(PVM pVM, uint32_t idPage);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3MapUnmapChunk(PVM pVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3SeedChunk(PVM pVM, RTR3PTR pvR3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3QueryHypervisorMemoryStats(PVM pVM, uint64_t *pcTotalAllocPages, uint64_t *pcTotalFreePages, uint64_t *pcTotalBalloonPages);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3QueryMemoryStats(PVM pVM, uint64_t *pcAllocPages, uint64_t *pcMaxPages, uint64_t *pcBalloonPages);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3BalloonedPages(PVM pVM, GMMBALLOONACTION enmAction, uint32_t cBalloonedPages);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3RegisterSharedModule(PVM pVM, PGMMREGISTERSHAREDMODULEREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncGMMR3DECL(int) GMMR3UnregisterSharedModule(PVM pVM, PGMMUNREGISTERSHAREDMODULEREQ pReq);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* IN_RING3 */