diff -uNr 1/vbox/vbox/src//VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp 2/vbox/vbox/src//VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
--- 1/vbox/vbox/src//VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	2011-06-27 15:04:42.000000000 -0400
+++ 2/vbox/vbox/src//VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	2011-06-27 15:23:30.000000000 -0400
@@ -1649,6 +1649,9 @@
                      + QString (sSectionItemTpl2).arg (tr ("Processor(s)", "details report"),
                                                        tr ("<nobr>%1</nobr>", "details report"))
                        .arg (aMachine.GetCPUCount())
+                     + QString (sSectionItemTpl2).arg (tr ("CPU Execution Cap", "details report"),
+                                                       tr ("<nobr>%1</nobr>", "details report"))
+                       .arg (aMachine.GetCPUExecutionCap())
                      + QString (sSectionItemTpl2).arg (tr ("Boot Order", "details report"), bootOrder)
 #ifdef VBOX_WITH_FULL_DETAILS_REPORT
                      + QString (sSectionItemTpl2).arg (tr ("ACPI", "details report"), acpi)
diff -uNr 1/vbox/vbox/src//VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp 2/vbox/vbox/src//VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp
--- 1/vbox/vbox/src//VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp	2011-06-27 15:04:41.000000000 -0400
+++ 2/vbox/vbox/src//VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp	2011-06-27 15:29:08.000000000 -0400
@@ -595,6 +595,12 @@
                                              tr("<nobr>%1</nobr>", "details report"))
                     .arg(cCPU);
 
+            int cCPUexeccap = m_machine.GetCPUExecutionCap();
+            if (cCPUexeccap < 100)
+                item += sSectionItemTpl2.arg(tr("CPU Cap", "details report"),
+                                             tr("<nobr>%1 %</nobr>", "details report"))
+                    .arg(cCPUexeccap);
+                    
             /* Boot order */
             QStringList bootOrder;
             for (ulong i = 1; i <= m_vbox.GetSystemProperties().GetMaxBootPosition(); ++i)
diff -uNr 1/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp 2/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
--- 1/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp	2011-06-27 15:04:42.000000000 -0400
+++ 2/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp	2011-06-27 15:23:30.000000000 -0400
@@ -30,6 +30,7 @@
 UIMachineSettingsSystem::UIMachineSettingsSystem()
     : mValidator(0)
     , mMinGuestCPU(0), mMaxGuestCPU(0)
