Here's a patch that changes the behavior of the "triplefaultreset" option to reset the whole guest instead of resetting the CPU. In my testing of Phar Lap ETS with VirtualBox, the current implementation of triplefaultreset is unreliable, and isn't supported at all in SMP guests. For a UP Phar Lap ETS guest, usually the guest hangs sometime before executing the actual reset. Sometimes the reset is successful, but the guest hangs during the boot process. Only occasionally, the reset is succesful and the guest reboots successfully as well. In my testing with this patch, the reset has been successful every time, in both UP and SMP Phar Lap ETS guests.

Regards,

Jeff Westfahl
diff --git a/doc/manual/en_US/user_VBoxManage.xml b/doc/manual/en_US/user_VBoxManage.xml
index 95d6c25..b7dd27f 100755
--- a/doc/manual/en_US/user_VBoxManage.xml
+++ b/doc/manual/en_US/user_VBoxManage.xml
@@ -583,8 +583,7 @@ Statistics update:  disabled</screen></para>
             <para><computeroutput>--triplefaultreset on|off</computeroutput>:
             This setting allows to reset the guest instead of triggering a
             Guru Meditation. Some guests raise a triple fault to reset the
-            CPU so sometimes this is desired behavior. Works only for non-SMP
-            guests.</para>
+            guest so sometimes this is desired behavior.</para>
           </listitem>
 
           <listitem>
diff --git a/src/VBox/VMM/VMMR3/EM.cpp b/src/VBox/VMM/VMMR3/EM.cpp
index 024cbec..7eae7ec 100755
--- a/src/VBox/VMM/VMMR3/EM.cpp
+++ b/src/VBox/VMM/VMMR3/EM.cpp
@@ -138,11 +138,6 @@ VMMR3_INT_DECL(int) EMR3Init(PVM pVM)
     rc = CFGMR3QueryBoolDef(pCfgEM, "TripleFaultReset", &fEnabled, false);
     AssertLogRelRCReturn(rc, rc);
     pVM->em.s.fGuruOnTripleFault = !fEnabled;
-    if (!pVM->em.s.fGuruOnTripleFault && pVM->cCpus > 1)
-    {
-        LogRel(("EM: Overriding /EM/TripleFaultReset, must be false on SMP.\n"));
-        pVM->em.s.fGuruOnTripleFault = true;
-    }
 
     Log(("EMR3Init: fRecompileUser=%RTbool fRecompileSupervisor=%RTbool fRawRing1Enabled=%RTbool fIemExecutesAll=%RTbool fGuruOnTripleFault=%RTbool\n",
          pVM->fRecompileUser, pVM->fRecompileSupervisor, pVM->fRawRing1Enabled, pVM->em.s.fIemExecutesAll, pVM->em.s.fGuruOnTripleFault));
@@ -2392,16 +2387,8 @@ VMMR3_INT_DECL(int) EMR3ExecuteVM(PVM pVM, PVMCPU pVCpu)
                 case VINF_EM_TRIPLE_FAULT:
                     if (!pVM->em.s.fGuruOnTripleFault)
                     {
-                        Log(("EMR3ExecuteVM: VINF_EM_TRIPLE_FAULT: CPU reset...\n"));
-                        Assert(pVM->cCpus == 1);
-                        REMR3Reset(pVM);
-                        PGMR3ResetCpu(pVM, pVCpu);
-                        TRPMR3ResetCpu(pVCpu);
-                        CPUMR3ResetCpu(pVM, pVCpu);
-                        EMR3ResetCpu(pVCpu);
-                        HMR3ResetCpu(pVCpu);
-                        pVCpu->em.s.enmState = emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx);
-                        Log2(("EMR3ExecuteVM: VINF_EM_TRIPLE_FAULT: %d -> %d\n", rc, enmOldState, pVCpu->em.s.enmState));
+                        Log(("EMR3ExecuteVM: VINF_EM_TRIPLE_FAULT: VM reset...\n"));
+                        VM_FF_SET(pVM, VM_FF_RESET);
                         break;
                     }
                     /* Else fall through and trigger a guru. */
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to