~ubuntu-branches/ubuntu/quantal/virtualbox/quantal

« back to all changes in this revision

Viewing changes to src/VBox/VMM/VMMR3/EM.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2012-04-05 12:41:55 UTC
  • mfrom: (3.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120405124155-i7b39tv5ddwhubbe
Tags: 4.1.12-dfsg-2
* Upstream has replaced the 4.1.12 tarball with a new one that fixes a
  crash when creating host only interfaces. (Closes: #667460)
  - Add 36-tarball-respin.patch which contains the diff between the old
    and the new tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1359
1359
        {
1360
1360
            rc2 = VMMR3EmtRendezvousFF(pVM, pVCpu);
1361
1361
            UPDATE_RC();
1362
 
            /** @todo HACK ALERT! The following test is to make sure EM+TM things the VM is
1363
 
             * stopped/reset before the next VM state change is made. We need a better
1364
 
             * solution for this, or at least make it possible to do: (rc >= VINF_EM_FIRST
1365
 
             * && rc >= VINF_EM_SUSPEND). */
 
1362
            /** @todo HACK ALERT! The following test is to make sure EM+TM
 
1363
             * thinks the VM is stopped/reset before the next VM state change
 
1364
             * is made. We need a better solution for this, or at least make it
 
1365
             * possible to do: (rc >= VINF_EM_FIRST && rc <=
 
1366
             * VINF_EM_SUSPEND). */
1366
1367
            if (RT_UNLIKELY(rc == VINF_EM_SUSPEND || rc == VINF_EM_RESET || rc == VINF_EM_OFF))
1367
1368
            {
1368
1369
                Log2(("emR3ForcedActions: returns %Rrc\n", rc));
1469
1470
        {
1470
1471
            rc2 = VMMR3EmtRendezvousFF(pVM, pVCpu);
1471
1472
            UPDATE_RC();
1472
 
            /** @todo HACK ALERT! The following test is to make sure EM+TM things the VM is
1473
 
             * stopped/reset before the next VM state change is made. We need a better
1474
 
             * solution for this, or at least make it possible to do: (rc >= VINF_EM_FIRST
1475
 
             * && rc >= VINF_EM_SUSPEND). */
 
1473
            /** @todo HACK ALERT! The following test is to make sure EM+TM
 
1474
             * thinks the VM is stopped/reset before the next VM state change
 
1475
             * is made. We need a better solution for this, or at least make it
 
1476
             * possible to do: (rc >= VINF_EM_FIRST && rc <=
 
1477
             * VINF_EM_SUSPEND). */
1476
1478
            if (RT_UNLIKELY(rc == VINF_EM_SUSPEND || rc == VINF_EM_RESET || rc == VINF_EM_OFF))
1477
1479
            {
1478
1480
                Log2(("emR3ForcedActions: returns %Rrc\n", rc));
1494
1496
                return rc2;
1495
1497
            }
1496
1498
            UPDATE_RC();
1497
 
            /** @todo HACK ALERT! The following test is to make sure EM+TM things the VM is
1498
 
             * stopped/reset before the next VM state change is made. We need a better
1499
 
             * solution for this, or at least make it possible to do: (rc >= VINF_EM_FIRST
1500
 
             * && rc >= VINF_EM_SUSPEND). */
 
1499
            /** @todo HACK ALERT! The following test is to make sure EM+TM
 
1500
             * thinks the VM is stopped/reset before the next VM state change
 
1501
             * is made. We need a better solution for this, or at least make it
 
1502
             * possible to do: (rc >= VINF_EM_FIRST && rc <=
 
1503
             * VINF_EM_SUSPEND). */
1501
1504
            if (RT_UNLIKELY(rc == VINF_EM_SUSPEND || rc == VINF_EM_RESET || rc == VINF_EM_OFF))
1502
1505
            {
1503
1506
                Log2(("emR3ForcedActions: returns %Rrc\n", rc));
1545
1548
                return rc2;
1546
1549
            }
1547
1550
            UPDATE_RC();
1548
 
            /** @todo HACK ALERT! The following test is to make sure EM+TM things the VM is
1549
 
             * stopped/reset before the next VM state change is made. We need a better
1550
 
             * solution for this, or at least make it possible to do: (rc >= VINF_EM_FIRST
1551
 
             * && rc >= VINF_EM_SUSPEND). */
 
1551
            /** @todo HACK ALERT! The following test is to make sure EM+TM
 
1552
             * thinks the VM is stopped/reset before the next VM state change
 
1553
             * is made. We need a better solution for this, or at least make it
 
1554
             * possible to do: (rc >= VINF_EM_FIRST && rc <=
 
1555
             * VINF_EM_SUSPEND). */
1552
1556
            if (RT_UNLIKELY(rc == VINF_EM_SUSPEND || rc == VINF_EM_RESET || rc == VINF_EM_OFF))
1553
1557
            {
1554
1558
                Log2(("emR3ForcedActions: returns %Rrc\n", rc));
1577
1581
 
1578
1582
        /*
1579
1583
         * The instruction following an emulated STI should *always* be executed!
1580
 
         * 
 
1584
         *
1581
1585
         * Note! We intentionally don't clear VM_FF_INHIBIT_INTERRUPTS here if
1582
1586
         *       the eip is the same as the inhibited instr address.  Before we
1583
1587
         *       are able to execute this instruction in raw mode (iret to
1590
1594
        if (    VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)
1591
1595
            &&  !VM_FF_ISPENDING(pVM, VM_FF_PGM_NO_MEMORY))
1592
1596
        {
1593
 
            Log(("VMCPU_FF_INHIBIT_INTERRUPTS at %RGv successor %RGv\n", (RTGCPTR)CPUMGetGuestRIP(pVCpu), EMGetInhibitInterruptsPC(pVCpu)));
1594
1597
            if (CPUMGetGuestRIP(pVCpu) != EMGetInhibitInterruptsPC(pVCpu))
 
1598
            {
 
1599
                Log(("Clearing VMCPU_FF_INHIBIT_INTERRUPTS at %RGv - successor %RGv\n", (RTGCPTR)CPUMGetGuestRIP(pVCpu), EMGetInhibitInterruptsPC(pVCpu)));
1595
1600
                VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS);
1596
 
 
1597
 
            if (EMIsSupervisorCodeRecompiled(pVM))
1598
 
                rc2 = VINF_EM_RESCHEDULE_REM;
1599
 
            else if (HWACCMR3IsActive(pVCpu))
1600
 
                rc2 = VINF_EM_RESCHEDULE_HWACC;
 
1601
            }
1601
1602
            else
1602
 
                rc2 = PATMAreInterruptsEnabled(pVM) ? VINF_EM_RESCHEDULE_RAW : VINF_EM_RESCHEDULE_REM;
1603
 
 
1604
 
            UPDATE_RC();
 
1603
                Log(("Leaving VMCPU_FF_INHIBIT_INTERRUPTS set at %RGv\n", (RTGCPTR)CPUMGetGuestRIP(pVCpu)));
1605
1604
        }
1606
1605
 
1607
1606
        /*
1899
1898
                    /* Don't reschedule in the halted or wait for SIPI case. */
1900
1899
                    if (    pVCpu->em.s.enmPrevState == EMSTATE_WAIT_SIPI
1901
1900
                        ||  pVCpu->em.s.enmPrevState == EMSTATE_HALTED)
 
1901
                    {
 
1902
                        pVCpu->em.s.enmState = pVCpu->em.s.enmPrevState;
1902
1903
                        break;
 
1904
                    }
1903
1905
                    /* fall through and get scheduled. */
1904
1906
 
1905
1907
                /*
1936
1938
                 */
1937
1939
                case VINF_EM_SUSPEND:
1938
1940
                    Log2(("EMR3ExecuteVM: VINF_EM_SUSPEND: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_SUSPENDED));
 
1941
                    Assert(pVCpu->em.s.enmState != EMSTATE_SUSPENDED);
1939
1942
                    pVCpu->em.s.enmPrevState = pVCpu->em.s.enmState;
1940
1943
                    pVCpu->em.s.enmState     = EMSTATE_SUSPENDED;
1941
1944
                    break;
1987
1990
                 */
1988
1991
                case VINF_EM_NO_MEMORY:
1989
1992
                    Log2(("EMR3ExecuteVM: VINF_EM_NO_MEMORY: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_SUSPENDED));
 
1993
                    Assert(pVCpu->em.s.enmState != EMSTATE_SUSPENDED);
1990
1994
                    pVCpu->em.s.enmPrevState = pVCpu->em.s.enmState;
1991
1995
                    pVCpu->em.s.enmState = EMSTATE_SUSPENDED;
1992
1996
                    TMR3NotifySuspend(pVM, pVCpu);