mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
vbox: Add platform-specific setup machine hook
Add call to genode_setup_machine prior to machine registration in frontend machine setup code. This enables platform-specific adjustments to the machine instance. The new function is used on hw_x86_64_muen to clamp the processor count to 1 as multiple virtual CPUs are not supported on this platform. Issue #2016
This commit is contained in:
parent
e3fbeeb25e
commit
6d28ea1c5c
@ -1,11 +1,16 @@
|
||||
include $(REP_DIR)/lib/mk/virtualbox-common.inc
|
||||
|
||||
LIBS += stdcxx
|
||||
|
||||
SRC_CC = pgm.cc sup.cc
|
||||
|
||||
INC_DIR += $(call select_from_repositories,src/lib/libc)
|
||||
|
||||
INC_DIR += $(VBOX_DIR)/Main/xml
|
||||
INC_DIR += $(VBOX_DIR)/Main/include
|
||||
INC_DIR += $(VBOX_DIR)/VMM/include
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox/frontend
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox/spec/muen
|
||||
|
||||
vpath pgm.cc $(REP_DIR)/src/virtualbox/
|
||||
|
@ -1,12 +1,17 @@
|
||||
include $(REP_DIR)/lib/mk/virtualbox-common.inc
|
||||
|
||||
LIBS += stdcxx
|
||||
|
||||
SRC_CC = sup.cc pgm.cc
|
||||
|
||||
INC_DIR += $(call select_from_repositories,src/lib/libc)
|
||||
INC_DIR += $(call select_from_repositories,src/lib/pthread)
|
||||
|
||||
INC_DIR += $(VBOX_DIR)/Main/xml
|
||||
INC_DIR += $(VBOX_DIR)/Main/include
|
||||
INC_DIR += $(VBOX_DIR)/VMM/include
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox/frontend
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox/spec/nova
|
||||
|
||||
vpath pgm.cc $(REP_DIR)/src/virtualbox/
|
||||
|
@ -1,10 +1,15 @@
|
||||
include $(REP_DIR)/lib/mk/virtualbox-common.inc
|
||||
|
||||
LIBS += stdcxx
|
||||
|
||||
SRC_CC = pgm.cc sup.cc
|
||||
|
||||
INC_DIR += $(call select_from_repositories,src/lib/libc)
|
||||
INC_DIR += $(VBOX_DIR)/Main/xml
|
||||
INC_DIR += $(VBOX_DIR)/Main/include
|
||||
INC_DIR += $(VBOX_DIR)/VMM/include
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox/frontend
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox/accloff
|
||||
|
||||
vpath pgm.cc $(REP_DIR)/src/virtualbox/
|
||||
|
@ -67,6 +67,7 @@ SRC_CC += Main/glue/xpcom/helpers.cpp
|
||||
|
||||
INC_DIR += $(VBOX_DIR)/Main/xml
|
||||
INC_DIR += $(VBOX_DIR)/Main/include
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox/frontend
|
||||
INC_DIR += $(REP_DIR)/src/virtualbox/frontend/VBoxAPIWrap
|
||||
|
||||
|
@ -123,6 +123,9 @@ void genode_update_tsc(void (*update_func)(void), unsigned long update_us)
|
||||
}
|
||||
|
||||
|
||||
HRESULT genode_setup_machine(ComObjPtr<Machine> machine) { return S_OK; }
|
||||
|
||||
|
||||
bool Vmm_memory::revoke_from_vm(Mem_region *r)
|
||||
{
|
||||
PWRN("%s unimplemented", __func__);
|
||||
|
@ -34,6 +34,7 @@
|
||||
/* Genode port specific includes */
|
||||
#include "console.h"
|
||||
#include "fb.h"
|
||||
#include "../sup.h"
|
||||
|
||||
static char c_vbox_file[128];
|
||||
static char c_vbox_vmname[128];
|
||||
@ -106,6 +107,10 @@ HRESULT setupmachine()
|
||||
if (FAILED(rc))
|
||||
return rc;
|
||||
|
||||
rc = genode_setup_machine(machine);
|
||||
if (FAILED(rc))
|
||||
return rc;
|
||||
|
||||
rc = virtualbox->RegisterMachine(machine);
|
||||
if (FAILED(rc))
|
||||
return rc;
|
||||
|
@ -747,6 +747,25 @@ uint64_t genode_cpu_hz()
|
||||
}
|
||||
|
||||
|
||||
HRESULT genode_setup_machine(ComObjPtr<Machine> machine)
|
||||
{
|
||||
HRESULT rc;
|
||||
ULONG cCpus;
|
||||
rc = machine->COMGETTER(CPUCount)(&cCpus);
|
||||
if (FAILED(rc))
|
||||
return rc;
|
||||
|
||||
if (cCpus != 1) {
|
||||
PWRN("Configured CPUs %u not supported, reducing to 1.", cCpus);
|
||||
rc = machine->COMSETTER(CPUCount)(1);
|
||||
if (FAILED(rc))
|
||||
return rc;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Dummies and unimplemented stuff.
|
||||
*/
|
||||
|
@ -216,6 +216,9 @@ void genode_update_tsc(void (*update_func)(void), unsigned long update_us)
|
||||
}
|
||||
|
||||
|
||||
HRESULT genode_setup_machine(ComObjPtr<Machine> machine) { return S_OK; }
|
||||
|
||||
|
||||
bool Vmm_memory::revoke_from_vm(Mem_region *r)
|
||||
{
|
||||
Assert(r);
|
||||
|
@ -20,8 +20,11 @@
|
||||
/* VirtualBox includes */
|
||||
#include <VBox/vmm/vm.h>
|
||||
#include <VBox/vmm/gvmm.h>
|
||||
#include <VBox/com/ptr.h>
|
||||
#include <iprt/param.h>
|
||||
|
||||
#include "MachineImpl.h"
|
||||
|
||||
/**
|
||||
* Returns true if a vCPU could be started. If false we run without
|
||||
* hardware acceleration support.
|
||||
@ -42,4 +45,6 @@ Genode::Cpu_session * get_vcpu_cpu_session();
|
||||
void genode_VMMR0_DO_GVMM_CREATE_VM(PSUPVMMR0REQHDR pReqHdr);
|
||||
void genode_VMMR0_DO_GVMM_REGISTER_VMCPU(PVMR0 pVMR0, VMCPUID idCpu);
|
||||
|
||||
HRESULT genode_setup_machine(ComObjPtr<Machine> machine);
|
||||
|
||||
#endif /* _SUP_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user