VirtualBox

Ignore:
Timestamp:
Dec 3, 2018 5:27:41 PM (6 years ago)
Author:
vboxsync
Message:

Main/Host: add new feature check for nested virtualization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r72394 r75919  
    218218                            fNestedPagingSupported,
    219219                            fUnrestrictedGuestSupported,
     220                            fNestedHWVirtSupported,
    220221                            fRecheckVTSupported;
    221222
     
    300301    m->fNestedPagingSupported = false;
    301302    m->fUnrestrictedGuestSupported = false;
     303    m->fNestedHWVirtSupported = false;
    302304    m->fRecheckVTSupported = false;
    303305
     
    388390                else
    389391                    Assert(m->fUnrestrictedGuestSupported == false);
     392                /** @todo r=klaus put accurate condition here and update it as
     393                 * the feature becomes available with VT-x. */
     394                if (   (fVTCaps & SUPVTCAPS_AMD_V)
     395                    && m->fNestedPagingSupported)
     396                    m->fNestedHWVirtSupported = true;
    390397            }
    391398            else
    392399            {
    393400                LogRel(("SUPR0QueryVTCaps -> %Rrc\n", rc));
    394                 m->fVTSupported = m->fNestedPagingSupported = m->fUnrestrictedGuestSupported = false;
     401                m->fVTSupported = m->fNestedPagingSupported = m->fUnrestrictedGuestSupported
     402                    = m->fNestedHWVirtSupported = false;
    395403            }
    396404            rc = SUPR3Term(false);
     
    10171025        case ProcessorFeature_NestedPaging:
    10181026        case ProcessorFeature_UnrestrictedGuest:
     1027        case ProcessorFeature_NestedHWVirt:
    10191028            break;
    10201029        default:
     
    10321041            && (   aFeature == ProcessorFeature_HWVirtEx
    10331042                || aFeature == ProcessorFeature_NestedPaging
    1034                 || aFeature == ProcessorFeature_UnrestrictedGuest)
     1043                || aFeature == ProcessorFeature_UnrestrictedGuest
     1044                || aFeature == ProcessorFeature_NestedHWVirt)
    10351045           )
    10361046        {
     
    10571067                    else
    10581068                        Assert(m->fUnrestrictedGuestSupported == false);
     1069                    /** @todo r=klaus put accurate condition here and update it as
     1070                     * the feature becomes available with VT-x. */
     1071                    if (   (fVTCaps & SUPVTCAPS_AMD_V)
     1072                        && m->fNestedPagingSupported)
     1073                        m->fNestedHWVirtSupported = true;
    10591074                }
    10601075                else
    10611076                {
    10621077                    LogRel(("SUPR0QueryVTCaps -> %Rrc\n", rc));
    1063                     m->fVTSupported = m->fNestedPagingSupported = m->fUnrestrictedGuestSupported = false;
     1078                    m->fVTSupported = m->fNestedPagingSupported = m->fUnrestrictedGuestSupported
     1079                        = m->fNestedHWVirtSupported = false;
    10641080                }
    10651081                rc = SUPR3Term(false);
     
    10911107            case ProcessorFeature_UnrestrictedGuest:
    10921108                *aSupported = m->fUnrestrictedGuestSupported;
     1109                break;
     1110
     1111            case ProcessorFeature_NestedHWVirt:
     1112                *aSupported = m->fNestedHWVirtSupported;
    10931113                break;
    10941114
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