REMAll.cpp revision c58f1213e628a545081c70e26c6b67a841cff880
/* $Id$ */
/** @file
* REM - Recompiled Execution Monitor, all Contexts part.
*/
/*
* 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_REM
#ifdef VBOX_WITH_REM
#endif
#include "REMInternal.h"
#ifndef IN_RING3
/**
* Records a invlpg instruction for replaying upon REM entry.
*
* @param pVM Pointer to the VM.
* @param GCPtrPage The
*/
{
/*
* Try take the REM lock and push the address onto the array.
*/
{
{
return;
}
CPUMSetChangedFlags(VMMGetCpu(pVM), CPUM_CHANGED_GLOBAL_TLB_FLUSH); /** @todo this array should be per-cpu technically speaking. */
ASMAtomicWriteU32(&pVM->rem.s.cInvalidatedPages, 0); /** @todo leave this alone? Optimize this code? */
}
else
{
/* Fallback: Simply tell the recompiler to flush its TLB. */
ASMAtomicWriteU32(&pVM->rem.s.cInvalidatedPages, 0); /** @todo leave this alone?! Optimize this code? */
}
return;
}
/**
* Insert pending notification
*
* @param pVM Pointer to the VM.
* @param pRec Notification record to insert
*/
{
/*
* Fetch a free record.
*/
do
{
if (idxFree == UINT32_MAX)
{
do
{
cFlushes++;
} while (idxFree == UINT32_MAX);
}
/*
* Copy the record.
*/
/*
* Insert it into the pending list.
*/
do
{
}
/**
* Notification about a successful PGMR3HandlerPhysicalRegister() call.
*
* @param pVM Pointer to the VM.
* @param enmType Handler type.
* @param GCPhys Handler range address.
* @param cb Size of the handler range.
* @param fHasHCHandler Set if the handler have a HC callback function.
*/
VMMDECL(void) REMNotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler)
{
}
/**
* Notification about a successful PGMR3HandlerPhysicalDeregister() operation.
*
* @param pVM Pointer to the VM.
* @param enmType Handler type.
* @param GCPhys Handler range address.
* @param cb Size of the handler range.
* @param fHasHCHandler Set if the handler have a HC callback function.
* @param fRestoreAsRAM Whether the to restore it as normal RAM or as unassigned memory.
*/
VMMDECL(void) REMNotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
{
}
/**
* Notification about a successful PGMR3HandlerPhysicalModify() call.
*
* @param pVM Pointer to the VM.
* @param enmType Handler type.
* @param GCPhysOld Old handler range address.
* @param GCPhysNew New handler range address.
* @param cb Size of the handler range.
* @param fHasHCHandler Set if the handler have a HC callback function.
* @param fRestoreAsRAM Whether the to restore it as normal RAM or as unassigned memory.
*/
VMMDECL(void) REMNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
{
}
#endif /* !IN_RING3 */
#ifdef IN_RC
/**
* Flushes the physical handler notifications if the queue is almost full.
*
* This is for avoiding trouble in RC when changing CR3.
*
* @param pVM Pointer to the VM.
* @param pVCpu Pointer to the VMCPU of the calling EMT.
*/
{
/*
* Less than 48 items means we should flush.
*/
idx != UINT32_MAX;
{
if (++cFree >= 48)
return;
}
/* Ok, we gotta flush them. */
}
#endif /* IN_RC */
/**
* Make REM flush all translation block upon the next call to REMR3State().
*
* @param pVM Pointer to the VM.
*/
{
LogFlow(("REMFlushTBs: fFlushTBs=%RTbool fInREM=%RTbool fInStateSync=%RTbool\n",
}