PGMAll.cpp revision b34561f910d074d2c3b3db44d998c0fe35f68c04
/* $Id$ */
/** @file
* PGM - Page Manager and Monitor - All context code.
*/
/*
* Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#ifdef VBOX_WITH_REM
#endif
#include "PGMInternal.h"
#include "PGMInline.h"
#include <iprt/asm-amd64-x86.h>
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
/**
* Stated structure for PGM_GST_NAME(HandlerVirtualUpdate) that's
* passed to PGM_GST_NAME(VirtHandlerUpdateOne) during enumeration.
*/
typedef struct PGMHVUSTATE
{
/** Pointer to the VM. */
/** Pointer to the VMCPU. */
/** The todo flags. */
/** The CR4 register value. */
} PGMHVUSTATE, *PPGMHVUSTATE;
/*******************************************************************************
* Internal Functions *
*******************************************************************************/
DECLINLINE(int) pgmShwGetLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PX86PML4E *ppPml4e, PX86PDPT *ppPdpt, PX86PDPAE *ppPD);
#ifndef IN_RC
static int pgmShwSyncLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, X86PGPAEUINT uGstPml4e, X86PGPAEUINT uGstPdpe, PX86PDPAE *ppPD);
#endif
/*
* Shadow - 32-bit mode
*/
#define PGM_SHW_TYPE PGM_TYPE_32BIT
#include "PGMAllShw.h"
/* Guest - real mode */
#define PGM_GST_TYPE PGM_TYPE_REAL
#include "PGMGstDefs.h"
#include "PGMAllGst.h"
#include "PGMAllBth.h"
/* Guest - protected mode */
#define PGM_GST_TYPE PGM_TYPE_PROT
#include "PGMGstDefs.h"
#include "PGMAllGst.h"
#include "PGMAllBth.h"
/* Guest - 32-bit mode */
#define PGM_GST_TYPE PGM_TYPE_32BIT
#include "PGMGstDefs.h"
#include "PGMAllGst.h"
#include "PGMAllBth.h"
/*
* Shadow - PAE mode
*/
#define PGM_SHW_TYPE PGM_TYPE_PAE
#include "PGMAllShw.h"
/* Guest - real mode */
#define PGM_GST_TYPE PGM_TYPE_REAL
#include "PGMGstDefs.h"
#include "PGMAllBth.h"
/* Guest - protected mode */
#define PGM_GST_TYPE PGM_TYPE_PROT
#include "PGMGstDefs.h"
#include "PGMAllBth.h"
/* Guest - 32-bit mode */
#define PGM_GST_TYPE PGM_TYPE_32BIT
#include "PGMGstDefs.h"
#include "PGMAllBth.h"
/* Guest - PAE mode */
#define PGM_GST_TYPE PGM_TYPE_PAE
#include "PGMGstDefs.h"
#include "PGMAllGst.h"
#include "PGMAllBth.h"
/*
* Shadow - AMD64 mode
*/
# define PGM_SHW_TYPE PGM_TYPE_AMD64
# include "PGMAllShw.h"
/* Guest - protected mode (only used for AMD-V nested paging in 64 bits mode) */
# define PGM_GST_TYPE PGM_TYPE_PROT
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
# ifdef VBOX_WITH_64_BITS_GUESTS
/* Guest - AMD64 mode */
# define PGM_GST_TYPE PGM_TYPE_AMD64
# include "PGMGstDefs.h"
# include "PGMAllGst.h"
# include "PGMAllBth.h"
# endif /* VBOX_WITH_64_BITS_GUESTS */
/*
* Shadow - Nested paging mode
*/
# define PGM_SHW_TYPE PGM_TYPE_NESTED
# include "PGMAllShw.h"
/* Guest - real mode */
# define PGM_GST_TYPE PGM_TYPE_REAL
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
/* Guest - protected mode */
# define PGM_GST_TYPE PGM_TYPE_PROT
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
/* Guest - 32-bit mode */
# define PGM_GST_TYPE PGM_TYPE_32BIT
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
/* Guest - PAE mode */
# define PGM_GST_TYPE PGM_TYPE_PAE
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
# ifdef VBOX_WITH_64_BITS_GUESTS
/* Guest - AMD64 mode */
# define PGM_GST_TYPE PGM_TYPE_AMD64
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
# endif /* VBOX_WITH_64_BITS_GUESTS */
/*
* Shadow - EPT
*/
# define PGM_SHW_TYPE PGM_TYPE_EPT
# include "PGMAllShw.h"
/* Guest - real mode */
# define PGM_GST_TYPE PGM_TYPE_REAL
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
/* Guest - protected mode */
# define PGM_GST_TYPE PGM_TYPE_PROT
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
/* Guest - 32-bit mode */
# define PGM_GST_TYPE PGM_TYPE_32BIT
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
/* Guest - PAE mode */
# define PGM_GST_TYPE PGM_TYPE_PAE
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
# ifdef VBOX_WITH_64_BITS_GUESTS
/* Guest - AMD64 mode */
# define PGM_GST_TYPE PGM_TYPE_AMD64
# include "PGMGstDefs.h"
# include "PGMAllBth.h"
# endif /* VBOX_WITH_64_BITS_GUESTS */
#endif /* !IN_RC */
#ifndef IN_RING3
/**
* #PF Handler.
*
* @returns VBox status code (appropriate for trap handling and GC return).
* @param pVCpu Pointer to the VMCPU.
* @param uErr The trap error code.
* @param pRegFrame Trap register frame.
* @param pvFault The fault address.
*/
{
Log(("PGMTrap0eHandler: uErr=%RGx pvFault=%RGv eip=%04x:%RGv cr3=%RGp\n", uErr, pvFault, pRegFrame->cs.Sel, (RTGCPTR)pRegFrame->rip, (RTGCPHYS)CPUMGetGuestCR3(pVCpu)));
#ifdef VBOX_WITH_STATISTICS
/*
* Error code stats.
*/
if (uErr & X86_TRAP_PF_US)
{
if (!(uErr & X86_TRAP_PF_P))
{
if (uErr & X86_TRAP_PF_RW)
else
}
else if (uErr & X86_TRAP_PF_RW)
else if (uErr & X86_TRAP_PF_RSVD)
else if (uErr & X86_TRAP_PF_ID)
else
}
else
{ /* Supervisor */
if (!(uErr & X86_TRAP_PF_P))
{
if (uErr & X86_TRAP_PF_RW)
else
}
else if (uErr & X86_TRAP_PF_RW)
else if (uErr & X86_TRAP_PF_ID)
else if (uErr & X86_TRAP_PF_RSVD)
}
#endif /* VBOX_WITH_STATISTICS */
/*
* Call the worker.
*/
bool fLockTaken = false;
if (fLockTaken)
{
}
/*
* Return code tweaks.
*/
if (rc != VINF_SUCCESS)
{
if (rc == VINF_PGM_SYNCPAGE_MODIFIED_PDE)
rc = VINF_SUCCESS;
# ifdef IN_RING0
/* Note: hack alert for difficult to reproduce problem. */
{
Log(("WARNING: Unexpected VERR_PAGE_TABLE_NOT_PRESENT (%d) for page fault at %RGv error code %x (rip=%RGv)\n", rc, pvFault, uErr, pRegFrame->rip));
/* Some kind of inconsistency in the SMP case; it's safe to just execute the instruction again; not sure about single VCPU VMs though. */
rc = VINF_SUCCESS;
}
# endif
}
STAM_STATS({ if (rc == VINF_EM_RAW_GUEST_TRAP) STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eGuestPF); });
pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2Misc; });
STAM_PROFILE_STOP_EX(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0e, pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution), a);
return rc;
}
#endif /* !IN_RING3 */
/**
* Prefetch a page
*
* Typically used to sync commonly used pages before entering raw mode
* after a CR3 reload.
*
* @returns VBox status code suitable for scheduling.
* @retval VINF_SUCCESS on success.
* @retval VINF_PGM_SYNC_CR3 if we're out of shadow pages or something like that.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtrPage Page to invalidate.
*/
{
return rc;
}
/**
* Gets the mapping corresponding to the specified address (if any).
*
* @returns Pointer to the mapping.
* @returns NULL if not
*
* @param pVM Pointer to the VM.
* @param GCPtr The guest context pointer.
*/
{
while (pMapping)
{
break;
return pMapping;
}
return NULL;
}
/**
* Verifies a range of pages for read or write access
*
* Only checks the guest's page tables
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param Addr Guest virtual address to check
* @param cbSize Access size
* @param fAccess Access type (r/w, user/supervisor (X86_PTE_*))
* @remarks Current not in use.
*/
{
/*
* Validate input.
*/
{
return VERR_INVALID_PARAMETER;
}
if (RT_FAILURE(rc))
{
return VINF_EM_RAW_GUEST_TRAP;
}
/*
* Check if the access would cause a page fault
*
* Note that hypervisor page directories are not present in the guest's tables, so this check
* is sufficient.
*/
{
Log(("PGMIsValidAccess: access violation for %RGv attr %#llx vs %d:%d\n", Addr, fPage, fWrite, fUser));
return VINF_EM_RAW_GUEST_TRAP;
}
if ( RT_SUCCESS(rc)
return PGMIsValidAccess(pVCpu, Addr + PAGE_SIZE, (cbSize > PAGE_SIZE) ? cbSize - PAGE_SIZE : 1, fAccess);
return rc;
}
/**
* Verifies a range of pages for read or write access
*
* Supports handling of pages marked for dirty bit tracking and CSAM
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param Addr Guest virtual address to check
* @param cbSize Access size
* @param fAccess Access type (r/w, user/supervisor (X86_PTE_*))
*/
{
AssertMsg(!(fAccess & ~(X86_PTE_US | X86_PTE_RW)), ("PGMVerifyAccess: invalid access type %08x\n", fAccess));
/*
* Get going.
*/
if (RT_FAILURE(rc))
{
return VINF_EM_RAW_GUEST_TRAP;
}
/*
* Check if the access would cause a page fault
*
* Note that hypervisor page directories are not present in the guest's tables, so this check
* is sufficient.
*/
{
Log(("PGMVerifyAccess: access violation for %RGv attr %#llx vs %d:%d\n", Addr, fPageGst, fWrite, fUser));
return VINF_EM_RAW_GUEST_TRAP;
}
{
/*
* Next step is to verify if we protected this page for dirty bit tracking or for CSAM scanning
*/
if ( rc == VERR_PAGE_NOT_PRESENT
|| rc == VERR_PAGE_TABLE_NOT_PRESENT)
{
/*
* Page is not present in our page tables.
* Try to sync it!
*/
if (rc != VINF_SUCCESS)
return rc;
}
else
}
#if 0 /* def VBOX_STRICT; triggers too often now */
/*
* This check is a bit paranoid, but useful.
*/
/* Note! This will assert when writing to monitored pages (a bit annoying actually). */
{
AssertMsgFailed(("Unexpected access violation for %RGv! rc=%Rrc write=%d user=%d\n",
return VINF_EM_RAW_GUEST_TRAP;
}
#endif
if ( RT_SUCCESS(rc)
{
/* Don't recursively call PGMVerifyAccess as we might run out of stack. */
for (;;)
{
else
cbSize = 1;
if (rc != VINF_SUCCESS)
break;
break;
}
}
return rc;
}
/**
* Emulation of the invlpg instruction (HC only actually).
*
* @returns Strict VBox status code, special care required.
* @retval VINF_PGM_SYNC_CR3 - handled.
* @retval VINF_EM_RAW_EMULATE_INSTR - not handled (RC only).
* @retval VERR_REM_FLUSHED_PAGES_OVERFLOW - not handled.
*
* @param pVCpu Pointer to the VMCPU.
* @param GCPtrPage Page to invalidate.
*
* @remark ASSUMES the page table entry or page directory is valid. Fairly
* safe, but there could be edge cases!
*
* @todo Flush page or page directory only if necessary!
* @todo VBOXSTRICTRC
*/
{
int rc;
#if !defined(IN_RING3) && defined(VBOX_WITH_REM)
/*
* Notify the recompiler so it can record this instruction.
*/
#endif /* !IN_RING3 */
#ifdef IN_RC
/*
* Check for conflicts and pending CR3 monitoring updates.
*/
if (pgmMapAreMappingsFloating(pVM))
{
{
LogFlow(("PGMGCInvalidatePage: Conflict!\n"));
return VINF_PGM_SYNC_CR3;
}
{
LogFlow(("PGMGCInvalidatePage: PGM_SYNC_MONITOR_CR3 -> reinterpret instruction in R3\n"));
return VINF_EM_RAW_EMULATE_INSTR;
}
}
#endif /* IN_RC */
/*
* Call paging mode specific worker.
*/
#ifdef IN_RING3
/*
* Check if we have a pending update of the CR3 monitoring.
*/
if ( RT_SUCCESS(rc)
{
}
# ifdef VBOX_WITH_RAW_MODE
/*
* Inform CSAM about the flush
*
* Note: This is to check if monitored pages have been changed; when we implement
* callbacks for virtual handlers, this is no longer required.
*/
# endif
#endif /* IN_RING3 */
/* Ignore all irrelevant error codes. */
if ( rc == VERR_PAGE_NOT_PRESENT
rc = VINF_SUCCESS;
return rc;
}
/**
* Executes an instruction using the interpreter.
*
* @returns VBox status code (appropriate for trap handling and GC return).
* @param pVM Pointer to the VM.
* @param pVCpu Pointer to the VMCPU.
* @param pRegFrame Register frame.
* @param pvFault Fault address.
*/
VMMDECL(VBOXSTRICTRC) PGMInterpretInstruction(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault)
{
if (rc == VERR_EM_INTERPRETER)
if (rc != VINF_SUCCESS)
return rc;
}
/**
* Gets effective page information (from the VMM page directory).
*
* @returns VBox status.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr Guest Context virtual address of the page.
* @param pfFlags Where to store the flags. These are X86_PTE_*.
* @param pHCPhys Where to store the HC physical address of the page.
* This is page aligned.
* @remark You should use PGMMapGetPage() for pages in a mapping.
*/
{
return rc;
}
/**
* Modify page flags for a range of pages in the shadow context.
*
* The existing flags are ANDed with the fMask and ORed with the fFlags.
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr Virtual address of the first page in the range.
* @param fFlags The OR mask - page flags X86_PTE_*, excluding the page mask of course.
* @param fMask The AND mask - page flags X86_PTE_*.
* Be very CAREFUL when ~'ing constants which could be 32-bit!
* @param fOpFlags A combination of the PGM_MK_PK_XXX flags.
* @remark You must use PGMMapModifyPage() for pages in a mapping.
*/
DECLINLINE(int) pdmShwModifyPage(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags)
{
return rc;
}
/**
* Changing the page flags for a single page in the shadow page tables so as to
* make it read-only.
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr Virtual address of the first page in the range.
* @param fOpFlags A combination of the PGM_MK_PK_XXX flags.
*/
{
}
/**
* Changing the page flags for a single page in the shadow page tables so as to
* make it writable.
*
* The call must know with 101% certainty that the guest page tables maps this
* as writable too. This function will deal shared, zero and write monitored
* pages.
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr Virtual address of the first page in the range.
* @param fMmio2 Set if it is an MMIO2 page.
* @param fOpFlags A combination of the PGM_MK_PK_XXX flags.
*/
{
}
/**
* Changing the page flags for a single page in the shadow page tables so as to
* make it not present.
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr Virtual address of the first page in the range.
* @param fOpFlags A combination of the PGM_MK_PG_XXX flags.
*/
{
}
/**
* Changing the page flags for a single page in the shadow page tables so as to
* make it supervisor and writable.
*
* This if for dealing with CR0.WP=0 and readonly user pages.
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr Virtual address of the first page in the range.
* @param fBigPage Whether or not this is a big page. If it is, we have to
* change the shadow PDE as well. If it isn't, the caller
* has checked that the shadow PDE doesn't need changing.
* We ASSUME 4KB pages backing the big page here!
* @param fOpFlags A combination of the PGM_MK_PG_XXX flags.
*/
int pgmShwMakePageSupervisorAndWritable(PVMCPU pVCpu, RTGCPTR GCPtr, bool fBigPage, uint32_t fOpFlags)
{
{
/* this is a bit ugly... */
{
case PGMMODE_32_BIT:
{
break;
}
case PGMMODE_PAE:
case PGMMODE_PAE_NX:
{
break;
}
default:
}
}
return rc;
}
/**
* Gets the shadow page directory for the specified address, PAE.
*
* @returns Pointer to the shadow PD.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr The address.
* @param uGstPdpe Guest PDPT entry. Valid.
* @param ppPD Receives address of page directory
*/
{
int rc;
/* Allocate page directory if not present. */
&& !(pPdpe->u & X86_PDPE_PG_MASK))
{
{
}
else
{
{
if (!(uGstPdpe & X86_PDPE_P))
{
/* PD not present; guest must reload CR3 to change it.
* No need to monitor anything in this case.
*/
uGstPdpe |= X86_PDPE_P;
}
else
{
}
}
else
{
}
}
/* Create a reference back to the PDPT by using the index in its shadow page. */
&pShwPage);
/* The PD was cached or created; hook it up now. */
# if defined(IN_RC)
/*
* In 32 bits PAE mode we *must* invalidate the TLB when changing a
* PDPT entry; the CPU fetches them only during cr3 load, so any
* non-present PDPT will continue to cause page faults.
*/
ASMReloadCR3();
# endif
}
else
{
}
return VINF_SUCCESS;
}
/**
* Gets the pointer to the shadow page directory entry for an address, PAE.
*
* @returns Pointer to the PDE.
* @param pVCpu The current CPU.
* @param GCPtr The address.
* @param ppShwPde Receives the address of the pgm pool page for the shadow page directory
*/
{
{
}
/* Fetch the pgm pool shadow descriptor. */
PPGMPOOLPAGE pShwPde = pgmPoolGetPage(pVM->pgm.s.CTX_SUFF(pPool), pPdpt->a[iPdPt].u & X86_PDPE_PG_MASK);
return VINF_SUCCESS;
}
#ifndef IN_RC
/**
* Syncs the SHADOW page directory pointer for the specified address.
*
* Allocates backing pages in case the PDPT or PML4 entry is missing.
*
* The caller is responsible for making sure the guest has a valid PD before
* calling this function.
*
* @returns VBox status.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr The address.
* @param uGstPml4e Guest PML4 entry (valid).
* @param uGstPdpe Guest PDPT entry (valid).
* @param ppPD Receives address of page directory
*/
static int pgmShwSyncLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, X86PGPAEUINT uGstPml4e, X86PGPAEUINT uGstPdpe, PX86PDPAE *ppPD)
{
int rc;
/* Allocate page directory pointer table if not present. */
&& !(pPml4e->u & X86_PML4E_PG_MASK))
{
{
}
else
{
}
/* Create a reference back to the PDPT by using the index in its shadow page. */
&pShwPage);
}
else
{
}
/* The PDPT was cached or created; hook it up now. */
/* Allocate page directory if not present. */
&& !(pPdpe->u & X86_PDPE_PG_MASK))
{
{
}
else
{
}
/* Create a reference back to the PDPT by using the index in its shadow page. */
&pShwPage);
}
else
{
}
/* The PD was cached or created; hook it up now. */
return VINF_SUCCESS;
}
/**
* Gets the SHADOW page directory pointer for the specified address (long mode).
*
* @returns VBox status.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr The address.
* @param ppPdpt Receives address of pdpt
* @param ppPD Receives address of page directory
*/
DECLINLINE(int) pgmShwGetLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PX86PML4E *ppPml4e, PX86PDPT *ppPdpt, PX86PDPAE *ppPD)
{
if (ppPml4e)
return VERR_PAGE_MAP_LEVEL4_NOT_PRESENT;
Log4(("pgmShwGetLongModePDPtr %RGv -> *ppPD=%p PDE=%p/%RX64\n", GCPtr, *ppPD, &(*ppPD)->a[(GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK], (*ppPD)->a[(GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK].u));
return VINF_SUCCESS;
}
/**
* Syncs the SHADOW EPT page directory pointer for the specified address. Allocates
* backing pages in case the PDPT or PML4 entry is missing.
*
* @returns VBox status.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr The address.
* @param ppPdpt Receives address of pdpt
* @param ppPD Receives address of page directory
*/
{
int rc;
/* Allocate page directory pointer table if not present. */
&& !(pPml4e->u & EPT_PML4E_PG_MASK))
{
rc = pgmPoolAlloc(pVM, GCPml4, PGMPOOLKIND_EPT_PDPT_FOR_PHYS, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu),
&pShwPage);
}
else
{
}
/* The PDPT was cached or created; hook it up now and fill with the default value. */
if (ppPdpt)
/* Allocate page directory if not present. */
&& !(pPdpe->u & EPT_PDPTE_PG_MASK))
{
rc = pgmPoolAlloc(pVM, GCPdPt, PGMPOOLKIND_EPT_PD_FOR_PHYS, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu),
&pShwPage);
}
else
{
}
/* The PD was cached or created; hook it up now and fill with the default value. */
return VINF_SUCCESS;
}
#endif /* IN_RC */
#ifdef IN_RING0
/**
* Synchronizes a range of nested page table entries.
*
* The caller must own the PGM lock.
*
* @param pVCpu The current CPU.
* @param GCPhys Where to start.
* @param cPages How many pages which entries should be synced.
* @param enmShwPagingMode The shadow paging mode (PGMMODE_EPT for VT-x,
* host paging mode for AMD-V).
*/
int pgmShwSyncNestedPageLocked(PVMCPU pVCpu, RTGCPHYS GCPhysFault, uint32_t cPages, PGMMODE enmShwPagingMode)
{
int rc;
switch (enmShwPagingMode)
{
case PGMMODE_32_BIT:
{
break;
}
case PGMMODE_PAE:
case PGMMODE_PAE_NX:
{
break;
}
case PGMMODE_AMD64:
case PGMMODE_AMD64_NX:
{
break;
}
case PGMMODE_EPT:
{
break;
}
default:
}
return rc;
}
#endif /* IN_RING0 */
/**
* Gets effective Guest OS page information.
*
* When GCPtr is in a big page, the function will return as if it was a normal
* 4KB page. If the need for distinguishing between big and normal page becomes
* necessary at a later point, a PGMGstGetPage() will be created for that
* purpose.
*
* @returns VBox status.
* @param pVCpu The current CPU.
* @param GCPtr Guest Context virtual address of the page.
* @param pfFlags Where to store the flags. These are X86_PTE_*, even for big pages.
* @param pGCPhys Where to store the GC physical address of the page.
* This is page aligned. The fact that the
*/
{
}
/**
* Performs a guest page table walk.
*
* The guest should be in paged protect mode or long mode when making a call to
* this function.
*
* @returns VBox status code.
* @retval VINF_SUCCESS on success.
* @retval VERR_PAGE_TABLE_NOT_PRESENT on failure. Check pWalk for details.
* @retval VERR_PGM_NOT_USED_IN_MODE if not paging isn't enabled. @a pWalk is
* not valid, except enmType is PGMPTWALKGSTTYPE_INVALID.
*
* @param pVCpu The current CPU.
* @param GCPtr The guest virtual address to walk by.
* @param pWalk Where to return the walk result. This is valid on some
* error codes as well.
*/
{
{
case PGMMODE_32_BIT:
case PGMMODE_PAE:
case PGMMODE_PAE_NX:
#if !defined(IN_RC)
case PGMMODE_AMD64:
case PGMMODE_AMD64_NX:
#endif
case PGMMODE_REAL:
case PGMMODE_PROTECTED:
return VERR_PGM_NOT_USED_IN_MODE;
#if defined(IN_RC)
case PGMMODE_AMD64:
case PGMMODE_AMD64_NX:
#endif
case PGMMODE_NESTED:
case PGMMODE_EPT:
default:
AssertFailed();
return VERR_PGM_NOT_USED_IN_MODE;
}
}
/**
* Checks if the page is present.
*
* @returns true if the page is present.
* @returns false if the page is not present.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr Address within the page.
*/
{
return RT_SUCCESS(rc);
}
/**
* Sets (replaces) the page flags for a range of pages in the guest's tables.
*
* @returns VBox status.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr The address of the first page.
* @param cb The size of the range in bytes.
* @param fFlags Page flags X86_PTE_*, excluding the page mask of course.
*/
{
}
/**
* Modify page flags for a range of pages in the guest's tables
*
* The existing flags are ANDed with the fMask and ORed with the fFlags.
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param GCPtr Virtual address of the first page in the range.
* @param cb Size (in bytes) of the range to apply the modification to.
* @param fFlags The OR mask - page flags X86_PTE_*, excluding the page mask of course.
* @param fMask The AND mask - page flags X86_PTE_*, excluding the page mask of course.
* Be very CAREFUL when ~'ing constants which could be 32-bit!
*/
VMMDECL(int) PGMGstModifyPage(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask)
{
/*
* Validate input.
*/
/*
* Adjust input.
*/
/*
* Call worker.
*/
return rc;
}
/**
* Performs the lazy mapping of the 32-bit guest PD.
*
* @returns VBox status code.
* @param pVCpu The current CPU.
* @param ppPd Where to return the pointer to the mapping. This is
* always set.
*/
{
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc))
{
# ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
# endif
return VINF_SUCCESS;
}
}
return rc;
}
/**
* Performs the lazy mapping of the PAE guest PDPT.
*
* @returns VBox status code.
* @param pVCpu The current CPU.
* @param ppPdpt Where to return the pointer to the mapping. This is
* always set.
*/
{
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc))
{
# ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
# endif
return VINF_SUCCESS;
}
}
return rc;
}
/**
* Performs the lazy mapping / updating of a PAE guest PD.
*
* @returns Pointer to the mapping.
* @returns VBox status code.
* @param pVCpu The current CPU.
* @param iPdpt Which PD entry to map (0..3).
* @param ppPd Where to return the pointer to the mapping. This is
* always set.
*/
{
if (RT_SUCCESS(rc))
{
#if !defined(IN_RC) && !defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
#endif
{
}
if (RT_SUCCESS(rc))
{
# ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
# endif
if (fChanged)
{
}
return VINF_SUCCESS;
}
}
/* Invalid page or some failure, invalidate the entry. */
# ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
# endif
return rc;
}
#endif /* !VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 */
#if !defined(IN_RC) && !defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
/**
* Performs the lazy mapping of the 32-bit guest PD.
*
* @returns VBox status code.
* @param pVCpu The current CPU.
* @param ppPml4 Where to return the pointer to the mapping. This will
* always be set.
*/
{
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc))
{
# ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
# endif
return VINF_SUCCESS;
}
}
return rc;
}
#endif
/**
* Gets the PAE PDPEs values cached by the CPU.
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param paPdpes Where to return the four PDPEs. The array
* pointed to must have 4 entries.
*/
{
return VINF_SUCCESS;
}
/**
* Sets the PAE PDPEs values cached by the CPU.
*
* @remarks This must be called *AFTER* PGMUpdateCR3.
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param paPdpes The four PDPE values. The array pointed to must
* have exactly 4 entries.
*
* @remarks No-long-jump zone!!!
*/
{
{
{
/* Force lazy remapping if it changed in any way. */
# ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
# endif
}
}
return VINF_SUCCESS;
}
/**
* Gets the current CR3 register value for the shadow memory context.
* @returns CR3 value.
* @param pVCpu Pointer to the VMCPU.
*/
{
AssertPtrReturn(pPoolPage, 0);
}
/**
* Gets the current CR3 register value for the nested memory context.
* @returns CR3 value.
* @param pVCpu Pointer to the VMCPU.
*/
{
}
/**
* Gets the current CR3 register value for the HC intermediate memory context.
* @returns CR3 value.
* @param pVM Pointer to the VM.
*/
{
{
case SUPPAGINGMODE_32_BIT:
case SUPPAGINGMODE_PAE:
case SUPPAGINGMODE_PAE_GLOBAL:
case SUPPAGINGMODE_PAE_NX:
case SUPPAGINGMODE_AMD64:
case SUPPAGINGMODE_AMD64_NX:
default:
return NIL_RTHCPHYS;
}
}
/**
* Gets the current CR3 register value for the RC intermediate memory context.
* @returns CR3 value.
* @param pVM Pointer to the VM.
* @param pVCpu Pointer to the VMCPU.
*/
{
{
case PGMMODE_32_BIT:
case PGMMODE_PAE:
case PGMMODE_PAE_NX:
case PGMMODE_AMD64:
case PGMMODE_AMD64_NX:
case PGMMODE_EPT:
case PGMMODE_NESTED:
return 0; /* not relevant */
default:
return NIL_RTHCPHYS;
}
}
/**
* Gets the CR3 register value for the 32-Bit intermediate memory context.
* @returns CR3 value.
* @param pVM Pointer to the VM.
*/
{
}
/**
* Gets the CR3 register value for the PAE intermediate memory context.
* @returns CR3 value.
* @param pVM Pointer to the VM.
*/
{
}
/**
* Gets the CR3 register value for the AMD64 intermediate memory context.
* @returns CR3 value.
* @param pVM Pointer to the VM.
*/
{
}
/**
* Performs and schedules necessary updates following a CR3 load or reload.
*
* This will normally involve mapping the guest PD or nPDPT
*
* @returns VBox status code.
* @retval VINF_PGM_SYNC_CR3 if monitoring requires a CR3 sync. This can
* safely be ignored and overridden since the FF will be set too then.
* @param pVCpu Pointer to the VMCPU.
* @param cr3 The new cr3.
* @param fGlobal Indicates whether this is a global flush or not.
*/
{
/*
* Always flag the necessary updates; necessary for hardware acceleration
*/
/** @todo optimize this, it shouldn't always be necessary. */
if (fGlobal)
LogFlow(("PGMFlushTLB: cr3=%RX64 OldCr3=%RX64 fGlobal=%d\n", cr3, pVCpu->pgm.s.GCPhysCR3, fGlobal));
/*
* Remap the CR3 content and adjust the monitoring if CR3 was actually changed.
*/
int rc = VINF_SUCCESS;
{
case PGMMODE_PAE:
case PGMMODE_PAE_NX:
break;
case PGMMODE_AMD64:
case PGMMODE_AMD64_NX:
break;
default:
break;
}
{
{
if (pgmMapAreMappingsFloating(pVM))
}
else
{
if (pgmMapAreMappingsFloating(pVM))
}
if (fGlobal)
else
}
else
{
# ifdef PGMPOOL_WITH_OPTIMIZED_DIRTY_PT
if (pPool->cDirtyPages)
{
}
# endif
/*
* Check if we have a pending update of the CR3 monitoring.
*/
{
}
if (fGlobal)
else
}
return rc;
}
/**
* Performs and schedules necessary updates following a CR3 load or reload when
* using nested or extended paging.
*
* This API is an alternative to PDMFlushTLB that avoids actually flushing the
* TLB and triggering a SyncCR3.
*
* This will normally involve mapping the guest PD or nPDPT
*
* @returns VBox status code.
* @retval VINF_SUCCESS.
* @retval (If applied when not in nested mode: VINF_PGM_SYNC_CR3 if monitoring
* requires a CR3 sync. This can safely be ignored and overridden since
* the FF will be set too then.)
* @param pVCpu Pointer to the VMCPU.
* @param cr3 The new cr3.
*/
{
/* We assume we're only called in nested paging mode. */
/*
* Remap the CR3 content and adjust the monitoring if CR3 was actually changed.
*/
int rc = VINF_SUCCESS;
{
case PGMMODE_PAE:
case PGMMODE_PAE_NX:
break;
case PGMMODE_AMD64:
case PGMMODE_AMD64_NX:
break;
default:
break;
}
{
AssertRCSuccess(rc); /* Assumes VINF_PGM_SYNC_CR3 doesn't apply to nested paging. */ /** @todo this isn't true for the mac, but we need hw to test/fix this. */
}
return rc;
}
/**
* Synchronize the paging structures.
*
* This function is called in response to the VM_FF_PGM_SYNC_CR3 and
* VM_FF_PGM_SYNC_CR3_NONGLOBAL. Those two force action flags are set
* in several places, most importantly whenever the CR3 is loaded.
*
* @returns VBox status code.
* @param pVCpu Pointer to the VMCPU.
* @param cr0 Guest context CR0 register
* @param cr3 Guest context CR3 register
* @param cr4 Guest context CR4 register
* @param fGlobal Including global page directories or not
*/
{
int rc;
/*
* The pool may have pending stuff and even require a return to ring-3 to
* clear the whole thing.
*/
if (rc != VINF_SUCCESS)
return rc;
/*
* We might be called when we shouldn't.
*
* The mode switching will ensure that the PD is resynced after every mode
* switch. So, if we find ourselves here when in protected or real mode
* we can safely clear the FF and return immediately.
*/
{
return VINF_SUCCESS;
}
/* If global pages are not supported, then all flushes are global. */
if (!(cr4 & X86_CR4_PGE))
fGlobal = true;
VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3), VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL)));
/*
* Check if we need to finish an aborted MapCR3 call (see PGMFlushTLB).
* This should be done before SyncCR3.
*/
{
{
case PGMMODE_PAE:
case PGMMODE_PAE_NX:
break;
case PGMMODE_AMD64:
case PGMMODE_AMD64_NX:
break;
default:
break;
}
{
}
/* Make sure we check for pending pgm pool syncs as we clear VMCPU_FF_PGM_SYNC_CR3 later on! */
if ( rc == VINF_PGM_SYNC_CR3
{
Log(("PGMSyncCR3: pending pgm pool sync after MapCR3!\n"));
#ifdef IN_RING3
#else
if (rc == VINF_PGM_SYNC_CR3)
return VINF_PGM_SYNC_CR3;
#endif
}
}
/*
* Let the 'Bth' function do the work and we'll just keep track of the flags.
*/
if (rc == VINF_SUCCESS)
{
{
/* Go back to ring 3 if a pgm pool sync is again pending. */
return VINF_PGM_SYNC_CR3;
}
{
}
/*
* Check if we have a pending update of the CR3 monitoring.
*/
{
}
}
/*
* Now flush the CR3 (guest context).
*/
if (rc == VINF_SUCCESS)
return rc;
}
/**
* Called whenever CR0 or CR4 in a way which may affect the paging mode.
*
* @returns VBox status code, with the following informational code for
* VM scheduling.
* @retval VINF_SUCCESS if the was no change, or it was successfully dealt with.
* @retval VINF_PGM_CHANGE_MODE if we're in RC or R0 and the mode changes.
* (I.e. not in R3.)
* @retval VINF_EM_SUSPEND or VINF_EM_OFF on a fatal runtime error. (R3 only)
*
* @param pVCpu Pointer to the VMCPU.
* @param cr0 The new cr0.
* @param cr4 The new cr4.
* @param efer The new extended feature enable register.
*/
{
/*
* Calc the new guest mode.
*/
if (!(cr0 & X86_CR0_PE))
else if (!(cr0 & X86_CR0_PG))
else if (!(cr4 & X86_CR4_PAE))
{
}
else if (!(efer & MSR_K6_EFER_LME))
{
if (!(efer & MSR_K6_EFER_NXE))
else
}
else
{
if (!(efer & MSR_K6_EFER_NXE))
else
}
/*
* Did it change?
*/
return VINF_SUCCESS;
/* Flush the TLB */
#ifdef IN_RING3
#else
LogFlow(("PGMChangeMode: returns VINF_PGM_CHANGE_MODE.\n"));
return VINF_PGM_CHANGE_MODE;
#endif
}
/**
* Called by CPUM or REM when CR0.WP changes to 1.
*
* @param pVCpu The cross context virtual CPU structure of the caller.
* @thread EMT
*/
{
/*
* Netware WP0+RO+US hack cleanup when WP0 -> WP1.
*
* Use the counter to judge whether there might be pool pages with active
* hacks in them. If there are, we will be running the risk of messing up
* the guest by allowing it to write to read-only pages. Thus, we have to
* clear the page pool ASAP if there is the slightest chance.
*/
{
Log(("PGMCr0WpEnabled: %llu WP0 hacks active - clearing page pool\n", pVCpu->pgm.s.cNetwareWp0Hacks));
}
}
/**
* Gets the current guest paging mode.
*
*
* @returns The current paging mode.
* @param pVCpu Pointer to the VMCPU.
*/
{
}
/**
* Gets the current shadow paging mode.
*
* @returns The current paging mode.
* @param pVCpu Pointer to the VMCPU.
*/
{
}
/**
* Gets the current host paging mode.
*
* @returns The current paging mode.
* @param pVM Pointer to the VM.
*/
{
{
case SUPPAGINGMODE_32_BIT:
return PGMMODE_32_BIT;
case SUPPAGINGMODE_PAE:
case SUPPAGINGMODE_PAE_GLOBAL:
return PGMMODE_PAE;
case SUPPAGINGMODE_PAE_NX:
return PGMMODE_PAE_NX;
case SUPPAGINGMODE_AMD64:
return PGMMODE_AMD64;
case SUPPAGINGMODE_AMD64_NX:
return PGMMODE_AMD64_NX;
}
return PGMMODE_INVALID;
}
/**
* Get mode name.
*
* @returns read-only name string.
* @param enmMode The mode which name is desired.
*/
{
switch (enmMode)
{
case PGMMODE_REAL: return "Real";
case PGMMODE_PROTECTED: return "Protected";
case PGMMODE_32_BIT: return "32-bit";
case PGMMODE_PAE: return "PAE";
case PGMMODE_PAE_NX: return "PAE+NX";
case PGMMODE_AMD64: return "AMD64";
case PGMMODE_AMD64_NX: return "AMD64+NX";
case PGMMODE_NESTED: return "Nested";
case PGMMODE_EPT: return "EPT";
default: return "unknown mode value";
}
}
/**
* Notification from CPUM that the EFER.NXE bit has changed.
*
* @param pVCpu The virtual CPU for which EFER changed.
* @param fNxe The new NXE state.
*/
{
/** @todo VMCPU_ASSERT_EMT_OR_NOT_RUNNING(pVCpu); */
if (fNxe)
{
/*pVCpu->pgm.s.fGst32BitMbzBigPdeMask - N/A */
/*pVCpu->pgm.s.fGstPaeMbzPdpeMask - N/A */
}
else
{
/*pVCpu->pgm.s.fGst32BitMbzBigPdeMask - N/A */
/*pVCpu->pgm.s.fGstPaeMbzPdpeMask -N/A */
}
}
/**
* Check if any pgm pool pages are marked dirty (not monitored)
*
* @param pVM Pointer to the VM.
*/
{
}
/**
* Check if this VCPU currently owns the PGM lock.
*
* @param pVM Pointer to the VM.
*/
{
}
/**
* Enable or disable large page usage
*
* @returns VBox status code.
* @param pVM Pointer to the VM.
*/
{
return VINF_SUCCESS;
}
/**
* Acquire the PGM lock.
*
* @returns VBox status code
* @param pVM Pointer to the VM.
*/
#if defined(VBOX_STRICT) && defined(IN_RING3)
#else
#endif
{
#if defined(VBOX_STRICT) && defined(IN_RING3)
int rc = PDMCritSectEnterDebug(&pVM->pgm.s.CritSectX, VERR_SEM_BUSY, (uintptr_t)ASMReturnAddress(), RT_SRC_POS_ARGS);
#else
#endif
if (rc == VERR_SEM_BUSY)
#endif
return rc;
}
/**
* Release the PGM lock.
*
* @returns VBox status code
* @param pVM Pointer to the VM.
*/
{
if (rc == VINF_SEM_NESTED)
}
#if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
/**
* Common worker for pgmRZDynMapGCPageOffInlined and pgmRZDynMapGCPageV2Inlined.
*
* @returns VBox status code.
* @param pVM Pointer to the VM.
* @param pVCpu The current CPU.
* @param GCPhys The guest physical address of the page to map. The
* offset bits are not ignored.
* @param ppv Where to return the address corresponding to @a GCPhys.
*/
int pgmRZDynMapGCPageCommon(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void **ppv RTLOG_COMMA_SRC_POS_DECL)
{
/*
* Convert it to a writable page and it on to the dynamic mapper.
*/
int rc;
{
if (RT_SUCCESS(rc))
{
void *pv;
if (RT_SUCCESS(rc))
}
else
}
else
{
}
return rc;
}
#endif /* IN_RC || VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 */
#if !defined(IN_R0) || defined(LOG_ENABLED)
/** Format handler for PGMPAGE.
* @copydoc FNRTSTRFORMATTYPE */
void *pvUser)
{
if (RT_VALID_PTR(pPage))
{
cch = 0;
/* The single char state stuff. */
#define IS_PART_INCLUDED(lvl) ( !(fFlags & RTSTR_F_PRECISION) || cchPrecision == (lvl) || cchPrecision >= (lvl)+10 )
if (IS_PART_INCLUDED(5))
{
}
/* The type. */
if (IS_PART_INCLUDED(4))
{
static const char s_achPageTypes[8][4] = { "INV", "RAM", "MI2", "M2A", "SHA", "ROM", "MIO", "BAD" };
}
/* The numbers. */
if (IS_PART_INCLUDED(3))
{
cch += RTStrFormatNumber(&szTmp[cch], PGM_PAGE_GET_HCPHYS_NA(pPage), 16, 12, 0, RTSTR_F_ZEROPAD | RTSTR_F_64BIT);
}
if (IS_PART_INCLUDED(2))
{
cch += RTStrFormatNumber(&szTmp[cch], PGM_PAGE_GET_PAGEID(pPage), 16, 7, 0, RTSTR_F_ZEROPAD | RTSTR_F_32BIT);
}
if (IS_PART_INCLUDED(6))
{
cch += RTStrFormatNumber(&szTmp[cch], PGM_PAGE_GET_TD_IDX_NA(pPage), 16, 4, 0, RTSTR_F_ZEROPAD | RTSTR_F_16BIT);
}
}
else
return cch;
}
/** Format handler for PGMRAMRANGE.
* @copydoc FNRTSTRFORMATTYPE */
static DECLCALLBACK(size_t) pgmFormatTypeHandlerRamRange(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
void *pvUser)
{
{
char szTmp[80];
}
else
return cch;
}
/** Format type andlers to be registered/deregistered. */
static const struct
{
char szType[24];
} g_aPgmFormatTypes[] =
{
{ "pgmpage", pgmFormatTypeHandlerPage },
{ "pgmramrange", pgmFormatTypeHandlerRamRange }
};
#endif /* !IN_R0 || LOG_ENABLED */
/**
* Registers the global string format types.
*
* This should be called at module load time or in some other manner that ensure
* that it's called exactly one time.
*
* @returns IPRT status code on RTStrFormatTypeRegister failure.
*/
VMMDECL(int) PGMRegisterStringFormatTypes(void)
{
#if !defined(IN_R0) || defined(LOG_ENABLED)
int rc = VINF_SUCCESS;
unsigned i;
{
# ifdef IN_RING0
if (rc == VERR_ALREADY_EXISTS)
{
/* in case of cleanup failure in ring-0 */
}
# endif
}
if (RT_FAILURE(rc))
while (i-- > 0)
return rc;
#else
return VINF_SUCCESS;
#endif
}
/**
* Deregisters the global string format types.
*
* This should be called at module unload time or in some other manner that
* ensure that it's called exactly one time.
*/
VMMDECL(void) PGMDeregisterStringFormatTypes(void)
{
#if !defined(IN_R0) || defined(LOG_ENABLED)
for (unsigned i = 0; i < RT_ELEMENTS(g_aPgmFormatTypes); i++)
#endif
}
#ifdef VBOX_STRICT
/**
* Asserts that there are no mapping conflicts.
*
* @returns Number of conflicts.
* @param pVM Pointer to the VM.
*/
{
unsigned cErrors = 0;
/* Only applies to raw mode -> 1 VPCU */
/*
* Check for mapping conflicts.
*/
{
/** @todo This is slow and should be optimized, but since it's just assertions I don't care now. */
{
if (rc != VERR_PAGE_TABLE_NOT_PRESENT)
{
cErrors++;
break;
}
}
}
return cErrors;
}
/**
* Asserts that everything related to the guest CR3 is correctly shadowed.
*
* This will call PGMAssertNoMappingConflicts() and PGMAssertHandlerAndFlagsInSync(),
* and assert the correctness of the guest CR3 mapping before asserting that the
* shadow page tables is in sync with the guest page tables.
*
* @returns Number of conflicts.
* @param pVM Pointer to the VM.
* @param pVCpu Pointer to the VMCPU.
* @param cr3 The current guest CR3 register value.
* @param cr4 The current guest CR4 register value.
*/
{
return cErrors;
}
#endif /* VBOX_STRICT */