VirtualBox

Changeset 75958 in vbox


Ignore:
Timestamp:
Dec 5, 2018 8:51:25 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9323: Cumulative fix for Nested Paging vs HW Virt Ex check-boxes interconnections; We also decided to auto-enable HW Virt Ex if Nested Paging is enabled and HW Virt Ex is supported.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ru.ts

    r75787 r75958  
    1092810928    <message>
    1092910929        <source>Enable Nested Pa&amp;ging</source>
    10930         <translation>В&amp;ключить  Nested Paging</translation>
     10930        <translation>В&amp;ключить Nested Paging</translation>
    1093110931    </message>
    1093210932    <message>
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r74942 r75958  
    464464            pGeneralPage->is64BitOSTypeSelected() && !pSystemPage->isHWVirtExEnabled())
    465465            m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, true);
     466
     467        /* System page fixes: */
     468        if (pSystemPage)
     469        {
     470            /* Nested Paging: */
     471            if (pSystemPage->isNestedPagingEnabled())
     472            {
     473                /* Enable HW Virt Ex if supported: */
     474                if (   pSystemPage->isHWVirtExSupported()
     475                    && !pSystemPage->isHWVirtExEnabled())
     476                    m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, true);
     477            }
     478        }
    466479
    467480#ifdef VBOX_WITH_VIDEOHWACCEL
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp

    r73159 r75958  
    7373        : m_fSupportedPAE(false)
    7474        , m_fSupportedHwVirtEx(false)
     75        , m_fSupportedNestedPaging(false)
    7576        /* Motherboard data: */
    7677        , m_iMemorySize(-1)
     
    9899               && (m_fSupportedPAE == other.m_fSupportedPAE)
    99100               && (m_fSupportedHwVirtEx == other.m_fSupportedHwVirtEx)
     101               && (m_fSupportedNestedPaging == other.m_fSupportedNestedPaging)
    100102               /* Motherboard data: */
    101103               && (m_iMemorySize == other.m_iMemorySize)
     
    126128    /** Holds whether the HW Virt Ex is supported. */
    127129    bool  m_fSupportedHwVirtEx;
     130    /** Holds whether the Nested Paging is supported. */
     131    bool  m_fSupportedNestedPaging;
    128132
    129133    /** Holds the RAM size. */
     
    174178}
    175179
     180bool UIMachineSettingsSystem::isHWVirtExSupported() const
     181{
     182    AssertPtrReturn(m_pCache, false);
     183    return m_pCache->base().m_fSupportedHwVirtEx;
     184}
     185
    176186bool UIMachineSettingsSystem::isHWVirtExEnabled() const
    177187{
    178188    return m_pCheckBoxVirtualization->isChecked();
     189}
     190
     191bool UIMachineSettingsSystem::isNestedPagingSupported() const
     192{
     193    AssertPtrReturn(m_pCache, false);
     194    return m_pCache->base().m_fSupportedNestedPaging;
     195}
     196
     197bool UIMachineSettingsSystem::isNestedPagingEnabled() const
     198{
     199    return m_pCheckBoxNestedPaging->isChecked();
    179200}
    180201
     
    221242    oldSystemData.m_fSupportedPAE = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_PAE);
    222243    oldSystemData.m_fSupportedHwVirtEx = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_HWVirtEx);
     244    oldSystemData.m_fSupportedNestedPaging = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_NestedPaging);
    223245
    224246    /* Gather old 'Motherboard' data: */
     
    329351    /* Gather support flags: */
    330352    newSystemData.m_fSupportedPAE = m_pCache->base().m_fSupportedPAE;
    331     newSystemData.m_fSupportedHwVirtEx = m_pCache->base().m_fSupportedHwVirtEx;
     353    newSystemData.m_fSupportedHwVirtEx = isHWVirtExSupported();
     354    newSystemData.m_fSupportedNestedPaging = isNestedPagingSupported();
    332355
    333356    /* Gather 'Motherboard' data: */
     
    357380    /* Gather 'Acceleration' data: */
    358381    newSystemData.m_paravirtProvider = (KParavirtProvider)m_pComboParavirtProvider->itemData(m_pComboParavirtProvider->currentIndex()).toInt();
    359     newSystemData.m_fEnabledHwVirtEx = m_pCheckBoxVirtualization->checkState() == Qt::Checked || m_pSliderCPUCount->value() > 1;
    360     newSystemData.m_fEnabledNestedPaging = m_pCheckBoxNestedPaging->isChecked();
     382    newSystemData.m_fEnabledHwVirtEx = isHWVirtExEnabled() || m_pSliderCPUCount->value() > 1;
     383    newSystemData.m_fEnabledNestedPaging = isNestedPagingEnabled();
    361384
    362385    /* Cache new system data: */
     
    463486        }
    464487
    465         /* VCPU vs VT-x/AMD-V test: */
    466         if (m_pSliderCPUCount->value() > 1 && !m_pCheckBoxVirtualization->isChecked())
    467         {
    468             message.second << tr(
    469                 "The hardware virtualization is not currently enabled in the Acceleration section of the System page. "
    470                 "This is needed to support more than one virtual processor. "
    471                 "It will be enabled automatically if you confirm your changes.");
     488        /* VCPU: */
     489        if (m_pSliderCPUCount->value() > 1)
     490        {
     491            /* HW Virt Ex test: */
     492            if (isHWVirtExSupported() && !isHWVirtExEnabled())
     493            {
     494                message.second << tr(
     495                    "The hardware virtualization is not currently enabled in the Acceleration section of the System page. "
     496                    "This is needed to support more than one virtual processor. "
     497                    "It will be enabled automatically if you confirm your changes.");
     498            }
    472499        }
    473500
     
    496523            messages << message;
    497524    }
     525
    498526    /* Acceleration tab: */
    499527    {
     
    501529        UIValidationMessage message;
    502530        message.first = VBoxGlobal::removeAccelMark(m_pTabWidgetSystem->tabText(2));
    503         /* VT-x/AMD-V capability test: */
    504         if (!vboxGlobal().host().GetProcessorFeature(KProcessorFeature_HWVirtEx) && m_pCheckBoxVirtualization->isChecked())
     531
     532        /* HW Virt Ex test: */
     533        if (!isHWVirtExSupported() && isHWVirtExEnabled())
    505534        {
    506535            message.second << tr(
     
    510539            fPass = false;
    511540        }
     541
     542        /* Nested Paging: */
     543        if (isNestedPagingEnabled())
     544        {
     545            /* HW Virt Ex test: */
     546            if (isHWVirtExSupported() && !isHWVirtExEnabled())
     547            {
     548                message.second << tr(
     549                    "The hardware virtualization is not currently enabled in the Acceleration section of the System page. "
     550                    "This is needed for nested paging support. "
     551                    "It will be enabled automatically if you confirm your changes.");
     552            }
     553        }
     554
    512555        /* Serialize message: */
    513556        if (!message.second.isEmpty())
     
    515558
    516559    }
     560
    517561    /* Return result: */
    518562    return fPass;
     
    613657
    614658    /* Polish 'Acceleration' availability: */
    615     /* Enable the hardware virtulization related check-boxes if it is supported by the host system or
    616      * it is currently enabled in the vm (in this case check-box is enabled so that user could
    617      * uncheck it and that way disable the hardware virtualization. */
    618     setAccelerationCheckBoxesEnabled(   (systemData.m_fSupportedHwVirtEx && isMachineOffline())
    619                                      || (systemData.m_fEnabledHwVirtEx && isMachineOffline()));
     659    m_pCheckBoxVirtualization->setEnabled(   (systemData.m_fSupportedHwVirtEx && isMachineOffline())
     660                                          || (systemData.m_fEnabledHwVirtEx && isMachineOffline()));
     661    m_pCheckBoxNestedPaging->setEnabled(   m_pCheckBoxVirtualization->isChecked()
     662                                        && (   (systemData.m_fSupportedNestedPaging && isMachineOffline())
     663                                            || (systemData.m_fEnabledNestedPaging && isMachineOffline())));
    620664    m_pLabelParavirtProvider->setEnabled(isMachineOffline());
    621665    m_pComboParavirtProvider->setEnabled(isMachineOffline());
     
    737781    m_pSliderCPUExecCap->setValue(m_pEditorCPUExecCap->value());
    738782    m_pSliderCPUExecCap->blockSignals(false);
     783
     784    /* Revalidate: */
     785    revalidate();
     786}
     787
     788void UIMachineSettingsSystem::sltHandleHwVirtExToggle()
     789{
     790    /* Update Nested Paging checkbox: */
     791    AssertPtrReturnVoid(m_pCache);
     792    m_pCheckBoxNestedPaging->setEnabled(   m_pCheckBoxVirtualization->isChecked()
     793                                        && (   (m_pCache->base().m_fSupportedNestedPaging && isMachineOffline())
     794                                            || (m_pCache->base().m_fEnabledNestedPaging && isMachineOffline())));
    739795
    740796    /* Revalidate: */
     
    9441000            /* Configure widgets: */
    9451001#ifndef VBOX_WITH_RAW_MODE
    946             /* Hide VT-x/AMD-V checkbox when raw-mode is not supported: */
     1002            /* Hide HW Virt Ex checkbox when raw-mode is not supported: */
    9471003            m_pWidgetPlaceholder->setVisible(false);
    9481004            m_pCheckBoxVirtualization->setVisible(false);
     
    9711027
    9721028    /* Configure 'Acceleration' connections: */
    973     connect(m_pCheckBoxVirtualization, SIGNAL(stateChanged(int)), this, SLOT(revalidate()));
     1029    connect(m_pCheckBoxVirtualization, &QCheckBox::stateChanged,
     1030            this, &UIMachineSettingsSystem::sltHandleHwVirtExToggle);
    9741031}
    9751032
     
    12571314    return fSuccess;
    12581315}
    1259 
    1260 void UIMachineSettingsSystem::setAccelerationCheckBoxesEnabled(bool fEnabled)
    1261 {
    1262     m_pCheckBoxVirtualization->setEnabled(fEnabled);
    1263     m_pCheckBoxNestedPaging->setEnabled(fEnabled && m_pCheckBoxVirtualization->isChecked());
    1264 }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h

    r72677 r75958  
    4040    ~UIMachineSettingsSystem();
    4141
     42    /** Returns whether the HW Virt Ex is supported. */
     43    bool isHWVirtExSupported() const;
    4244    /** Returns whether the HW Virt Ex is enabled. */
    4345    bool isHWVirtExEnabled() const;
     46
     47    /** Returns whether the Nested Paging is supported. */
     48    bool isNestedPagingSupported() const;
     49    /** Returns whether the Nested Paging is enabled. */
     50    bool isNestedPagingEnabled() const;
    4451
    4552    /** Returns whether the HID is enabled. */
     
    105112    void sltHandleCPUExecCapEditorChange();
    106113
     114    /** Handles HW Virt Ex check-box toggling. */
     115    void sltHandleHwVirtExToggle();
     116
    107117private:
    108118
     
    142152    bool saveAccelerationData();
    143153
    144     /** Defines whether "hardware virtualization" and "nested paging" check-boxes
    145       * (but not the "Paravirtualization Interface" combo-box) is @a fEnabled. */
    146     void setAccelerationCheckBoxesEnabled(bool fEnabled);
    147 
    148154    /** Holds the list of all possible boot items. */
    149155    QList<KDeviceType>  m_possibleBootItems;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui

    r71943 r75958  
    674674 </customwidgets>
    675675 <resources/>
    676  <connections>
    677   <connection>
    678    <sender>m_pCheckBoxVirtualization</sender>
    679    <signal>toggled(bool)</signal>
    680    <receiver>m_pCheckBoxNestedPaging</receiver>
    681    <slot>setEnabled(bool)</slot>
    682   </connection>
    683  </connections>
     676 <connections/>
    684677</ui>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette