tstVMM.cpp revision a0ed9c35186427ae0abbd14b1cfdf43bf2dc8659
/* $Id$ */
/** @file
* VMM Testcase.
*/
/*
* Copyright (C) 2006-2013 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 *
*******************************************************************************/
#include <iprt/initterm.h>
#include <iprt/semaphore.h>
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
#define TESTCASE "tstVMM"
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/*******************************************************************************
* Internal Functions *
*******************************************************************************/
/** Dummy timer callback. */
{
}
/**
* This is called on each EMT and will beat TM.
*
* @returns VINF_SUCCESS, test failure is reported via RTTEST.
* @param pVM Pointer to the VM.
* @param hTest The test handle.
*/
{
/*
* Create the test set.
*/
int rc;
{
}
/*
* The run loop.
*/
unsigned uPrevPct = 0;
{
while (cLeft-- > 0)
{
&& TMTimerIsActive(pTimer))
{
}
else
{
}
/* next */
}
if (i % 3)
/* Progress report. */
{
if (!(uPct % 10))
}
}
return 0;
}
/** PDMR3LdrEnumModules callback, see FNPDMR3ENUM. */
static DECLCALLBACK(int)
tstVMMLdrEnum(PVM pVM, const char *pszFilename, const char *pszName, RTUINTPTR ImageBase, size_t cbImage,
{
return VINF_SUCCESS;
}
static DECLCALLBACK(int)
{
if (RT_SUCCESS(rc))
{
if (g_cCpus < 2)
{
}
else if (g_cCpus > 1)
{
}
}
return rc;
}
/**
* Entry point.
*/
{
/*
* Init runtime and the test environment.
*/
if (rcExit != RTEXITCODE_SUCCESS)
return rcExit;
/*
* Parse arguments.
*/
static const RTGETOPTDEF s_aOptions[] =
{
};
enum
{
kTstVMMTest_VMM, kTstVMMTest_TM, kTstVMMTest_MSRs, kTstVMMTest_KnownMSRs, kTstVMMTest_MSRExperiments
int ch;
{
switch (ch)
{
case 'c':
break;
case 't':
else
{
return 1;
}
break;
case 'h':
RTPrintf("usage: tstVMM [--cpus|-c cpus] [--test <vmm|tm|msrs|known-msrs>]\n");
return 1;
case 'V':
RTPrintf("$Revision$\n");
return 0;
default:
}
}
/*
* Create the test VM.
*/
if (RT_SUCCESS(rc))
{
RTThreadSleep(256);
/*
* Do the requested testing.
*/
switch (enmTestOpt)
{
case kTstVMMTest_VMM:
{
if (RT_FAILURE(rc))
break;
}
case kTstVMMTest_TM:
{
{
if (RT_FAILURE(rc))
}
if (RT_FAILURE(rc))
break;
}
case kTstVMMTest_MSRs:
{
if (g_cCpus == 1)
{
if (RT_FAILURE(rc))
}
else
break;
}
case kTstVMMTest_KnownMSRs:
{
if (g_cCpus == 1)
{
if (RT_FAILURE(rc))
}
else
break;
}
{
if (g_cCpus == 1)
{
if (RT_FAILURE(rc))
}
else
break;
}
}
/*
* Cleanup.
*/
if (RT_FAILURE(rc))
if (RT_FAILURE(rc))
}
else
return RTTestSummaryAndDestroy(hTest);
}
#if !defined(VBOX_WITH_HARDENING) || !defined(RT_OS_WINDOWS)
/**
* Main entry point.
*/
{
}
#endif