VirtualBox

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


Ignore:
Timestamp:
Jul 17, 2024 7:32:44 AM (6 months ago)
Author:
vboxsync
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.

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