vbox5: update to 5.1.18

Issue #2338
This commit is contained in:
Alexander Boettcher 2017-03-10 14:37:15 +01:00 committed by Christian Helmuth
parent e4aea2efeb
commit a19662abc7
16 changed files with 191 additions and 146 deletions

View File

@ -32,6 +32,7 @@ VBOX_CC_OPT += -DRT_OS_FREEBSD
VBOX_CC_OPT += -DVBOX_WITH_REM
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

View File

@ -92,6 +92,8 @@ SRC_CC += VMM/VMMR3/APIC.cpp
SRC_CC += VMM/VMMAll/APICAll.cpp
endif
SRC_CC += VMM/VMMR3/MM.cpp
CC_OPT += -DVBOX_IN_VMM
# definitions needed by SSM.cpp

View File

@ -1,7 +1,7 @@
include $(REP_DIR)/lib/mk/virtualbox5-common.inc
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 += $(LIBXML_DIR)/include

View File

@ -1 +1 @@
570552db8aed1167dc7c910e2693833209ddfede
94dea6e6f2eba1626d6c6f96933a121d6ae8a30b

View File

@ -1,17 +1,17 @@
LICENSE := GPLv2
VERSION := 5.1.14
VERSION := 5.1.18
DOWNLOADS := virtualbox.archive virtualbox_sdk.archive
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)
DIR(virtualbox) := src/app/virtualbox
SHA(virtualbox) := 9f5c4880b6a94bf57a6c6e64166753147ccee5e1
SHA(virtualbox) := 672939da34addc06a71b20df0a0e47d8c8940f71
URL(virtualbox_sdk) := http://download.virtualbox.org/virtualbox/$(VERSION)/$(VIRTUALBOX_SDK_ZIP)
DIR(virtualbox_sdk) := src/app/virtualbox_sdk
SHA(virtualbox_sdk) := c94dc6fcd0ccd02d6342865c0c53e7ae16c72acc
SHA(virtualbox_sdk) := 3115c50899ababaf5cbdafdc14950ced2e8a2f50
PATCHES_DIR := src/virtualbox5/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 += 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

View File

@ -55,7 +55,7 @@ extern "C" int VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
REGISTER(DeviceE1000);
#endif
REGISTER(DeviceICHAC97);
REGISTER(DeviceHDA);
REGISTER(DeviceICH6_HDA);
REGISTER(DeviceOHCI);
REGISTER(DeviceACPI);
REGISTER(DeviceDMA);

View File