+    , mMinGuestCPUexeccap(0), mMaxGuestCPUexeccap(0)
     , m_fOHCIEnabled(false)
 {
     /* Apply UI decorations */
@@ -40,6 +41,8 @@
     uint hostCPUs = vboxGlobal().virtualBox().GetHost().GetProcessorCount();
     mMinGuestCPU = properties.GetMinGuestCPUCount();
     mMaxGuestCPU = RT_MIN (2 * hostCPUs, properties.GetMaxGuestCPUCount());
+    mMinGuestCPUexeccap = 1;
+    mMaxGuestCPUexeccap = 100;
 
     /* Populate possible boot items list.
      * Currently, it seems, we are supporting only 4 possible boot device types:
@@ -83,6 +86,7 @@
     /* Setup validators */
     mLeMemory->setValidator (new QIntValidator (mSlMemory->minRAM(), mSlMemory->maxRAM(), this));
     mLeCPU->setValidator (new QIntValidator (mMinGuestCPU, mMaxGuestCPU, this));
+    mLeCPUexeccap->setValidator (new QIntValidator (mMinGuestCPUexeccap, mMaxGuestCPUexeccap, this));
 
     /* Setup connections */
     connect (mSlMemory, SIGNAL (valueChanged (int)),
@@ -102,6 +106,11 @@
     connect (mLeCPU, SIGNAL (textChanged (const QString&)),
              this, SLOT (textChangedCPU (const QString&)));
 
+    connect (mSlCPUexeccap, SIGNAL (valueChanged (int)),
+             this, SLOT (valueChangedCPUexeccap (int)));
+    connect (mLeCPUexeccap, SIGNAL (textChanged (const QString&)),
+             this, SLOT (textChangedCPUexeccap (const QString&)));
+             
     /* Setup iconsets */
     mTbBootItemUp->setIcon(UIIconPool::iconSet(":/list_moveup_16px.png",
                                                ":/list_moveup_disabled_16px.png"));
@@ -129,9 +138,24 @@
     mSlCPU->setOptimalHint (1, hostCPUs);
     mSlCPU->setWarningHint (hostCPUs, mMaxGuestCPU);
     /* Limit min/max. size of QLineEdit */
-    mLeCPU->setFixedWidthByText (QString().fill ('8', 3));
+    mLeCPU->setFixedWidthByText (QString().fill ('8', 4));
     /* Ensure mLeMemory value and validation is updated */
     valueChangedCPU (mSlCPU->value());
+    
+    /* Setup cpu cap slider */
+    mSlCPUexeccap->setPageStep (10);
+    mSlCPUexeccap->setSingleStep (1);
+    mSlCPUexeccap->setTickInterval (10);
+    /* Setup the scale so that ticks are at page step boundaries */
+    mSlCPUexeccap->setMinimum (mMinGuestCPUexeccap);
+    mSlCPUexeccap->setMaximum (mMaxGuestCPUexeccap);
+    /* mSlCPUexeccap->setOptimalHint (1, hostCPUexeccaps); */
+    /* mSlCPUexeccap->setWarningHint (hostCPUexeccaps, mMaxGuestCPUexeccap); */
+    /* Limit min/max. size of QLineEdit */
+    mLeCPUexeccap->setFixedWidthByText (QString().fill ('8', 4));
+    /* Ensure mLeMemory value and validation is updated */
+    valueChangedCPUexeccap (mSlCPUexeccap->value());
+    
     /* Populate chipset combo: */
     mCbChipset->insertItem(0, vboxGlobal().toString(KChipsetType_PIIX3), QVariant(KChipsetType_PIIX3));
     mCbChipset->insertItem(1, vboxGlobal().toString(KChipsetType_ICH9), QVariant(KChipsetType_ICH9));
@@ -214,6 +238,7 @@
     systemData.m_fNestedPagingEnabled = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging);
     systemData.m_iRAMSize = m_machine.GetMemorySize();
     systemData.m_cCPUCount = systemData.m_fPFHwVirtExSupported ? m_machine.GetCPUCount() : 1;
+    systemData.m_cCPUexeccap = m_machine.GetCPUExecutionCap();
     systemData.m_chipsetType = m_machine.GetChipsetType();
 
     /* Cache system data: */
@@ -251,6 +276,7 @@
     mCbNestedPaging->setChecked(systemData.m_fNestedPagingEnabled);
     mSlMemory->setValue(systemData.m_iRAMSize);
     mSlCPU->setValue(systemData.m_cCPUCount);
+    mSlCPUexeccap->setValue(systemData.m_cCPUexeccap);
     int iChipsetPositionPos = mCbChipset->findData(systemData.m_chipsetType);
     mCbChipset->setCurrentIndex(iChipsetPositionPos == -1 ? 0 : iChipsetPositionPos);
 
@@ -289,6 +315,7 @@
     systemData.m_fNestedPagingEnabled = mCbNestedPaging->isChecked();
     systemData.m_iRAMSize = mSlMemory->value();
     systemData.m_cCPUCount = mSlCPU->value();
+    systemData.m_cCPUexeccap = mSlCPUexeccap->value();
     systemData.m_chipsetType = (KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt();
 
     /* Cache system data: */
@@ -334,6 +361,7 @@
             /* Processor tab: */
             m_machine.SetCPUCount(systemData.m_cCPUCount);
             m_machine.SetCPUProperty(KCPUPropertyType_PAE, systemData.m_fPAEEnabled);
+            m_machine.SetCPUExecutionCap(systemData.m_cCPUexeccap);
             /* Acceleration tab: */
             m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, systemData.m_fHwVirtExEnabled);
             m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging, systemData.m_fNestedPagingEnabled);
@@ -398,7 +426,7 @@
             .arg (totalCPUs);
         return true;
     }
