VirtualBox

Changeset 105364 in vbox


Ignore:
Timestamp:
Jul 17, 2024 7:32:44 AM (10 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164017
Message:

VMM: Expose FMA and F16C instruction set extensions if available and nested paging is supported, bugref:10726

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum-x86-amd64.h

    r105092 r105364  
    889889    /** Support ADX instructions. */
    890890    uint32_t        fAdx : 1;
     891    /** Supports FMA. */
     892    uint32_t        fFma : 1;
     893    /** Supports F16C. */
     894    uint32_t        fF16c : 1;
    891895
    892896    /** Supports AMD 3DNow instructions. */
     
    952956    /** Alignment padding / reserved for future use (96 bits total, plus 12 bytes
    953957     *  prior to the bit fields -> total of 24 bytes) */
    954     uint32_t        fPadding0 : 21;
     958    uint32_t        fPadding0 : 19;
    955959
    956960
  • trunk/src/VBox/VMM/VMMAll/CPUMAllCpuId.cpp

    r101428 r105364  
    14491449        pFeatures->fSse3                = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_SSE3);
    14501450        pFeatures->fSsse3               = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_SSSE3);
     1451        pFeatures->fFma                 = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_FMA);
    14511452        pFeatures->fSse41               = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_SSE4_1);
    14521453        pFeatures->fSse42               = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_SSE4_2);
     
    14671468        pFeatures->fPclMul              = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_PCLMUL);
    14681469        pFeatures->fMovBe               = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_MOVBE);
     1470        pFeatures->fF16c                = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_F16C);
    14691471        if (pFeatures->fVmx)
    14701472            cpumExplodeVmxFeatures(&pMsrs->hwvirt.vmx, pFeatures);
  • trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp

    r105057 r105364  
    10641064    CPUMISAEXTCFG   enmMdsClear;
    10651065    CPUMISAEXTCFG   enmArchCapMsr;
     1066    CPUMISAEXTCFG   enmFma;
     1067    CPUMISAEXTCFG   enmF16c;
    10661068
    10671069    CPUMISAEXTCFG   enmAbm;
     
    13991401                           | X86_CPUID_FEATURE_ECX_SSSE3
    14001402                           //| X86_CPUID_FEATURE_ECX_CNTXID - no L1 context id (MSR++).
    1401                            //| X86_CPUID_FEATURE_ECX_FMA   - not implemented yet.
     1403                           | PASSTHRU_FEATURE(pConfig->enmFma, pHstFeat->fFma, X86_CPUID_FEATURE_ECX_FMA)
    14021404                           | PASSTHRU_FEATURE(pConfig->enmCmpXchg16b, pHstFeat->fCmpXchg16b, X86_CPUID_FEATURE_ECX_CX16)
    14031405                           /* ECX Bit 14 - xTPR Update Control. Processor supports changing IA32_MISC_ENABLES[bit 23]. */
     
    14161418                           //| X86_CPUID_FEATURE_ECX_OSXSAVE - mirrors CR4.OSXSAVE state, set dynamically.
    14171419                           | PASSTHRU_FEATURE(pConfig->enmAvx, pHstFeat->fAvx, X86_CPUID_FEATURE_ECX_AVX)
    1418                            //| X86_CPUID_FEATURE_ECX_F16C  - not implemented yet.
     1420                           | PASSTHRU_FEATURE(pConfig->enmF16c, pHstFeat->fFma, X86_CPUID_FEATURE_ECX_F16C)
    14191421                           | PASSTHRU_FEATURE_TODO(pConfig->enmRdRand, X86_CPUID_FEATURE_ECX_RDRAND)
    14201422                           //| X86_CPUID_FEATURE_ECX_HVP   - Set explicitly later.
     
    28502852                                  "|INVPCID"
    28512853                                  "|FlushCmdMsr"
     2854                                  "|FMA"
     2855                                  "|F16C"
    28522856                                  "|ABM"
    28532857                                  "|SSE4A"
     
    30343038     */
    30353039    rc = cpumR3CpuIdReadIsaExtCfg(pVM, pIsaExts, "ArchCapMsr", &pConfig->enmArchCapMsr, CPUMISAEXTCFG_ENABLED_SUPPORTED_OR_NOT_AMD64);
     3040    AssertLogRelRCReturn(rc, rc);
     3041
     3042    /** @cfgm{/CPUM/IsaExts/FMA, boolean, depends}
     3043     * Expose the FMA instruction set extensions to the guest if available and
     3044     * XSAVE is exposed too. For the time being the default is to only expose this
     3045     * to VMs with nested paging and AMD-V or unrestricted guest execution mode.
     3046     */
     3047    rc = cpumR3CpuIdReadIsaExtCfgEx(pVM, pIsaExts, "FMA", &pConfig->enmFma, fNestedPagingAndFullGuestExec /* temporarily */,
     3048                                    fMayHaveXSave && pConfig->enmXSave && (fXStateHostMask & XSAVE_C_YMM) /*fAllowed*/);
     3049    AssertLogRelRCReturn(rc, rc);
     3050
     3051    /** @cfgm{/CPUM/IsaExts/F16C, boolean, depends}
     3052     * Expose the F16C instruction set extensions to the guest if available and
     3053     * XSAVE is exposed too. For the time being the default is to only expose this
     3054     * to VMs with nested paging and AMD-V or unrestricted guest execution mode.
     3055     */
     3056    rc = cpumR3CpuIdReadIsaExtCfgEx(pVM, pIsaExts, "F16C", &pConfig->enmF16c, fNestedPagingAndFullGuestExec /* temporarily */,
     3057                                    fMayHaveXSave && pConfig->enmXSave && (fXStateHostMask & XSAVE_C_YMM) /*fAllowed*/);
    30363058    AssertLogRelRCReturn(rc, rc);
    30373059
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