@ -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,
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)
{
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)
{
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" {
char * MMR3HeapAPrintf(PVM pVM, MMTAG enmTag, const char *pszFormat, ...)

View 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
/**

View File

@ -3,9 +3,9 @@ vbox_main.patch
vga_vbva.patch
vmmdev.patch
usb.patch
vmm.patch
iem_wip.patch
dbg.patch
dev_e1000.patch
tm_tpr_vbox5.patch
vm.patch
mm.patch

View File

@ -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;

View File

@ -336,7 +336,7 @@ int SUPR3CallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation,
Vcpu_handler *vcpu_handler = lookup_vcpu_handler(idCpu);
Assert(vcpu_handler);
if (vcpu_handler)
vcpu_handler->recall();
vcpu_handler->recall(vcpu_handler_list().first());
return VINF_SUCCESS;
}
case VMMR0_DO_GMM_ALLOCATE_PAGES:
@ -628,6 +628,12 @@ int SUPR3CallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation,
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:
Genode::error("SUPR3CallVMMR0Ex: unhandled uOperation ", uOperation,
" ", (int)VMMR0_DO_PGM_ALLOCATE_HANDY_PAGES, " ",

View File

@ -83,13 +83,12 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
Vmm::Vcpu_other_pd _vcpu;
Genode::addr_t _ec_sel;
bool _irq_win;
Genode::addr_t _ec_sel;
bool _irq_win = false;
unsigned int _cpu_id;
unsigned int _last_inj_info;
unsigned int _last_inj_error;
unsigned int _cpu_id;
unsigned int _last_inj_info = 0;
unsigned int _last_inj_error = 0;
void fpu_save(char * data) {
Assert(!(reinterpret_cast<Genode::addr_t>(data) & 0xF));
@ -133,6 +132,15 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
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 {
Nova::mword_t mtd;
unsigned intr_state;
@ -164,6 +172,8 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
Assert(utcb->actv_state == ACTIVITY_STATE_ACTIVE);
Assert(!(utcb->inj_info & IRQ_INJ_VALID_MASK));
_vm_exits ++;
/* go back to VirtualBox */
_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());
_vm_exits ++;
_recall_inv ++;
Assert(utcb->actv_state == ACTIVITY_STATE_ACTIVE);
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);
/*
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
* delivery of IRQ - just continue */
Nova::reply(_stack_reply);
@ -235,6 +247,7 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
continue_hw_accelerated(utcb, true);
if (_irq_win) {
_irq_drop++;
_irq_win = false;
utcb->inj_info = IRQ_INJ_NONE;
utcb->mtd |= Nova::Mtd::INJ;
@ -583,6 +596,8 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
VMCPU_FF_INTERRUPT_PIC)))
return false;
_irq_request++;
unsigned vector = 0;
utcb->inj_info = NOVA_REQ_IRQWIN_EXIT | vector;
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());
_vm_exits ++;
PVMCPU pVCpu = _current_vcpu;
Assert(utcb->intr_state == INTERRUPT_STATE_NONE);
@ -625,12 +642,14 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
}
if (!TRPMHasTrap(pVCpu)) {
_irq_drop++;
/* happens if PDMApicSetTPR (see above) mask IRQ */
utcb->inj_info = IRQ_INJ_NONE;
utcb->mtd = Nova::Mtd::INJ | Nova::Mtd::FPU;
Nova::reply(_stack_reply);
}
}
_irq_inject++;
/*
* If we have no IRQ for injection, something with requesting the
@ -773,7 +792,6 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
name),
_vcpu(cpu_session, location, pd_vcpu),
_ec_sel(Genode::cap_map()->insert()),
_irq_win(false),
_cpu_id(cpu_id)
{ }
@ -783,15 +801,41 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
_vcpu.start(_ec_sel);
}
void recall()
void recall(Vcpu_handler * other = nullptr)
{
using namespace Nova;
asm volatile ("":::"memory");
_recall_req ++;
if (_irq_win) {
_recall_skip ++;
return;
}
if (ec_ctrl(EC_RECALL, _ec_sel) != NOVA_OK) {
Genode::error("recall failed");
Genode::Lock lock(Genode::Lock::LOCKED);
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)

View File

@ -150,6 +150,8 @@ class Vcpu_handler_vmx : public Vcpu_handler
if (cr == 8)
_default_handler();
_vm_exits ++;
Genode::uint64_t *pdpte = pdpte_map(_current_vm, utcb->cr3);
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 */
register_handler<VMX_EXIT_RDTSC, This,
&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,
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);

View File

@ -215,8 +215,7 @@ int SUPSemEventWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent,
}
SUPDECL(int) SUPSemEventMultiCreate(PSUPDRVSESSION,
PSUPSEMEVENTMULTI phEventMulti)
int SUPSemEventMultiCreate(PSUPDRVSESSION, PSUPSEMEVENTMULTI phEventMulti)
{
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,
void *pvArg)

View File

@ -41,6 +41,7 @@ SRC_CC += HostServices/SharedFolders/service.cpp
SRC_CC += HostServices/SharedFolders/mappings.cpp
SRC_CC += HostServices/SharedFolders/vbsf.cpp
SRC_CC += HostServices/SharedFolders/vbsfpath.cpp
SRC_CC += HostServices/SharedFolders/vbsfpathabs.cpp
SRC_CC += HostServices/SharedFolders/shflhandle.cpp
SRC_CC += HostServices/SharedClipboard/service.cpp

View File

@ -136,10 +136,6 @@ DUMMY(SUPR3PageMapKernel)
DUMMY(SUPR3ReadTsc)
DUMMY(SUPGetCpuHzFromGipForAsyncMode)
DUMMY(SUPSemEventMultiSignal)
DUMMY(SUPSemEventMultiWaitNoResume)
DUMMY(SUPSemEventMultiReset)
DUMMY(VMMR3GetHostToGuestSwitcher)
DUMMY(RTHeapSimpleRelocate)