VirtualBox

Changeset 100625 in vbox for trunk


Ignore:
Timestamp:
Jul 18, 2023 10:10:57 AM (17 months ago)
Author:
vboxsync
Message:

CPUID: Expose AMD XSaveErPtr CPUID bit to guests. Eliminates fxsave_leak bug in Linux.

File:
1 edited

Legend:

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

    r99775 r100625  
    22672267
    22682268    /* Cpuid 0x80000008:
    2269      * AMD:               EBX, EDX - reserved
    2270      *                    EAX: Virtual/Physical/Guest address Size
     2269     * AMD:               EAX: Long Mode Size Identifiers
     2270     *                    EBX: Extended Feature Identifiers
    22712271     *                    ECX: Number of cores + APICIdCoreIdSize
     2272     *                    EDX: RDPRU Register Identifier Range
    22722273     * Intel:             EAX: Virtual/Physical address Size
    22732274     *                    EBX, ECX, EDX - reserved
     
    22772278     * We only expose the virtual+pysical address size to the guest atm.
    22782279     * On AMD we set the core count, but not the apic id stuff as we're
    2279      * currently not doing the apic id assignments in a complatible manner.
     2280     * currently not doing the apic id assignments in a compatible manner.
    22802281     */
    22812282    uSubLeaf = 0;
     
    22832284    {
    22842285        pCurLeaf->uEax &= UINT32_C(0x0000ffff); /* Virtual & physical address sizes only. */
    2285         pCurLeaf->uEbx  = 0;  /* reserved - [12] == IBPB */
     2286        if (   pCpum->GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_AMD
     2287            || pCpum->GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_HYGON)
     2288        {
     2289            /* Expose XSaveErPtr aka RstrFpErrPtrs to guest. */
     2290            pCurLeaf->uEbx &= X86_CPUID_AMD_EFEID_EBX_XSAVE_ER_PTR;  /* reserved - [12] == IBPB */
     2291        }
     2292        else
     2293            pCurLeaf->uEbx  = 0;    /* reserved */
     2294
    22862295        pCurLeaf->uEdx  = 0;  /* reserved */
    22872296
     
    49945003    DBGFREGSUBFIELD_RO("CLZERO\0"       "Clear zero instruction (cacheline)",            0, 1, 0),
    49955004    DBGFREGSUBFIELD_RO("IRPerf\0"       "Instructions retired count support",            1, 1, 0),
    4996     DBGFREGSUBFIELD_RO("XSaveErPtr\0"   "Save/restore error pointers (FXSAVE/RSTOR*)",   2, 1, 0),
     5005    DBGFREGSUBFIELD_RO("XSaveErPtr\0"   "Save/restore error pointers (FXSAVE/RSTOR)",    2, 1, 0),
    49975006    DBGFREGSUBFIELD_RO("RDPRU\0"        "RDPRU instruction",                             4, 1, 0),
    49985007    DBGFREGSUBFIELD_RO("MCOMMIT\0"      "MCOMMIT instruction",                           8, 1, 0),
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