genode/repos/ports/src/virtualbox5/patches/tm_smp.patch
Alexander Boettcher 57b90e8d75 vmm: experimental virtualbox 5 support
The main feature for this version upgrade is the use of the instruction
emulator (IEM) to speed up execution and less often the slow recompiler.

issue #2059
2016-08-29 17:29:32 +02:00

36 lines
1.7 KiB
Diff

tm_smp.patch
diff --git a/src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp b/src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp
index c3bc22d..33d705c 100644
--- a/src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp
+++ b/src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp
@@ -210,7 +210,7 @@ VMM_INT_DECL(int) TMR3Init(PVM pVM)
pVM->tm.s.paTimerQueuesRC = MMHyperR3ToRC(pVM, pv);
pVM->tm.s.offVM = RT_OFFSETOF(VM, tm.s);
- pVM->tm.s.idTimerCpu = pVM->cCpus - 1; /* The last CPU. */
+ pVM->tm.s.idTimerCpu = 0; /* The first CPU. */
pVM->tm.s.paTimerQueuesR3[TMCLOCK_VIRTUAL].enmClock = TMCLOCK_VIRTUAL;
pVM->tm.s.paTimerQueuesR3[TMCLOCK_VIRTUAL].u64Expire = INT64_MAX;
pVM->tm.s.paTimerQueuesR3[TMCLOCK_VIRTUAL_SYNC].enmClock = TMCLOCK_VIRTUAL_SYNC;
@@ -1901,10 +1901,18 @@ static DECLCALLBACK(void) tmR3TimerCallback(PRTTIMER pTimer, void *pvUser, uint6
AssertCompile(TMCLOCK_MAX == 4);
STAM_COUNTER_INC(&pVM->tm.s.StatTimerCallback);
+ if (VMCPU_FF_IS_SET(pVCpuDst, VMCPU_FF_TIMER)) {
#ifdef DEBUG_Sander /* very annoying, keep it private. */
- if (VMCPU_FF_IS_SET(pVCpuDst, VMCPU_FF_TIMER))
Log(("tmR3TimerCallback: timer event still pending!!\n"));
#endif
+ /*
+ * The VMCPU_FF_TIMER flag could have been set by a non-destination
+ * EMT thread without waking the destination EMT thread.
+ */
+ VMR3NotifyCpuFFU(pVCpuDst->pUVCpu, VMNOTIFYFF_FLAGS_DONE_REM);
+ return;
+ }
+
if ( !VMCPU_FF_IS_SET(pVCpuDst, VMCPU_FF_TIMER)
&& ( pVM->tm.s.paTimerQueuesR3[TMCLOCK_VIRTUAL_SYNC].offSchedule /** @todo FIXME - reconsider offSchedule as a reason for running the timer queues. */
|| pVM->tm.s.paTimerQueuesR3[TMCLOCK_VIRTUAL].offSchedule