parent
e4aea2efeb
commit
a19662abc7
|
@ -32,6 +32,7 @@ VBOX_CC_OPT += -DRT_OS_FREEBSD
|
||||||
|
|
||||||
VBOX_CC_OPT += -DVBOX_WITH_REM
|
VBOX_CC_OPT += -DVBOX_WITH_REM
|
||||||
VBOX_CC_OPT += -DVBOX_WITH_2ND_IEM_STEP
|
VBOX_CC_OPT += -DVBOX_WITH_2ND_IEM_STEP
|
||||||
|
VBOX_CC_OPT += -DVBOX_WITH_3RD_IEM_STEP
|
||||||
|
|
||||||
VBOX_CC_OPT += -DVBOX_WITH_HGCM -DVBOX_WITH_HGSMI
|
VBOX_CC_OPT += -DVBOX_WITH_HGCM -DVBOX_WITH_HGSMI
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,8 @@ SRC_CC += VMM/VMMR3/APIC.cpp
|
||||||
SRC_CC += VMM/VMMAll/APICAll.cpp
|
SRC_CC += VMM/VMMAll/APICAll.cpp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
SRC_CC += VMM/VMMR3/MM.cpp
|
||||||
|
|
||||||
CC_OPT += -DVBOX_IN_VMM
|
CC_OPT += -DVBOX_IN_VMM
|
||||||
|
|
||||||
# definitions needed by SSM.cpp
|
# definitions needed by SSM.cpp
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
include $(REP_DIR)/lib/mk/virtualbox5-common.inc
|
include $(REP_DIR)/lib/mk/virtualbox5-common.inc
|
||||||
|
|
||||||
ZLIB_DIR = $(VIRTUALBOX_DIR)/src/libs/zlib-1.2.8
|
ZLIB_DIR = $(VIRTUALBOX_DIR)/src/libs/zlib-1.2.8
|
||||||
LIBXML_DIR = $(VIRTUALBOX_DIR)/src/libs/libxml2-2.9.2
|
LIBXML_DIR = $(VIRTUALBOX_DIR)/src/libs/libxml2-2.9.4
|
||||||
|
|
||||||
INC_DIR += $(ZLIB_DIR)
|
INC_DIR += $(ZLIB_DIR)
|
||||||
INC_DIR += $(LIBXML_DIR)/include
|
INC_DIR += $(LIBXML_DIR)/include
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
570552db8aed1167dc7c910e2693833209ddfede
|
94dea6e6f2eba1626d6c6f96933a121d6ae8a30b
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
LICENSE := GPLv2
|
LICENSE := GPLv2
|
||||||
VERSION := 5.1.14
|
VERSION := 5.1.18
|
||||||
DOWNLOADS := virtualbox.archive virtualbox_sdk.archive
|
DOWNLOADS := virtualbox.archive virtualbox_sdk.archive
|
||||||
|
|
||||||
VIRTUALBOX_TBZ2 := VirtualBox-$(VERSION).tar.bz2
|
VIRTUALBOX_TBZ2 := VirtualBox-$(VERSION).tar.bz2
|
||||||
VIRTUALBOX_SDK_ZIP := VirtualBoxSDK-$(VERSION)-112924.zip
|
VIRTUALBOX_SDK_ZIP := VirtualBoxSDK-$(VERSION)-114002.zip
|
||||||
|
|
||||||
URL(virtualbox) := http://download.virtualbox.org/virtualbox/$(VERSION)/$(VIRTUALBOX_TBZ2)
|
URL(virtualbox) := http://download.virtualbox.org/virtualbox/$(VERSION)/$(VIRTUALBOX_TBZ2)
|
||||||
DIR(virtualbox) := src/app/virtualbox
|
DIR(virtualbox) := src/app/virtualbox
|
||||||
SHA(virtualbox) := 9f5c4880b6a94bf57a6c6e64166753147ccee5e1
|
SHA(virtualbox) := 672939da34addc06a71b20df0a0e47d8c8940f71
|
||||||
|
|
||||||
URL(virtualbox_sdk) := http://download.virtualbox.org/virtualbox/$(VERSION)/$(VIRTUALBOX_SDK_ZIP)
|
URL(virtualbox_sdk) := http://download.virtualbox.org/virtualbox/$(VERSION)/$(VIRTUALBOX_SDK_ZIP)
|
||||||
DIR(virtualbox_sdk) := src/app/virtualbox_sdk
|
DIR(virtualbox_sdk) := src/app/virtualbox_sdk
|
||||||
SHA(virtualbox_sdk) := c94dc6fcd0ccd02d6342865c0c53e7ae16c72acc
|
SHA(virtualbox_sdk) := 3115c50899ababaf5cbdafdc14950ced2e8a2f50
|
||||||
|
|
||||||
PATCHES_DIR := src/virtualbox5/patches
|
PATCHES_DIR := src/virtualbox5/patches
|
||||||
PATCHES_DIR_VBOX4 := src/virtualbox/patches
|
PATCHES_DIR_VBOX4 := src/virtualbox/patches
|
||||||
|
@ -106,7 +106,7 @@ VBOX_CONTENT += $(addprefix include/VBox/, $(VBOX_INC))
|
||||||
VBOX_CONTENT += $(addprefix include/VBox/com/, $(VBOX_INC_COM))
|
VBOX_CONTENT += $(addprefix include/VBox/com/, $(VBOX_INC_COM))
|
||||||
VBOX_CONTENT += include/VBox/HostServices/
|
VBOX_CONTENT += include/VBox/HostServices/
|
||||||
|
|
||||||
VBOX_CONTENT += src/libs/zlib-1.2.8 src/libs/liblzf-3.4 src/libs/libxml2-2.9.2
|
VBOX_CONTENT += src/libs/zlib-1.2.8 src/libs/liblzf-3.4 src/libs/libxml2-2.9.4
|
||||||
VBOX_CONTENT += src/recompiler include/VBox/vmm include/iprt Config.kmk
|
VBOX_CONTENT += src/recompiler include/VBox/vmm include/iprt Config.kmk
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ extern "C" int VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
|
||||||
REGISTER(DeviceE1000);
|
REGISTER(DeviceE1000);
|
||||||
#endif
|
#endif
|
||||||
REGISTER(DeviceICHAC97);
|
REGISTER(DeviceICHAC97);
|
||||||
REGISTER(DeviceHDA);
|
REGISTER(DeviceICH6_HDA);
|
||||||
REGISTER(DeviceOHCI);
|
REGISTER(DeviceOHCI);
|
||||||
REGISTER(DeviceACPI);
|
REGISTER(DeviceACPI);
|
||||||
REGISTER(DeviceDMA);
|
REGISTER(DeviceDMA);
|
||||||
|
|
|
@ -256,13 +256,6 @@ void MMR3HeapFree(void *pv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint64_t MMR3PhysGetRamSize(PVM pVM)
|
|
||||||
{
|
|
||||||
/* when called from REMR3Init, it is expected to return 0 */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int MMR3HyperMapHCPhys(PVM pVM, void *pvR3, RTR0PTR pvR0, RTHCPHYS HCPhys,
|
int MMR3HyperMapHCPhys(PVM pVM, void *pvR3, RTR0PTR pvR0, RTHCPHYS HCPhys,
|
||||||
size_t cb, const char *pszDesc, PRTGCPTR pGCPtr)
|
size_t cb, const char *pszDesc, PRTGCPTR pGCPtr)
|
||||||
{
|
{
|
||||||
|
@ -283,12 +276,6 @@ int MMR3HyperReserve(PVM pVM, unsigned cb, const char *pszDesc, PRTGCPTR pGCPtr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VMMR3DECL(int) MMR3IncreaseBaseReservation(PVM pVM, uint64_t cAddBasePages)
|
|
||||||
{
|
|
||||||
return VINF_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int MMR3AdjustFixedReservation(PVM, int32_t, const char *pszDesc)
|
int MMR3AdjustFixedReservation(PVM, int32_t, const char *pszDesc)
|
||||||
{
|
{
|
||||||
if (VERBOSE_MM)
|
if (VERBOSE_MM)
|
||||||
|
@ -310,79 +297,6 @@ int MMR3HyperMapMMIO2(PVM pVM, PPDMDEVINS pDevIns, uint32_t iSubDev,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Based on 'VBox/VMM/VMMR3/MM.cpp'
|
|
||||||
*/
|
|
||||||
int MMR3InitPaging(PVM pVM)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Query the CFGM values.
|
|
||||||
*/
|
|
||||||
int rc;
|
|
||||||
PCFGMNODE pMMCfg = CFGMR3GetChild(CFGMR3GetRoot(pVM), "MM");
|
|
||||||
if (!pMMCfg)
|
|
||||||
{
|
|
||||||
rc = CFGMR3InsertNode(CFGMR3GetRoot(pVM), "MM", &pMMCfg);
|
|
||||||
AssertRCReturn(rc, rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @cfgm{RamSize, uint64_t, 0, 16TB, 0}
|
|
||||||
* Specifies the size of the base RAM that is to be set up during
|
|
||||||
* VM initialization.
|
|
||||||
*/
|
|
||||||
uint64_t cbRam;
|
|
||||||
rc = CFGMR3QueryU64(CFGMR3GetRoot(pVM), "RamSize", &cbRam);
|
|
||||||
if (rc == VERR_CFGM_VALUE_NOT_FOUND)
|
|
||||||
cbRam = 0;
|
|
||||||
else
|
|
||||||
AssertMsgRCReturn(rc, ("Configuration error: Failed to query integer \"RamSize\", rc=%Rrc.\n", rc), rc);
|
|
||||||
cbRam &= X86_PTE_PAE_PG_MASK;
|
|
||||||
|
|
||||||
/** @cfgm{RamHoleSize, uint32_t, 0, 4032MB, 512MB}
|
|
||||||
* Specifies the size of the memory hole. The memory hole is used
|
|
||||||
* to avoid mapping RAM to the range normally used for PCI memory regions.
|
|
||||||
* Must be aligned on a 4MB boundary. */
|
|
||||||
uint32_t cbRamHole;
|
|
||||||
rc = CFGMR3QueryU32Def(CFGMR3GetRoot(pVM), "RamHoleSize", &cbRamHole, MM_RAM_HOLE_SIZE_DEFAULT);
|
|
||||||
uint64_t const offRamHole = _4G - cbRamHole;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Make the initial memory reservation with GMM.
|
|
||||||
*/
|
|
||||||
LogFlow(("GMMR3INitialReservation missing\n"));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If RamSize is 0 we're done now.
|
|
||||||
*/
|
|
||||||
if (cbRam < PAGE_SIZE)
|
|
||||||
{
|
|
||||||
Log(("MM: No RAM configured\n"));
|
|
||||||
return VINF_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Setup the base ram (PGM).
|
|
||||||
*/
|
|
||||||
if (cbRam > offRamHole)
|
|
||||||
{
|
|
||||||
pVM->mm.s.cbRamBelow4GB = offRamHole;
|
|
||||||
rc = PGMR3PhysRegisterRam(pVM, 0, offRamHole, "Base RAM");
|
|
||||||
if (RT_SUCCESS(rc))
|
|
||||||
{
|
|
||||||
pVM->mm.s.cbRamAbove4GB = cbRam - offRamHole;
|
|
||||||
rc = PGMR3PhysRegisterRam(pVM, _4G, cbRam - offRamHole, "Above 4GB Base RAM");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
pVM->mm.s.cbRamBelow4GB = cbRam;
|
|
||||||
pVM->mm.s.cbRamAbove4GB = 0;
|
|
||||||
rc = PGMR3PhysRegisterRam(pVM, 0, RT_MIN(cbRam, offRamHole), "Base RAM");
|
|
||||||
}
|
|
||||||
|
|
||||||
LogFlow(("MMR3InitPaging: returns %Rrc\n", rc));
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char * MMR3HeapStrDupU(PUVM pUVM, MMTAG enmTag, const char *string)
|
char * MMR3HeapStrDupU(PUVM pUVM, MMTAG enmTag, const char *string)
|
||||||
{
|
{
|
||||||
if (!string)
|
if (!string)
|
||||||
|
@ -472,20 +386,6 @@ VMMDECL(uint32_t) MMHyperHeapPtrToOffset(PVM pVM, void *pv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VMMR3DECL(uint32_t) MMR3PhysGetRamSizeBelow4GB(PVM pVM)
|
|
||||||
{
|
|
||||||
VM_ASSERT_VALID_EXT_RETURN(pVM, UINT32_MAX);
|
|
||||||
return pVM->mm.s.cbRamBelow4GB;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VMMR3DECL(uint64_t) MMR3PhysGetRamSizeAbove4GB(PVM pVM)
|
|
||||||
{
|
|
||||||
VM_ASSERT_VALID_EXT_RETURN(pVM, UINT64_MAX);
|
|
||||||
return pVM->mm.s.cbRamAbove4GB;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
char * MMR3HeapAPrintf(PVM pVM, MMTAG enmTag, const char *pszFormat, ...)
|
char * MMR3HeapAPrintf(PVM pVM, MMTAG enmTag, const char *pszFormat, ...)
|
||||||
|
|
98
repos/ports/src/virtualbox5/patches/mm.patch
Normal file
98
repos/ports/src/virtualbox5/patches/mm.patch
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
--- a/src/app/virtualbox/src/VBox/VMM/VMMR3/MM.cpp
|
||||||
|
+++ b/src/app/virtualbox/src/VBox/VMM/VMMR3/MM.cpp
|
||||||
|
@@ -185,6 +185,7 @@
|
||||||
|
* @returns VBox status code.
|
||||||
|
* @param pUVM Pointer to the user mode VM structure.
|
||||||
|
*/
|
||||||
|
+#if 0
|
||||||
|
VMMR3DECL(int) MMR3InitUVM(PUVM pUVM)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
@@ -208,6 +209,7 @@
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -228,6 +230,7 @@
|
||||||
|
* @returns VBox status code.
|
||||||
|
* @param pVM The cross context VM structure.
|
||||||
|
*/
|
||||||
|
+#if 0
|
||||||
|
VMMR3DECL(int) MMR3Init(PVM pVM)
|
||||||
|
{
|
||||||
|
LogFlow(("MMR3Init\n"));
|
||||||
|
@@ -284,6 +287,7 @@
|
||||||
|
MMR3Term(pVM);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -456,6 +460,7 @@
|
||||||
|
* @returns VBox status code.
|
||||||
|
* @param pVM The cross context VM structure.
|
||||||
|
*/
|
||||||
|
+#if 0
|
||||||
|
VMMR3DECL(int) MMR3Term(PVM pVM)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
@@ -484,6 +489,7 @@
|
||||||
|
|
||||||
|
return VINF_SUCCESS;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -495,6 +501,7 @@
|
||||||
|
* @returns VBox status code.
|
||||||
|
* @param pUVM Pointer to the user mode VM structure.
|
||||||
|
*/
|
||||||
|
+#if 0
|
||||||
|
VMMR3DECL(void) MMR3TermUVM(PUVM pUVM)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
@@ -508,6 +515,7 @@
|
||||||
|
mmR3HeapDestroy(pUVM->mm.s.pHeap);
|
||||||
|
pUVM->mm.s.pHeap = NULL;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -656,6 +664,7 @@
|
||||||
|
* @param pVM The cross context VM structure.
|
||||||
|
* @param cHandyPages The number of handy pages.
|
||||||
|
*/
|
||||||
|
+#if 0
|
||||||
|
VMMR3DECL(int) MMR3ReserveHandyPages(PVM pVM, uint32_t cHandyPages)
|
||||||
|
{
|
||||||
|
AssertReturn(!pVM->mm.s.cHandyPages, VERR_WRONG_ORDER);
|
||||||
|
@@ -671,6 +680,7 @@
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -683,6 +693,7 @@
|
||||||
|
* @param cDeltaFixedPages The number of pages to add (positive) or subtract (negative).
|
||||||
|
* @param pszDesc Some description associated with the reservation.
|
||||||
|
*/
|
||||||
|
+#if 0
|
||||||
|
VMMR3DECL(int) MMR3AdjustFixedReservation(PVM pVM, int32_t cDeltaFixedPages, const char *pszDesc)
|
||||||
|
{
|
||||||
|
const uint32_t cOld = pVM->mm.s.cFixedPages;
|
||||||
|
@@ -697,6 +708,7 @@
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
|
@ -3,9 +3,9 @@ vbox_main.patch
|
||||||
vga_vbva.patch
|
vga_vbva.patch
|
||||||
vmmdev.patch
|
vmmdev.patch
|
||||||
usb.patch
|
usb.patch
|
||||||
vmm.patch
|
|
||||||
iem_wip.patch
|
iem_wip.patch
|
||||||
dbg.patch
|
dbg.patch
|
||||||
dev_e1000.patch
|
dev_e1000.patch
|
||||||
tm_tpr_vbox5.patch
|
tm_tpr_vbox5.patch
|
||||||
vm.patch
|
vm.patch
|
||||||
|
mm.patch
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
--- a/src/app/virtualbox/src/VBox/VMM/VMMR3/EM.cpp
|
|
||||||
+++ b/src/app/virtualbox/src/VBox/VMM/VMMR3/EM.cpp
|
|
||||||
@@ -2211,10 +2227,11 @@
|
|
||||||
*/
|
|
||||||
case VINF_EM_RESCHEDULE_REM:
|
|
||||||
Assert(!pVM->em.s.fIemExecutesAll || pVCpu->em.s.enmState != EMSTATE_IEM);
|
|
||||||
- if (HMIsEnabled(pVM))
|
|
||||||
+ if (HMIsEnabled(pVM) &&
|
|
||||||
+ !(VM_FF_IS_PENDING(pVM, VM_FF_ALL_REM_MASK) || VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_ALL_REM_MASK)))
|
|
||||||
{
|
|
||||||
- Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_REM: %d -> %d (EMSTATE_IEM_THEN_REM)\n",
|
|
||||||
- enmOldState, EMSTATE_IEM_THEN_REM));
|
|
||||||
+ Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_REM: %d, %d -> %d (EMSTATE_IEM_THEN_REM)\n",
|
|
||||||
+ pVCpu->em.s.enmState, enmOldState, EMSTATE_IEM_THEN_REM));
|
|
||||||
if (pVCpu->em.s.enmState != EMSTATE_IEM_THEN_REM)
|
|
||||||
{
|
|
||||||
pVCpu->em.s.enmState = EMSTATE_IEM_THEN_REM;
|
|
|
@ -336,7 +336,7 @@ int SUPR3CallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation,
|
||||||
Vcpu_handler *vcpu_handler = lookup_vcpu_handler(idCpu);
|
Vcpu_handler *vcpu_handler = lookup_vcpu_handler(idCpu);
|
||||||
Assert(vcpu_handler);
|
Assert(vcpu_handler);
|
||||||
if (vcpu_handler)
|
if (vcpu_handler)
|
||||||
vcpu_handler->recall();
|
vcpu_handler->recall(vcpu_handler_list().first());
|
||||||
return VINF_SUCCESS;
|
return VINF_SUCCESS;
|
||||||
}
|
}
|
||||||
case VMMR0_DO_GMM_ALLOCATE_PAGES:
|
case VMMR0_DO_GMM_ALLOCATE_PAGES:
|
||||||
|
@ -628,6 +628,12 @@ int SUPR3CallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation,
|
||||||
|
|
||||||
return VINF_SUCCESS;
|
return VINF_SUCCESS;
|
||||||
}
|
}
|
||||||
|
case VMMR0_DO_GMM_INITIAL_RESERVATION:
|
||||||
|
Genode::log("VMMR0_DO_GMM_INITIAL_RESERVATION called");
|
||||||
|
return VINF_SUCCESS;
|
||||||
|
case VMMR0_DO_GMM_UPDATE_RESERVATION:
|
||||||
|
Genode::log("VMMR0_DO_GMM_UPDATE_RESERVATION called");
|
||||||
|
return VINF_SUCCESS;
|
||||||
default:
|
default:
|
||||||
Genode::error("SUPR3CallVMMR0Ex: unhandled uOperation ", uOperation,
|
Genode::error("SUPR3CallVMMR0Ex: unhandled uOperation ", uOperation,
|
||||||
" ", (int)VMMR0_DO_PGM_ALLOCATE_HANDY_PAGES, " ",
|
" ", (int)VMMR0_DO_PGM_ALLOCATE_HANDY_PAGES, " ",
|
||||||
|
|
|
@ -84,12 +84,11 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
Vmm::Vcpu_other_pd _vcpu;
|
Vmm::Vcpu_other_pd _vcpu;
|
||||||
|
|
||||||
Genode::addr_t _ec_sel;
|
Genode::addr_t _ec_sel;
|
||||||
bool _irq_win;
|
bool _irq_win = false;
|
||||||
|
|
||||||
unsigned int _cpu_id;
|
unsigned int _cpu_id;
|
||||||
|
unsigned int _last_inj_info = 0;
|
||||||
unsigned int _last_inj_info;
|
unsigned int _last_inj_error = 0;
|
||||||
unsigned int _last_inj_error;
|
|
||||||
|
|
||||||
void fpu_save(char * data) {
|
void fpu_save(char * data) {
|
||||||
Assert(!(reinterpret_cast<Genode::addr_t>(data) & 0xF));
|
Assert(!(reinterpret_cast<Genode::addr_t>(data) & 0xF));
|
||||||
|
@ -133,6 +132,15 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
Genode::addr_t _vm_exits = 0;
|
||||||
|
Genode::addr_t _recall_skip = 0;
|
||||||
|
Genode::addr_t _recall_req = 0;
|
||||||
|
Genode::addr_t _recall_inv = 0;
|
||||||
|
Genode::addr_t _recall_drop = 0;
|
||||||
|
Genode::addr_t _irq_request = 0;
|
||||||
|
Genode::addr_t _irq_inject = 0;
|
||||||
|
Genode::addr_t _irq_drop = 0;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
Nova::mword_t mtd;
|
Nova::mword_t mtd;
|
||||||
unsigned intr_state;
|
unsigned intr_state;
|
||||||
|
@ -164,6 +172,8 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
Assert(utcb->actv_state == ACTIVITY_STATE_ACTIVE);
|
Assert(utcb->actv_state == ACTIVITY_STATE_ACTIVE);
|
||||||
Assert(!(utcb->inj_info & IRQ_INJ_VALID_MASK));
|
Assert(!(utcb->inj_info & IRQ_INJ_VALID_MASK));
|
||||||
|
|
||||||
|
_vm_exits ++;
|
||||||
|
|
||||||
/* go back to VirtualBox */
|
/* go back to VirtualBox */
|
||||||
_fpu_save_and_longjmp();
|
_fpu_save_and_longjmp();
|
||||||
}
|
}
|
||||||
|
@ -172,6 +182,9 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
{
|
{
|
||||||
Nova::Utcb * utcb = reinterpret_cast<Nova::Utcb *>(Thread::utcb());
|
Nova::Utcb * utcb = reinterpret_cast<Nova::Utcb *>(Thread::utcb());
|
||||||
|
|
||||||
|
_vm_exits ++;
|
||||||
|
_recall_inv ++;
|
||||||
|
|
||||||
Assert(utcb->actv_state == ACTIVITY_STATE_ACTIVE);
|
Assert(utcb->actv_state == ACTIVITY_STATE_ACTIVE);
|
||||||
|
|
||||||
if (utcb->inj_info & IRQ_INJ_VALID_MASK) {
|
if (utcb->inj_info & IRQ_INJ_VALID_MASK) {
|
||||||
|
@ -184,10 +197,9 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
|
|
||||||
Assert(utcb->intr_state == INTERRUPT_STATE_NONE);
|
Assert(utcb->intr_state == INTERRUPT_STATE_NONE);
|
||||||
|
|
||||||
/*
|
|
||||||
if (!continue_hw_accelerated(utcb))
|
if (!continue_hw_accelerated(utcb))
|
||||||
Vmm::log("WARNING - recall ignored during IRQ delivery");
|
_recall_drop ++;
|
||||||
*/
|
|
||||||
/* got recall during irq injection and the guest is ready for
|
/* got recall during irq injection and the guest is ready for
|
||||||
* delivery of IRQ - just continue */
|
* delivery of IRQ - just continue */
|
||||||
Nova::reply(_stack_reply);
|
Nova::reply(_stack_reply);
|
||||||
|
@ -235,6 +247,7 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
continue_hw_accelerated(utcb, true);
|
continue_hw_accelerated(utcb, true);
|
||||||
|
|
||||||
if (_irq_win) {
|
if (_irq_win) {
|
||||||
|
_irq_drop++;
|
||||||
_irq_win = false;
|
_irq_win = false;
|
||||||
utcb->inj_info = IRQ_INJ_NONE;
|
utcb->inj_info = IRQ_INJ_NONE;
|
||||||
utcb->mtd |= Nova::Mtd::INJ;
|
utcb->mtd |= Nova::Mtd::INJ;
|
||||||
|
@ -583,6 +596,8 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
VMCPU_FF_INTERRUPT_PIC)))
|
VMCPU_FF_INTERRUPT_PIC)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
_irq_request++;
|
||||||
|
|
||||||
unsigned vector = 0;
|
unsigned vector = 0;
|
||||||
utcb->inj_info = NOVA_REQ_IRQWIN_EXIT | vector;
|
utcb->inj_info = NOVA_REQ_IRQWIN_EXIT | vector;
|
||||||
utcb->mtd |= Nova::Mtd::INJ;
|
utcb->mtd |= Nova::Mtd::INJ;
|
||||||
|
@ -595,6 +610,8 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
{
|
{
|
||||||
Nova::Utcb * utcb = reinterpret_cast<Nova::Utcb *>(Thread::utcb());
|
Nova::Utcb * utcb = reinterpret_cast<Nova::Utcb *>(Thread::utcb());
|
||||||
|
|
||||||
|
_vm_exits ++;
|
||||||
|
|
||||||
PVMCPU pVCpu = _current_vcpu;
|
PVMCPU pVCpu = _current_vcpu;
|
||||||
|
|
||||||
Assert(utcb->intr_state == INTERRUPT_STATE_NONE);
|
Assert(utcb->intr_state == INTERRUPT_STATE_NONE);
|
||||||
|
@ -625,12 +642,14 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TRPMHasTrap(pVCpu)) {
|
if (!TRPMHasTrap(pVCpu)) {
|
||||||
|
_irq_drop++;
|
||||||
/* happens if PDMApicSetTPR (see above) mask IRQ */
|
/* happens if PDMApicSetTPR (see above) mask IRQ */
|
||||||
utcb->inj_info = IRQ_INJ_NONE;
|
utcb->inj_info = IRQ_INJ_NONE;
|
||||||
utcb->mtd = Nova::Mtd::INJ | Nova::Mtd::FPU;
|
utcb->mtd = Nova::Mtd::INJ | Nova::Mtd::FPU;
|
||||||
Nova::reply(_stack_reply);
|
Nova::reply(_stack_reply);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_irq_inject++;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we have no IRQ for injection, something with requesting the
|
* If we have no IRQ for injection, something with requesting the
|
||||||
|
@ -773,7 +792,6 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
name),
|
name),
|
||||||
_vcpu(cpu_session, location, pd_vcpu),
|
_vcpu(cpu_session, location, pd_vcpu),
|
||||||
_ec_sel(Genode::cap_map()->insert()),
|
_ec_sel(Genode::cap_map()->insert()),
|
||||||
_irq_win(false),
|
|
||||||
_cpu_id(cpu_id)
|
_cpu_id(cpu_id)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -783,15 +801,41 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
||||||
_vcpu.start(_ec_sel);
|
_vcpu.start(_ec_sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void recall()
|
void recall(Vcpu_handler * other = nullptr)
|
||||||
{
|
{
|
||||||
using namespace Nova;
|
using namespace Nova;
|
||||||
|
|
||||||
|
asm volatile ("":::"memory");
|
||||||
|
|
||||||
|
_recall_req ++;
|
||||||
|
|
||||||
|
if (_irq_win) {
|
||||||
|
_recall_skip ++;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ec_ctrl(EC_RECALL, _ec_sel) != NOVA_OK) {
|
if (ec_ctrl(EC_RECALL, _ec_sel) != NOVA_OK) {
|
||||||
Genode::error("recall failed");
|
Genode::error("recall failed");
|
||||||
Genode::Lock lock(Genode::Lock::LOCKED);
|
Genode::Lock lock(Genode::Lock::LOCKED);
|
||||||
lock.lock();
|
lock.lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
if (_recall_req % 1000 == 0) {
|
||||||
|
using Genode::log;
|
||||||
|
|
||||||
|
while (other) {
|
||||||
|
log(other->_cpu_id, " exits=", other->_vm_exits,
|
||||||
|
" req:skip:drop,inv recall=", other->_recall_req, ":",
|
||||||
|
other->_recall_skip, ":", other->_recall_drop, ":",
|
||||||
|
other->_recall_inv, " req:inj:drop irq=",
|
||||||
|
other->_irq_request, ":", other->_irq_inject, ":",
|
||||||
|
other->_irq_drop);
|
||||||
|
|
||||||
|
other = other->next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void halt(Genode::uint64_t tsc_abs)
|
void halt(Genode::uint64_t tsc_abs)
|
||||||
|
|
|
@ -150,6 +150,8 @@ class Vcpu_handler_vmx : public Vcpu_handler
|
||||||
if (cr == 8)
|
if (cr == 8)
|
||||||
_default_handler();
|
_default_handler();
|
||||||
|
|
||||||
|
_vm_exits ++;
|
||||||
|
|
||||||
Genode::uint64_t *pdpte = pdpte_map(_current_vm, utcb->cr3);
|
Genode::uint64_t *pdpte = pdpte_map(_current_vm, utcb->cr3);
|
||||||
|
|
||||||
Assert(pdpte != 0);
|
Assert(pdpte != 0);
|
||||||
|
@ -198,6 +200,8 @@ class Vcpu_handler_vmx : public Vcpu_handler
|
||||||
/* we don't support tsc offsetting for now - so let the rdtsc exit */
|
/* we don't support tsc offsetting for now - so let the rdtsc exit */
|
||||||
register_handler<VMX_EXIT_RDTSC, This,
|
register_handler<VMX_EXIT_RDTSC, This,
|
||||||
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
|
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
|
||||||
|
register_handler<VMX_EXIT_RDTSCP, This,
|
||||||
|
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
|
||||||
|
|
||||||
register_handler<VMX_EXIT_VMCALL, This,
|
register_handler<VMX_EXIT_VMCALL, This,
|
||||||
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
|
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
|
||||||
|
|
|
@ -215,8 +215,7 @@ int SUPSemEventWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SUPDECL(int) SUPSemEventMultiCreate(PSUPDRVSESSION,
|
int SUPSemEventMultiCreate(PSUPDRVSESSION, PSUPSEMEVENTMULTI phEventMulti)
|
||||||
PSUPSEMEVENTMULTI phEventMulti)
|
|
||||||
{
|
{
|
||||||
RTSEMEVENTMULTI sem;
|
RTSEMEVENTMULTI sem;
|
||||||
|
|
||||||
|
@ -236,11 +235,22 @@ SUPDECL(int) SUPSemEventMultiCreate(PSUPDRVSESSION,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SUPDECL(int) SUPSemEventMultiClose(PSUPDRVSESSION, SUPSEMEVENTMULTI hEvMulti)
|
int SUPSemEventMultiWaitNoResume(PSUPDRVSESSION, SUPSEMEVENTMULTI event,
|
||||||
|
uint32_t ms)
|
||||||
{
|
{
|
||||||
return RTSemEventMultiDestroy(reinterpret_cast<RTSEMEVENTMULTI>(hEvMulti));
|
RTSEMEVENTMULTI const rtevent = reinterpret_cast<RTSEMEVENTMULTI>(event);
|
||||||
|
return RTSemEventMultiWait(rtevent, ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SUPSemEventMultiSignal(PSUPDRVSESSION, SUPSEMEVENTMULTI event) {
|
||||||
|
return RTSemEventMultiSignal(reinterpret_cast<RTSEMEVENTMULTI>(event)); }
|
||||||
|
|
||||||
|
int SUPSemEventMultiReset(PSUPDRVSESSION, SUPSEMEVENTMULTI event) {
|
||||||
|
return RTSemEventMultiReset(reinterpret_cast<RTSEMEVENTMULTI>(event)); }
|
||||||
|
|
||||||
|
int SUPSemEventMultiClose(PSUPDRVSESSION, SUPSEMEVENTMULTI event) {
|
||||||
|
return RTSemEventMultiDestroy(reinterpret_cast<RTSEMEVENTMULTI>(event)); }
|
||||||
|
|
||||||
|
|
||||||
int SUPR3CallVMMR0(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation,
|
int SUPR3CallVMMR0(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation,
|
||||||
void *pvArg)
|
void *pvArg)
|
||||||
|
|
|
@ -41,6 +41,7 @@ SRC_CC += HostServices/SharedFolders/service.cpp
|
||||||
SRC_CC += HostServices/SharedFolders/mappings.cpp
|
SRC_CC += HostServices/SharedFolders/mappings.cpp
|
||||||
SRC_CC += HostServices/SharedFolders/vbsf.cpp
|
SRC_CC += HostServices/SharedFolders/vbsf.cpp
|
||||||
SRC_CC += HostServices/SharedFolders/vbsfpath.cpp
|
SRC_CC += HostServices/SharedFolders/vbsfpath.cpp
|
||||||
|
SRC_CC += HostServices/SharedFolders/vbsfpathabs.cpp
|
||||||
SRC_CC += HostServices/SharedFolders/shflhandle.cpp
|
SRC_CC += HostServices/SharedFolders/shflhandle.cpp
|
||||||
|
|
||||||
SRC_CC += HostServices/SharedClipboard/service.cpp
|
SRC_CC += HostServices/SharedClipboard/service.cpp
|
||||||
|
|
|
@ -136,10 +136,6 @@ DUMMY(SUPR3PageMapKernel)
|
||||||
DUMMY(SUPR3ReadTsc)
|
DUMMY(SUPR3ReadTsc)
|
||||||
DUMMY(SUPGetCpuHzFromGipForAsyncMode)
|
DUMMY(SUPGetCpuHzFromGipForAsyncMode)
|
||||||
|
|
||||||
DUMMY(SUPSemEventMultiSignal)
|
|
||||||
DUMMY(SUPSemEventMultiWaitNoResume)
|
|
||||||
DUMMY(SUPSemEventMultiReset)
|
|
||||||
|
|
||||||
DUMMY(VMMR3GetHostToGuestSwitcher)
|
DUMMY(VMMR3GetHostToGuestSwitcher)
|
||||||
|
|
||||||
DUMMY(RTHeapSimpleRelocate)
|
DUMMY(RTHeapSimpleRelocate)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user