PGMShw.h revision 2af0dd14e6c1c9297537694bd8ff24ae5838620c
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * VBox - Page Manager / Monitor, Shadow Paging Template.
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * available from http://www.virtualbox.org. This file is free software;
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * you can redistribute it and/or modify it under the terms of the GNU
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * General Public License (GPL) as published by the Free Software
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync * additional information or have any questions.
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync/*******************************************************************************
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync* Defined Constants And Macros *
d606b96aa8a4be8f7d2da410f982889804c27b92vboxsync*******************************************************************************/
# define SHW_POOL_ROOT_IDX PGMPOOL_IDX_NESTED_ROOT /* do not use! exception is real mode & protected mode without paging. */
PGM_SHW_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask);
if (fResolveGCAndR0)
int rc;
#if PGM_SHW_TYPE != PGM_TYPE_AMD64 && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */
rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_RC_STR(ModifyPage), &pModeData->pfnRCShwModifyPage);
rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_SHW_NAME_R0_STR(ModifyPage), &pModeData->pfnR0ShwModifyPage);
return VINF_SUCCESS;
int rc = pgmPoolAlloc(pVM, GCPhysCR3, PGMPOOLKIND_ROOT_NESTED, PGMPOOL_IDX_NESTED_ROOT, GCPhysCR3 >> PAGE_SHIFT, &pNewShwPageCR3);
Log(("Enter nested shadow paging mode: root %RHv phys %RHp\n", pVCpu->pgm.s.pShwPageCR3R3, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)->Core.Key));
return VINF_SUCCESS;
return VINF_SUCCESS;
pgmPoolFreeByPage(pPool, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3), pVCpu->pgm.s.iShwUser, pVCpu->pgm.s.iShwUserTable);
return VINF_SUCCESS;