VirtualBox

vbox的更動 54714 路徑 trunk/src/VBox/VMM/VMMAll


忽略:
時間撮記:
2015-3-11 下午02:00:23 (10 年 以前)
作者:
vboxsync
訊息:

PATM,CPUM: CPUID patch update.

位置:
trunk/src/VBox/VMM/VMMAll
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp

    r54674 r54714  
    13281328    PVM             pVM          = pVCpu->CTX_SUFF(pVM);
    13291329    uint64_t const  uOldEfer     = pVCpu->cpum.s.Guest.msrEFER;
    1330     uint32_t const  fExtFeatures = pVM->cpum.s.aGuestCpuIdPatmExt[0].eax >= 0x80000001
    1331                                  ? pVM->cpum.s.aGuestCpuIdPatmExt[1].edx
     1330    uint32_t const  fExtFeatures = pVM->cpum.s.aGuestCpuIdPatmExt[0].uEax >= 0x80000001
     1331                                 ? pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx
    13321332                                 : 0;
    13331333    uint64_t        fMask        = 0;
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r54674 r54714  
    11791179                    if (uSubLeaf < paLeaves[i].uSubLeaf)
    11801180                        while (   i > 0
    1181                                && uLeaf    == paLeaves[i].uLeaf
    1182                                && uSubLeaf  < paLeaves[i].uSubLeaf)
     1181                               && uLeaf    == paLeaves[i - 1].uLeaf
     1182                               && uSubLeaf <= paLeaves[i - 1].uSubLeaf)
    11831183                            i--;
    11841184                    else
     
    12171217        pCpuId = &pVM->cpum.s.aGuestCpuIdPatmExt[iLeaf - UINT32_C(0x80000000)];
    12181218    else if (   iLeaf - UINT32_C(0x40000000) < 0x100   /** @todo Fix this later: Hyper-V says 0x400000FF is the last valid leaf. */
    1219              && (pVCpu->CTX_SUFF(pVM)->cpum.s.aGuestCpuIdPatmStd[1].ecx & X86_CPUID_FEATURE_ECX_HVP)) /* Only report if HVP bit set. */
     1219             && (pVCpu->CTX_SUFF(pVM)->cpum.s.aGuestCpuIdPatmStd[1].uEcx & X86_CPUID_FEATURE_ECX_HVP)) /* Only report if HVP bit set. */
    12201220    {
    12211221        PCPUMCPUIDLEAF pHyperLeaf = cpumCpuIdGetLeaf(pVM, iLeaf, 0 /* uSubLeaf */);
     
    12401240    uint32_t cCurrentCacheIndex = *pEcx;
    12411241
    1242     *pEax = pCpuId->eax;
    1243     *pEbx = pCpuId->ebx;
    1244     *pEcx = pCpuId->ecx;
    1245     *pEdx = pCpuId->edx;
     1242    *pEax = pCpuId->uEax;
     1243    *pEbx = pCpuId->uEbx;
     1244    *pEcx = pCpuId->uEcx;
     1245    *pEdx = pCpuId->uEdx;
    12461246
    12471247    if (    iLeaf == 1)
     
    13281328            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    13291329            if (pLeaf)
    1330                 pVM->cpum.s.aGuestCpuIdPatmStd[1].edx = pLeaf->uEdx |= X86_CPUID_FEATURE_EDX_APIC;
     1330                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEdx = pLeaf->uEdx |= X86_CPUID_FEATURE_EDX_APIC;
    13311331
    13321332            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x80000001), 0);
    13331333            if (   pLeaf
    13341334                && pVM->cpum.s.GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_AMD)
    1335                 pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx |= X86_CPUID_AMD_FEATURE_EDX_APIC;
     1335                pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx |= X86_CPUID_AMD_FEATURE_EDX_APIC;
    13361336
    13371337            pVM->cpum.s.GuestFeatures.fApic = 1;
     
    13451345            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    13461346            if (pLeaf)
    1347                 pVM->cpum.s.aGuestCpuIdPatmStd[1].ecx = pLeaf->uEcx |= X86_CPUID_FEATURE_ECX_X2APIC;
     1347                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEcx = pLeaf->uEcx |= X86_CPUID_FEATURE_ECX_X2APIC;
    13481348            pVM->cpum.s.GuestFeatures.fX2Apic = 1;
    13491349            LogRel(("CPUM: SetGuestCpuIdFeature: Enabled x2APIC\n"));
     
    13631363            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    13641364            if (pLeaf)
    1365                 pVM->cpum.s.aGuestCpuIdPatmStd[1].edx = pLeaf->uEdx |= X86_CPUID_FEATURE_EDX_SEP;
     1365                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEdx = pLeaf->uEdx |= X86_CPUID_FEATURE_EDX_SEP;
    13661366            pVM->cpum.s.GuestFeatures.fSysEnter = 1;
    13671367            LogRel(("CPUM: SetGuestCpuIdFeature: Enabled SYSENTER/EXIT\n"));
     
    13901390
    13911391            /* Valid for both Intel and AMD CPUs, although only in 64 bits mode for Intel. */
    1392             pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx |= X86_CPUID_EXT_FEATURE_EDX_SYSCALL;
     1392            pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx |= X86_CPUID_EXT_FEATURE_EDX_SYSCALL;
    13931393            pVM->cpum.s.GuestFeatures.fSysCall = 1;
    13941394            LogRel(("CPUM: SetGuestCpuIdFeature: Enabled SYSCALL/RET\n"));
     
    14081408            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    14091409            if (pLeaf)
    1410                 pVM->cpum.s.aGuestCpuIdPatmStd[1].edx = pLeaf->uEdx |= X86_CPUID_FEATURE_EDX_PAE;
     1410                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEdx = pLeaf->uEdx |= X86_CPUID_FEATURE_EDX_PAE;
    14111411
    14121412            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x80000001), 0);
    14131413            if (    pLeaf
    14141414                &&  pVM->cpum.s.GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_AMD)
    1415                 pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx |= X86_CPUID_AMD_FEATURE_EDX_PAE;
     1415                pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx |= X86_CPUID_AMD_FEATURE_EDX_PAE;
    14161416
    14171417            pVM->cpum.s.GuestFeatures.fPae = 1;
     
    14331433
    14341434            /* Valid for both Intel and AMD. */
    1435             pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx |= X86_CPUID_EXT_FEATURE_EDX_LONG_MODE;
     1435            pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx |= X86_CPUID_EXT_FEATURE_EDX_LONG_MODE;
    14361436            pVM->cpum.s.GuestFeatures.fLongMode = 1;
    14371437            LogRel(("CPUM: SetGuestCpuIdFeature: Enabled LONG MODE\n"));
     
    14521452
    14531453            /* Valid for both Intel and AMD. */
    1454             pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx |= X86_CPUID_EXT_FEATURE_EDX_NX;
     1454            pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx |= X86_CPUID_EXT_FEATURE_EDX_NX;
    14551455            pVM->cpum.s.GuestFeatures.fNoExecute = 1;
    14561456            LogRel(("CPUM: SetGuestCpuIdFeature: Enabled NX\n"));
     
    14721472
    14731473            /* Valid for both Intel and AMD. */
    1474             pVM->cpum.s.aGuestCpuIdPatmExt[1].ecx = pLeaf->uEcx |= X86_CPUID_EXT_FEATURE_ECX_LAHF_SAHF;
     1474            pVM->cpum.s.aGuestCpuIdPatmExt[1].uEcx = pLeaf->uEcx |= X86_CPUID_EXT_FEATURE_ECX_LAHF_SAHF;
    14751475            pVM->cpum.s.GuestFeatures.fLahfSahf = 1;
    14761476            LogRel(("CPUM: SetGuestCpuIdFeature: Enabled LAHF/SAHF\n"));
     
    14851485            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    14861486            if (pLeaf)
    1487                 pVM->cpum.s.aGuestCpuIdPatmStd[1].edx = pLeaf->uEdx |= X86_CPUID_FEATURE_EDX_PAT;
     1487                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEdx = pLeaf->uEdx |= X86_CPUID_FEATURE_EDX_PAT;
    14881488
    14891489            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x80000001), 0);
    14901490            if (   pLeaf
    14911491                && pVM->cpum.s.GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_AMD)
    1492                 pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx |= X86_CPUID_AMD_FEATURE_EDX_PAT;
     1492                pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx |= X86_CPUID_AMD_FEATURE_EDX_PAT;
    14931493
    14941494            pVM->cpum.s.GuestFeatures.fPat = 1;
     
    15121512
    15131513            /* Valid for both Intel and AMD. */
    1514             pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx |= X86_CPUID_EXT_FEATURE_EDX_RDTSCP;
     1514            pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx |= X86_CPUID_EXT_FEATURE_EDX_RDTSCP;
    15151515            pVM->cpum.s.HostFeatures.fRdTscP = 1;
    15161516            LogRel(("CPUM: SetGuestCpuIdFeature: Enabled RDTSCP.\n"));
     
    15231523            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    15241524            if (pLeaf)
    1525                 pVM->cpum.s.aGuestCpuIdPatmStd[1].ecx = pLeaf->uEcx |= X86_CPUID_FEATURE_ECX_HVP;
     1525                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEcx = pLeaf->uEcx |= X86_CPUID_FEATURE_ECX_HVP;
    15261526            pVM->cpum.s.GuestFeatures.fHypervisorPresent = 1;
    15271527            LogRel(("CPUM: SetGuestCpuIdFeature: Enabled Hypervisor Present bit\n"));
     
    15421542
    15431543            /* Valid for both Intel and AMD. */
    1544             pVM->cpum.s.aGuestCpuIdPatmStd[5].ecx = pLeaf->uEcx |= X86_CPUID_MWAIT_ECX_EXT | X86_CPUID_MWAIT_ECX_BREAKIRQIF0;
     1544            pVM->cpum.s.aGuestCpuIdPatmStd[5].uEcx = pLeaf->uEcx |= X86_CPUID_MWAIT_ECX_EXT | X86_CPUID_MWAIT_ECX_BREAKIRQIF0;
    15451545            pVM->cpum.s.GuestFeatures.fMWaitExtensions = 1;
    15461546            LogRel(("CPUM: SetGuestCpuIdFeature: Enabled MWAIT Extensions.\n"));
     
    16071607            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    16081608            if (pLeaf)
    1609                 pVM->cpum.s.aGuestCpuIdPatmStd[1].edx = pLeaf->uEdx &= ~X86_CPUID_FEATURE_EDX_APIC;
     1609                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEdx = pLeaf->uEdx &= ~X86_CPUID_FEATURE_EDX_APIC;
    16101610
    16111611            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x80000001), 0);
    16121612            if (   pLeaf
    16131613                && pVM->cpum.s.GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_AMD)
    1614                 pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx &= ~X86_CPUID_AMD_FEATURE_EDX_APIC;
     1614                pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx &= ~X86_CPUID_AMD_FEATURE_EDX_APIC;
    16151615
    16161616            pVM->cpum.s.GuestFeatures.fApic = 0;
     
    16211621            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    16221622            if (pLeaf)
    1623                 pVM->cpum.s.aGuestCpuIdPatmStd[1].ecx = pLeaf->uEcx &= ~X86_CPUID_FEATURE_ECX_X2APIC;
     1623                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEcx = pLeaf->uEcx &= ~X86_CPUID_FEATURE_ECX_X2APIC;
    16241624            pVM->cpum.s.GuestFeatures.fX2Apic = 0;
    16251625            Log(("CPUM: ClearGuestCpuIdFeature: Disabled x2APIC\n"));
     
    16291629            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    16301630            if (pLeaf)
    1631                 pVM->cpum.s.aGuestCpuIdPatmStd[1].edx = pLeaf->uEdx &= ~X86_CPUID_FEATURE_EDX_PAE;
     1631                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEdx = pLeaf->uEdx &= ~X86_CPUID_FEATURE_EDX_PAE;
    16321632
    16331633            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x80000001), 0);
    16341634            if (   pLeaf
    16351635                && pVM->cpum.s.GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_AMD)
    1636                 pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx &= ~X86_CPUID_AMD_FEATURE_EDX_PAE;
     1636                pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx &= ~X86_CPUID_AMD_FEATURE_EDX_PAE;
    16371637
    16381638            pVM->cpum.s.GuestFeatures.fPae = 0;
     
    16431643            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    16441644            if (pLeaf)
    1645                 pVM->cpum.s.aGuestCpuIdPatmStd[1].edx = pLeaf->uEdx &= ~X86_CPUID_FEATURE_EDX_PAT;
     1645                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEdx = pLeaf->uEdx &= ~X86_CPUID_FEATURE_EDX_PAT;
    16461646
    16471647            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x80000001), 0);
    16481648            if (   pLeaf
    16491649                && pVM->cpum.s.GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_AMD)
    1650                 pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx &= ~X86_CPUID_AMD_FEATURE_EDX_PAT;
     1650                pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx &= ~X86_CPUID_AMD_FEATURE_EDX_PAT;
    16511651
    16521652            pVM->cpum.s.GuestFeatures.fPat = 0;
     
    16571657            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x80000001), 0);
    16581658            if (pLeaf)
    1659                 pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx &= ~X86_CPUID_EXT_FEATURE_EDX_LONG_MODE;
     1659                pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx &= ~X86_CPUID_EXT_FEATURE_EDX_LONG_MODE;
    16601660            pVM->cpum.s.GuestFeatures.fLongMode = 0;
    16611661            break;
     
    16641664            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x80000001), 0);
    16651665            if (pLeaf)
    1666                 pVM->cpum.s.aGuestCpuIdPatmExt[1].ecx = pLeaf->uEcx &= ~X86_CPUID_EXT_FEATURE_ECX_LAHF_SAHF;
     1666                pVM->cpum.s.aGuestCpuIdPatmExt[1].uEcx = pLeaf->uEcx &= ~X86_CPUID_EXT_FEATURE_ECX_LAHF_SAHF;
    16671667            pVM->cpum.s.GuestFeatures.fLahfSahf = 0;
    16681668            break;
     
    16711671            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x80000001), 0);
    16721672            if (pLeaf)
    1673                 pVM->cpum.s.aGuestCpuIdPatmExt[1].edx = pLeaf->uEdx &= ~X86_CPUID_EXT_FEATURE_EDX_RDTSCP;
     1673                pVM->cpum.s.aGuestCpuIdPatmExt[1].uEdx = pLeaf->uEdx &= ~X86_CPUID_EXT_FEATURE_EDX_RDTSCP;
    16741674            pVM->cpum.s.GuestFeatures.fRdTscP = 0;
    16751675            Log(("CPUM: ClearGuestCpuIdFeature: Disabled RDTSCP!\n"));
     
    16791679            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000001), 0);
    16801680            if (pLeaf)
    1681                 pVM->cpum.s.aGuestCpuIdPatmStd[1].ecx = pLeaf->uEcx &= ~X86_CPUID_FEATURE_ECX_HVP;
     1681                pVM->cpum.s.aGuestCpuIdPatmStd[1].uEcx = pLeaf->uEcx &= ~X86_CPUID_FEATURE_ECX_HVP;
    16821682            pVM->cpum.s.GuestFeatures.fHypervisorPresent = 0;
    16831683            break;
     
    16861686            pLeaf = cpumCpuIdGetLeaf(pVM, UINT32_C(0x00000005), 0);
    16871687            if (pLeaf)
    1688                 pVM->cpum.s.aGuestCpuIdPatmStd[5].ecx = pLeaf->uEcx &= ~(X86_CPUID_MWAIT_ECX_EXT | X86_CPUID_MWAIT_ECX_BREAKIRQIF0);
     1688                pVM->cpum.s.aGuestCpuIdPatmStd[5].uEcx = pLeaf->uEcx &= ~(X86_CPUID_MWAIT_ECX_EXT | X86_CPUID_MWAIT_ECX_BREAKIRQIF0);
    16891689            pVM->cpum.s.GuestFeatures.fMWaitExtensions = 0;
    16901690            Log(("CPUM: ClearGuestCpuIdFeature: Disabled MWAIT Extensions!\n"));
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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