PGMGC.cpp revision 50df3da42ff6589b0ecc4f50f2288811bc370186
/* $Id$ */
/** @file
* PGM - Page Monitor, Guest Context.
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include "PGMInternal.h"
#include <VBox/disopcode.h>
/*******************************************************************************
* Internal Functions *
*******************************************************************************/
#ifndef RT_ARCH_AMD64
/*
* Shadow - 32-bit mode
*/
#define PGM_SHW_TYPE PGM_TYPE_32BIT
#include "PGMGCShw.h"
/* Guest - real mode */
#define PGM_GST_TYPE PGM_TYPE_REAL
#include "PGMGCGst.h"
#include "PGMGCBth.h"
/* Guest - protected mode */
#define PGM_GST_TYPE PGM_TYPE_PROT
#include "PGMGCGst.h"
#include "PGMGCBth.h"
/* Guest - 32-bit mode */
#define PGM_GST_TYPE PGM_TYPE_32BIT
#include "PGMGCGst.h"
#include "PGMGCBth.h"
#endif /* !RT_ARCH_AMD64 */
/*
* Shadow - PAE mode
*/
#define PGM_SHW_TYPE PGM_TYPE_PAE
#include "PGMGCShw.h"
/* Guest - real mode */
#define PGM_GST_TYPE PGM_TYPE_REAL
#include "PGMGCBth.h"
/* Guest - protected mode */
#define PGM_GST_TYPE PGM_TYPE_PROT
#include "PGMGCBth.h"
/* Guest - 32-bit mode */
#define PGM_GST_TYPE PGM_TYPE_32BIT
#include "PGMGCBth.h"
/* Guest - PAE mode */
#define PGM_GST_TYPE PGM_TYPE_PAE
#include "PGMGCGst.h"
#include "PGMGCBth.h"
/*
* Shadow - AMD64 mode
*/
#define PGM_SHW_TYPE PGM_TYPE_AMD64
#include "PGMGCShw.h"
/* Guest - AMD64 mode */
#define PGM_GST_TYPE PGM_TYPE_AMD64
#include "PGMGCGst.h"
#include "PGMGCBth.h"
/**
* Emulation of the invlpg instruction.
*
* @returns VBox status code suitable for scheduling.
* @param pVM VM handle.
* @param GCPtrPage Page to invalidate.
*/
{
/*
* Check for conflicts and pending CR3 monitoring updates.
*/
{
/** @todo && (PGMGstGetPDE(pVM, GCPtrPage) & X86_PDE_P) - FIX THIS NOW!!! */ )
{
LogFlow(("PGMGCInvalidatePage: Conflict!\n"));
return VINF_PGM_SYNC_CR3;
}
{
LogFlow(("PGMGCInvalidatePage: PGM_SYNC_MONITOR_CR3 -> reinterpret instruction in HC\n"));
/** @todo counter for these... */
return VINF_EM_RAW_EMULATE_INSTR;
}
}
/*
* Notify the recompiler so it can record this instruction.
* Failure happens when it's out of space. We'll return to HC in that case.
*/
if (rc == VINF_SUCCESS)
return rc;
}