VirtualBox

Ignore:
Timestamp:
Mar 19, 2020 1:08:23 PM (5 years ago)
Author:
vboxsync
Message:

ValKit/bs3-fpustate-1: amd adjustments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-fpustate-1-template.c

    r83318 r83329  
    133133    bool                fReadError = false;
    134134    BS3PTRUNION         MmioReg;
    135 
     135    BS3CPUVENDOR const  enmCpuVendor = Bs3GetCpuVendor();
     136    bool const          fFastFxSaveRestore = RT_BOOL(ASMCpuId_EDX(0x80000001) & X86_CPUID_AMD_FEATURE_EDX_FFXSR);
     137    //bool const          fFdpXcptOnly = (ASMCpuIdEx_EBX(7, 0) & X86_CPUID_STEXT_FEATURE_EBX_FDP_EXCPTN_ONLY)
     138    //                                && ASMCpuId_EAX(0) >= 7;
    136139
    137140# undef  CHECK_STATE
     
    295298        /* Using the FPU is a little complicated, but we really need to check these things. */
    296299        CHECK_READBACK_READ_RUN(FMUL,    TMPL_NM(bs3FpuState1_FMul),         uint64_t);
    297         if (1)
     300        if (enmCpuVendor == BS3CPUVENDOR_INTEL)
    298301# if BS3_MODE_IS_16BIT_CODE(TMPL_MODE)
    299             pExpected->FOP    =  0x40f; // skylake 6700k
     302            pExpected->FOP    = 0x040f; // skylake 6700k
    300303# else
    301             pExpected->FOP    =  0x40b; // skylake 6700k
    302 # endif
     304            pExpected->FOP    = 0x040b; // skylake 6700k
     305# endif
     306        else if (enmCpuVendor == BS3CPUVENDOR_AMD && fFastFxSaveRestore)
     307            pExpected->FOP    = 0x0000; // Zen2 (3990x)
    303308        else
    304             pExpected->FOP    = 0x7dc; // dunno where we got this.
     309            pExpected->FOP    = 0x07dc; // dunno where we got this.
    305310# if ARCH_BITS == 64
    306311        pExpected->FPUDP  = (uint32_t) (uintptr_t)&MmioReg.pb[off];
     
    312317        pExpected->FPUDP  = BS3_FP_OFF(&MmioReg.pb[off]);
    313318# endif
     319        if (enmCpuVendor == BS3CPUVENDOR_AMD && fFastFxSaveRestore)
     320            pExpected->FPUDP = 0; // Zen2 (3990x)
    314321        CHECK_STATE(FMUL);
    315322
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