On 14/08/12 22:08, Li Xin wrote:
Hi,

In the changelog of VirtualBox Release 4.1.16, it is mentioned that:

VMM: fixed a VM hang after a resume from pause / savestate with SMP
guests in rare cases

I need to pull the fix into my code base, and have examined all the
changes between 4.1.14 and 4.1.16, but no one seems obvious.  41096
(https://www.virtualbox.org/changeset/41096/vbox) and
41312(https://www.virtualbox.org/changeset/41312/vbox) look related,
but really can't tell.  On the other side it's hard to verify because
the problem only happens "in rare cases".

Can someone please elaborate the changeset(s) fixing the SMP hang problem?

Why not pull all the changes?

Anyway...

r41312 is part of the optimizations with TLB flushing during world switches. This is only in 4.2.x (BETAs and the upcoming release) and has not been backported to the 4.1.x branch. So the change you are looking for is not r41312.

r41096 is for the change which is documented in the 4.1.16 changelog as: "VBoxManage: fixed controlvm savestate if the VM is already paused"

The change you are looking for is in VMMR3/EM.cpp.
Since the public trac has no convenient way to browse revision history for files, I'm attaching the diff. of the original change; hope this helps.

Regards,
Ram.

Thanks in advance!
-Bill

_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev



Index: /trunk/src/VBox/VMM/VMMR3/EM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/EM.cpp	(revision 77898)
+++ /trunk/src/VBox/VMM/VMMR3/EM.cpp	(revision 77996)
@@ -1648,4 +1648,5 @@
          * Interrupts.
          */
+        bool fWakeupPending = false;
         if (    !VM_FF_ISPENDING(pVM, VM_FF_PGM_NO_MEMORY)
             &&  !VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)
@@ -1665,4 +1666,6 @@
 #endif
                 UPDATE_RC();
+                /* Reschedule required: We must not miss the wakeup below! */
+                fWakeupPending = true;
             }
 #ifdef VBOX_WITH_REM
@@ -1697,5 +1700,6 @@
          * EMT Rendezvous (must be serviced before termination).
          */
-        if (VM_FF_ISPENDING(pVM, VM_FF_EMT_RENDEZVOUS))
+        if (   !fWakeupPending /* don't miss the wakeup from EMSTATE_HALTED! */
+            && VM_FF_ISPENDING(pVM, VM_FF_EMT_RENDEZVOUS))
         {
             rc2 = VMMR3EmtRendezvousFF(pVM, pVCpu);
@@ -1716,5 +1720,6 @@
          * State change request (cleared by vmR3SetStateLocked).
          */
-        if (VM_FF_ISPENDING(pVM, VM_FF_CHECK_VM_STATE))
+        if (   !fWakeupPending /* don't miss the wakeup from EMSTATE_HALTED! */
+            && VM_FF_ISPENDING(pVM, VM_FF_CHECK_VM_STATE))
         {
             VMSTATE enmState = VMR3GetState(pVM);

_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to