Page 1 of 1

Windows 7 SMP guest hangs on reboot

Posted: 13. Oct 2014, 15:06
by skoehler
As soon as I enable 2 processors or more, my 32Bit Windows 7 guest hangs on a reboot. It did so during the installation of Windows 7 (I'm using a Windows 7 SP1 x86 iso) and it does so afterwards. When reducing the number of CPUs to 1 (and disabling IO-APIC), everything is fine. The guest is pretty much a standard configuration as creates by the new virtual machine wizard, I was just changing the number of CPUs.

This is on a Linux 3.16.5 host with an Intel graphics card. The CPU is a i7 4700HQ.

This is quite annoying. I have a quadcore CPU, and I can only use one core for my guest.

Re: Windows 7 SMP guest hangs on reboot

Posted: 13. Oct 2014, 16:19
by socratis
I can report the same behavior on a MacBook Pro with 10.6.8. Take a look at viewtopic.php?f=1&t=64104&p=301457#p301457 . It was filed after your post, but it's more appropriate to continue the discussion there.

Re: Windows 7 SMP guest hangs on reboot

Posted: 13. Oct 2014, 17:10
by skoehler
I should mention that I had the problem with 4.3.18 and 4.3.16. It's built from source on Gentoo (gcc 4.7).
I also tried the ICH9 chipset. Things didn't change.

Re: Windows 7 SMP guest hangs on reboot

Posted: 13. Oct 2014, 17:29
by Ramshankar
Thanks for the report, fixed in SVN and the fix should be available in the next maintenance version.

Re: Windows 7 SMP guest hangs on reboot

Posted: 13. Oct 2014, 17:34
by skoehler
Ramshankar wrote:Thanks for the report, fixed in SVN and the fix should be available in the next maintenance version.
Which commit is it? I'm looking at the commit history of http://www.virtualbox.org/svn/vbox/ and there has only been one commit today which seems to be keyboard related.

Re: Windows 7 SMP guest hangs on reboot

Posted: 13. Oct 2014, 17:59
by Perryg
They still need to update the public SVN for the commit to show.

Re: Windows 7 SMP guest hangs on reboot

Posted: 13. Oct 2014, 22:06
by skoehler
Perryg wrote:They still need to update the public SVN for the commit to show.
Good. I'll wait.
Where would I find the 4.3.x branch? I only see trunk.

Re: Windows 7 SMP guest hangs on reboot

Posted: 13. Oct 2014, 22:11
by Perryg
Same thing.

Re: Windows 7 SMP guest hangs on reboot

Posted: 14. Oct 2014, 13:02
by skoehler
Thanks for the patch (did you click the edit button instead of the quote button?). I'll test it. I'm recompiling virtualbox right now. No need to provide a test build.

Update: Yep, the patch fixes the problem for me.

Re: Windows 7 SMP guest hangs on reboot

Posted: 14. Oct 2014, 15:06
by Ramshankar
skoehler wrote:Thanks for the patch (did you click the edit button instead of the quote button?). I'll test it. I'm recompiling virtualbox right now. No need to provide a test build.

Update: Yep, the patch fixes the problem for me.
Yes, I clicked the edit button by mistake. Sorry about that.

Edit update here:
OSE is trunk only. The way for getting branch sources is to get the tarball but we release that usually only during the time of the release.

Also, the problem in trunk has been fixed a long time ago with a different codepath being taken, i.e. trunk has event injection and task-switch implementation in IEM and is handled that way. The fix for 4.3 branch was to fall back to the recompiler. If you're interested here is the diff for the 4.3 branch which makes it work:

Patch posted here:

Code: Select all

Index: branches/VBox-4.3/src/VBox/VMM/VMMR0/HMVMXR0.cpp
===================================================================
--- branches/VBox-4.3/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 96369)
+++ branches/VBox-4.3/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 96541)
@@ -10407,4 +10407,14 @@
 
                 Log4(("Pending event on TaskSwitch uIntType=%#x uVector=%#x\n", uIntType, uVector));
+                STAM_COUNTER_INC(&pVCpu->hm.s.StatExitTaskSwitch);
+
+                /*
+                 * emR3ExecuteInstruction() will call IEMExecOne() which doesn't honor TRPM events. We could implement
+                 * IEMInjectTrpmEvent() but since IEM task-switching isn't backported to 4.3 it would return
+                 * VERR_IEM_ASPECT_NOT_IMPLEMENTED. What we really want is to just inject the event and not even try
+                 * emulate the instruction at RIP. At the moment for 4.3, only REM does this, so fallback directly to
+                 * REM here. See @bugref{7445} comment #25.
+                 */
+                return VINF_EM_RESCHEDULE_REM;
             }
         }
I will see if we can provide a test build later today with the fix included.