-
+    
     /* VCPU IO-APIC test */
     if (mSlCPU->value() > 1 && !mCbApic->isChecked())
     {
@@ -421,6 +449,16 @@
         return true;
     }
 
+    /* CPU execution cap is low */
+    if (mSlCPUexeccap->value() < 40)
+    {
+        aWarning = tr (
+            "You have set CPU execution cap to low value, which may "
+            "distort audio and have other side effects. "
+            );
+        return true;
+    }
+
     /* Chipset type & IO-APIC test */
     if ((KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt() == KChipsetType_ICH9 && !mCbApic->isChecked())
     {
@@ -463,7 +501,9 @@
     /* Processor tab-order */
     setTabOrder (mCbUseAbsHID, mSlCPU);
     setTabOrder (mSlCPU, mLeCPU);
-    setTabOrder (mLeCPU, mCbPae);
+    setTabOrder (mLeCPU, mSlCPUexeccap);
+    setTabOrder (mSlCPUexeccap, mLeCPUexeccap);
+    setTabOrder (mLeCPUexeccap, mCbPae);
 
     /* Acceleration tab-order */
     setTabOrder (mCbPae, mCbVirt);
@@ -487,6 +527,10 @@
     /* Retranslate the cpu slider legend */
     mLbCPUMin->setText (tr ("<qt>%1&nbsp;CPU</qt>", "%1 is 1 for now").arg (mMinGuestCPU));
     mLbCPUMax->setText (tr ("<qt>%1&nbsp;CPUs</qt>", "%1 is host cpu count * 2 for now").arg (mMaxGuestCPU));
+
+    /* Retranslate the cpu cap slider legend */
+    mLbCPUexeccapMin->setText (tr ("<qt>%1&nbsp;% CPU cap</qt>").arg (mMinGuestCPUexeccap));
+    mLbCPUexeccapMax->setText (tr ("<qt>%1&nbsp;% CPU cap</qt>").arg (mMaxGuestCPUexeccap));
 }
 
 void UIMachineSettingsSystem::valueChangedRAM (int aVal)
@@ -532,6 +576,16 @@
     mSlCPU->setValue (aText.toInt());
 }
 
+void UIMachineSettingsSystem::valueChangedCPUexeccap (int aVal)
+{
+    mLeCPUexeccap->setText (QString().setNum (aVal));
+}
+
+void UIMachineSettingsSystem::textChangedCPUexeccap (const QString &aText)
+{
+    mSlCPUexeccap->setValue (aText.toInt());
+}
+
 bool UIMachineSettingsSystem::eventFilter (QObject *aObject, QEvent *aEvent)
 {
     if (!aObject->isWidgetType())
@@ -601,6 +655,11 @@
     mLbCPUMax->setEnabled(isMachineOffline());
     mSlCPU->setEnabled(isMachineOffline() && systemData.m_fPFHwVirtExSupported);
     mLeCPU->setEnabled(isMachineOffline() && systemData.m_fPFHwVirtExSupported);
+    mLbCPUexeccap->setEnabled(isMachineOffline());
+    mLbCPUexeccapMin->setEnabled(isMachineOffline());
+    mLbCPUexeccapMax->setEnabled(isMachineOffline());
+    mSlCPUexeccap->setEnabled(isMachineOffline());
+    mLeCPUexeccap->setEnabled(isMachineOffline());
     mLbProcessorExtended->setEnabled(isMachineOffline());
     mCbPae->setEnabled(isMachineOffline() && systemData.m_fPFPAESupported);
     /* Acceleration tab: */
diff -uNr 1/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h 2/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
--- 1/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h	2011-06-27 15:04:42.000000000 -0400
+++ 2/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h	2011-06-27 15:23:30.000000000 -0400
@@ -56,6 +56,7 @@
         , m_fHwVirtExEnabled(false)
         , m_fNestedPagingEnabled(false)
         , m_iRAMSize(-1)
+        , m_cCPUexeccap(-1)
         , m_cCPUCount(-1) {}
     /* Functions: */
     bool equal(const UIDataSettingsMachineSystem &other) const
@@ -72,6 +73,7 @@
                (m_fHwVirtExEnabled == other.m_fHwVirtExEnabled) &&
                (m_fNestedPagingEnabled == other.m_fNestedPagingEnabled) &&
                (m_iRAMSize == other.m_iRAMSize) &&
+               (m_cCPUexeccap == other.m_cCPUexeccap);
                (m_cCPUCount == other.m_cCPUCount);
     }
     /* Operators: */
