VirtualBox

Changeset 51981 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Jul 11, 2014 6:16:19 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94908
Message:

VMM/GIM, VMM/HM: Add support for Hyper-V hypervisor capabilities reporting through CPUID. Updated saved states as well, will break old states.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/GIMHv.cpp

    r51980 r51981  
    8888    if (!pVM->gim.s.u32Version)
    8989    {
     90        /* Basic features. */
    9091        pHv->uBaseFeat = 0
    9192                       //| GIM_HV_BASE_FEAT_VP_RUNTIME_MSR
     
    104105                       ;
    105106
     107        /* Miscellaneous features. */
    106108        pHv->uMiscFeat = GIM_HV_MISC_FEAT_TIMER_FREQ;
    107109
     110        /* Hypervisor recommendations to the guest. */
    108111        pHv->uHyperHints = GIM_HV_HINT_MSR_FOR_SYS_RESET;
     112
     113        /* Hypervisor capabilities; features used by the hypervisor. */
     114        pHv->uHyperCaps  = HMIsNestedPagingActive(pVM)   ? GIM_HV_HOST_FEAT_NESTED_PAGING : 0;
     115        pHv->uHyperCaps |= HMAreMsrBitmapsAvailable(pVM) ? GIM_HV_HOST_FEAT_MSR_BITMAP : 0;
    109116    }
    110117
     
    161168    RT_ZERO(HyperLeaf);
    162169    HyperLeaf.uLeaf        = UINT32_C(0x40000000);
    163     HyperLeaf.uEax         = UINT32_C(0x40000005); /* Minimum value for Hyper-V */
     170    HyperLeaf.uEax         = UINT32_C(0x40000006); /* Minimum value for Hyper-V is 0x40000005. */
    164171    HyperLeaf.uEbx         = 0x7263694D;           /* 'Micr' */
    165172    HyperLeaf.uEcx         = 0x666F736F;           /* 'osof' */
     
    203210    AssertLogRelRCReturn(rc, rc);
    204211
     212    HyperLeaf.uLeaf        = UINT32_C(0x40000006);
     213    HyperLeaf.uEax         = pHv->uHyperCaps;
     214    HyperLeaf.uEbx         = 0;
     215    HyperLeaf.uEcx         = 0;
     216    HyperLeaf.uEdx         = 0;
     217    rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
     218    AssertLogRelRCReturn(rc, rc);
     219
    205220    /*
    206221     * Insert all MSR ranges of Hyper-V.
     
    321336    rc = SSMR3PutU32(pSSM, pcHv->uMiscFeat);                AssertRCReturn(rc, rc);
    322337    rc = SSMR3PutU32(pSSM, pcHv->uHyperHints);              AssertRCReturn(rc, rc);
     338    rc = SSMR3PutU32(pSSM, pcHv->uHyperCaps);               AssertRCReturn(rc, rc);
    323339
    324340    /*
     
    384400    rc = SSMR3GetU32(pSSM, &pHv->uMiscFeat);                AssertRCReturn(rc, rc);
    385401    rc = SSMR3GetU32(pSSM, &pHv->uHyperHints);              AssertRCReturn(rc, rc);
     402    rc = SSMR3GetU32(pSSM, &pHv->uHyperCaps);               AssertRCReturn(rc, rc);
    386403
    387404    /*
Note: See TracChangeset for help on using the changeset viewer.

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