GIMHv.cpp revision 157093a77f2752732368338110cb50fa6cd7717f
/* $Id$ */
/** @file
* GIM - Guest Interface Manager, Hyper-V implementation.
*/
/*
* Copyright (C) 2014 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_GIM
#include "GIMInternal.h"
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
//#define GIMHV_HYPERCALL "GIMHvHypercall"
#ifdef VBOX_WITH_STATISTICS
{ (a_uFirst), (a_uLast), kCpumMsrRdFn_Gim, kCpumMsrWrFn_Gim, 0, 0, 0, 0, 0, a_szName, { 0 }, { 0 }, { 0 }, { 0 } }
#else
#endif
/**
* Array of MSR ranges supported by Hyper-V.
*/
static CPUMMSRRANGE const g_aMsrRanges_HyperV[] =
{
};
/**
* Initializes the Hyper-V GIM provider.
*
* @returns VBox status code.
* @param pVM Pointer to the VM.
* @param uVersion The interface version this VM should use.
*/
{
int rc;
/*
* Determine interface capabilities based on the version.
*/
{
//| GIM_HV_BASE_FEAT_VP_RUNTIME_MSR
//| GIM_HV_BASE_FEAT_BASIC_SYNTH_IC
//| GIM_HV_BASE_FEAT_SYNTH_TIMER_MSRS
//| GIM_HV_BASE_FEAT_APIC_ACCESS_MSRS
//| GIM_HV_BASE_FEAT_VIRT_SYS_RESET_MSR
//| GIM_HV_BASE_FEAT_STAT_PAGES_MSR
//| GIM_HV_BASE_FEAT_GUEST_IDLE_STATE_MSR
//| GIM_HV_BASE_FEAT_DEBUG_MSRS
;
}
/*
* Populate the required fields in MMIO2 region records for registering.
*/
/*
* Make sure the CPU ID bit are in accordance to the Hyper-V
* requirement and other paranoia checks.
* See "Requirements for implementing the Microsoft hypervisor interface" spec.
*/
{
}
/*
* Expose HVP (Hypervisor Present) bit to the guest.
*/
/*
* Modify the standard hypervisor leaves for Hyper-V.
*/
/*
* Add Hyper-V specific leaves.
*/
/*
* Insert all MSR ranges of Hyper-V.
*/
for (unsigned i = 0; i < RT_ELEMENTS(g_aMsrRanges_HyperV); i++)
{
}
return VINF_SUCCESS;
}
#if 0
{
if (!HMIsEnabled(pVM))
{
}
}
#endif
{
#if 0
int rc = PDMR3LdrGetSymbolRC(pVM, NULL /* pszModule */, GIMHV_HYPERCALL, &pVM->gim.s.pfnHypercallRC);
#endif
}
/**
* The VM is being reset. This resets Hyper-V provider MSRs and unmaps whatever
* Hyper-V regions that the guest may have mapped.
*
* @param pVM Pointer to the VM.
*/
{
/*
* Unmap MMIO2 pages that the guest may have setup.
*/
{
}
/*
* Reset MSRs.
*/
pHv->u64GuestOsIdMsr = 0;
pHv->u64HypercallMsr = 0;
pHv->u64TscPageMsr = 0;
}
/**
* Returns a pointer to the MMIO2 regions supported by Hyper-V.
*
* @returns Pointer to an array of MMIO2 regions.
* @param pVM Pointer to the VM.
* @param pcRegions Where to store the number of regions in the array.
*/
{
return pHv->aMmio2Regions;
}