@@ -91,6 +93,7 @@
     bool m_fNestedPagingEnabled;
     int m_iRAMSize;
     int m_cCPUCount;
+    int m_cCPUexeccap;
 };
 typedef UISettingsCache<UIDataSettingsMachineSystem> UICacheSettingsMachineSystem;
 
@@ -148,7 +151,10 @@
 
     void valueChangedCPU (int aVal);
     void textChangedCPU (const QString &aText);
+    void valueChangedCPUexeccap (int aVal);
+    void textChangedCPUexeccap (const QString &aText);
 
+    
 private:
 
     bool eventFilter (QObject *aObject, QEvent *aEvent);
@@ -161,6 +167,8 @@
 
     uint mMinGuestCPU;
     uint mMaxGuestCPU;
+    uint mMinGuestCPUexeccap;
+    uint mMaxGuestCPUexeccap;
 
     QList<KDeviceType> m_possibleBootItems;
 
diff -uNr 1/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui 2/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui
--- 1/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui	2011-06-27 15:04:42.000000000 -0400
+++ 2/vbox/vbox/src//VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui	2011-06-27 16:57:19.000000000 -0400
@@ -3,7 +3,7 @@
  <comment>
  VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
 
-     Copyright (C) 2008 Oracle Corporation
+     Copyright (C) 2008-2011 Oracle Corporation
 
      This file is part of VirtualBox Open Source Edition (OSE), as
      available from http://www.virtualbox.org. This file is free software;
@@ -536,8 +536,112 @@
           <string>Controls the number of virtual CPUs in the virtual machine. You need hardware virtualization support on your host system to use more than one virtual CPU.</string>
          </property>
         </widget>
-       </item>
+       </item>      
        <item row="2" column="0">
+        <widget class="QLabel" name="mLbCPUexeccap">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>&amp;CPU Execution Cap:</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy">
+          <cstring>mLeCPUexeccap</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1" rowspan="2">
+        <layout class="QVBoxLayout" name="mLtCPUexeccapSlider">
+         <property name="spacing">
+          <number>0</number>
+         </property>
+         <item>
+          <widget class="QIAdvancedSlider" name="mSlCPUexeccap">
+           <property name="whatsThis">
+            <string>Controls the CPU execution cap of each virtual CPU. It defines how much cycles each virtual CPU can use as a percent of host's CPU. 100% = unlimited.</string>
+           </property>
+           <property name="maximum">
+            <number>4096</number>
+           </property>
+           <property name="singleStep">
+            <number>200</number>
+           </property>
+           <property name="value">
+            <number>512</number>
+           </property>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="tickPosition">
+            <enum>QSlider::TicksBelow</enum>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="mLtCPUexeccapLegend">
+           <property name="spacing">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QLabel" name="mLbCPUexeccapMin">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="mSpHor4">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>0</width>
+               <height>0</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QLabel" name="mLbCPUexeccapMax">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="alignment">
+              <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item row="2" column="2">
+        <widget class="QILineEdit" name="mLeCPUexeccap">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="whatsThis">
+          <string>Controls the CPU execution cap of each virtual CPU. It defines how much cycles each virtual CPU can use as a percent of host's CPU. 100% = unlimited.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="0">
         <widget class="QLabel" name="mLbProcessorExtended">
          <property name="text">
           <string>Extended Features:</string>
@@ -547,7 +651,7 @@
          </property>
         </widget>
        </item>
-       <item row="2" column="1" colspan="2">
+       <item row="4" column="1" colspan="2">
         <widget class="QCheckBox" name="mCbPae">
          <property name="sizePolicy">
           <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@@ -563,7 +667,7 @@
          </property>
         </widget>
        </item>
-       <item row="3" column="0" colspan="3">
+       <item row="5" column="0" colspan="3">
         <spacer name="mSpVer3">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
