VirtualBox

Changeset 104066 in vbox for trunk


Ignore:
Timestamp:
Mar 26, 2024 4:06:07 PM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
162459
Message:

ValKit/bootsectors: Added a g_cBs3ThresholdNativeRecompiler variable that can be used instead of BS3_THRESHOLD_NATIVE_RECOMPILER, initializing it with the VMMDEV_TESTING_CFG_THRESHOLD_NATIVE_RECOMPILER value from the host if available. bugref:9898

Location:
trunk/src/VBox/ValidationKit/bootsectors
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-2-template.c

    r104015 r104066  
    970970        uint64_t RT_FAR * const     puMemPtrRegExpt= paTests[iTest].fDstMem ? &(&CtxExpect.rax)[idxDstReg & 15].u : NULL; \
    971971        unsigned                    cRecompOuter   = 0; \
    972         unsigned const              cMaxRecompOuter= cBitsImm != 8 ? BS3_THRESHOLD_NATIVE_RECOMPILER + cTestData : 1; \
    973         unsigned const              cMaxRecompInner= cBitsImm != 8 ? 1 : BS3_THRESHOLD_NATIVE_RECOMPILER; \
     972        unsigned const              cMaxRecompOuter= cBitsImm != 8 ? g_cBs3ThresholdNativeRecompiler + cTestData : 1; \
     973        unsigned const              cMaxRecompInner= cBitsImm != 8 ? 1 : g_cBs3ThresholdNativeRecompiler; \
    974974        /*Bs3TestPrintf("\n"#a_cBits ": pfnWorker=%p cBitsImm=%d (%d)\n", paTests[iTest].pfnWorker, cBitsImm, paTests[iTest].cBitsImm);*/ \
    975975        \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-3.c32

    r104060 r104066  
    771771                    uint16_t        idTestStep  = bRing * 10000 + iCfg * 100 + iTest * 10;
    772772                    unsigned        cRecompRuns = 0;
     773                    unsigned const  cMaxRecompRuns = g_cBs3ThresholdNativeRecompiler + cValues;
    773774                    unsigned        iVal;
    774775
     
    795796                     * Iterate the test values and do the actual testing.
    796797                     */
    797                     while (cRecompRuns < BS3_THRESHOLD_NATIVE_RECOMPILER + cValues)
     798                    while (cRecompRuns < cMaxRecompRuns)
    798799                        for (iVal = 0; iVal < cValues; iVal++, idTestStep++, cRecompRuns++)
    799800                        {
     
    92609261                    uint16_t        idTestStep  = bRing * 10000 + iCfg * 100 + iTest * 10;
    92619262                    unsigned        cRecompRuns = 0;
     9263                    unsigned const  cMaxRecompRuns = g_cBs3ThresholdNativeRecompiler + cValues;
    92629264                    unsigned        iVal;
    92639265
     
    92849286                     * Iterate the test values and do the actual testing.
    92859287                     */
    9286                     while (cRecompRuns < BS3_THRESHOLD_NATIVE_RECOMPILER + cValues)
     9288                    while (cRecompRuns < cMaxRecompRuns)
    92879289                        for (iVal = 0; iVal < cValues; iVal++, idTestStep++, cRecompRuns++)
    92889290                        {
     
    1012810130                    uint16_t        idTestStep  = bRing * 10000 + iCfg * 100 + iTest * 10;
    1012910131                    unsigned        cRecompRuns = 0;
     10132                    unsigned const  cMaxRecompRuns = g_cBs3ThresholdNativeRecompiler + cValues;
    1013010133                    unsigned        iVal;
    1013110134
     
    1015210155                     * Iterate the test values and do the actual testing.
    1015310156                     */
    10154                     while (cRecompRuns < BS3_THRESHOLD_NATIVE_RECOMPILER + cValues)
     10157                    while (cRecompRuns < cMaxRecompRuns)
    1015510158                        for (iVal = 0; iVal < cValues; iVal++, idTestStep++, cRecompRuns++)
    1015610159                        {
     
    1243012433                    uint16_t        idTestStep  = bRing * 10000 + iCfg * 100 + iTest * 10;
    1243112434                    unsigned        cRecompRuns = 0;
     12435                    unsigned const  cMaxRecompRuns = g_cBs3ThresholdNativeRecompiler + cValues * 2;
    1243212436                    unsigned        iVal;
    1243312437
     
    1245412458                     * Iterate the test values and do the actual testing.
    1245512459                     */
    12456                     while (cRecompRuns < BS3_THRESHOLD_NATIVE_RECOMPILER + cValues * 2)
     12460                    while (cRecompRuns < cMaxRecompRuns)
    1245712461                        for (iVal = 0; iVal < cValues; iVal++, idTestStep++, cRecompRuns++)
    1245812462                        {
     
    1277112775                    uint16_t        idTestStep  = bRing * 10000 + iCfg * 100 + iTest * 10;
    1277212776                    unsigned        cRecompRuns = 0;
     12777                    unsigned const  cMaxRecompRuns = g_cBs3ThresholdNativeRecompiler + cValues;
    1277312778                    unsigned        iVal;
    1277412779
     
    1279512800                     * Iterate the test values and do the actual testing.
    1279612801                     */
    12797                     while (cRecompRuns < BS3_THRESHOLD_NATIVE_RECOMPILER + cValues)
     12802                    while (cRecompRuns < cMaxRecompRuns)
    1279812803                        for (iVal = 0; iVal < cValues; iVal++, idTestStep++, cRecompRuns++)
    1279912804                        {
     
    1335013355                    uint16_t        idTestStep  = bRing * 10000 + iCfg * 100 + iTest * 10;
    1335113356                    unsigned        cRecompRuns = 0;
     13357                    unsigned const  cMaxRecompRuns = g_cBs3ThresholdNativeRecompiler + cValues;
    1335213358                    unsigned        iVal;
    1335313359
     
    1337413380                     * Iterate the test values and do the actual testing.
    1337513381                     */
    13376                     while (cRecompRuns < BS3_THRESHOLD_NATIVE_RECOMPILER + cValues)
     13382                    while (cRecompRuns < cMaxRecompRuns)
    1337713383                        for (iVal = 0; iVal < cValues; iVal++, idTestStep++, cRecompRuns++)
    1337813384                        {
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestData.c

    r103262 r104066  
    8585uint16_t    g_usBs3TestStep;
    8686
     87/** The host configurable BS3_THRESHOLD_NATIVE_RECOMPILER value. */
     88uint16_t    g_cBs3ThresholdNativeRecompiler = BS3_THRESHOLD_NATIVE_RECOMPILER;
     89
     90
    8791/** VMMDEV_TESTING_UNIT_XXX -> string */
    8892char const  g_aszBs3TestUnitNames[][12] =
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestInit.c

    r98103 r104066  
    4141#include "bs3kit-template-header.h"
    4242#include "bs3-cmn-test.h"
     43#include <iprt/asm-amd64-x86.h>
    4344
    4445
     
    6364    g_cusBs3SubTestsFailed      = 0;
    6465    g_fbBs3VMMDevTesting        = bs3TestIsVmmDevTestingPresent();
     66    if (g_fbBs3VMMDevTesting)
     67    {
     68        uint16_t uValue;
     69#if ARCH_BITS == 16
     70        ASMOutU16(VMMDEV_TESTING_IOPORT_CMD, (uint16_t)VMMDEV_TESTING_CMD_QUERY_CFG);
     71#else
     72        ASMOutU32(VMMDEV_TESTING_IOPORT_CMD, VMMDEV_TESTING_CMD_QUERY_CFG);
     73#endif
     74        ASMOutU16(VMMDEV_TESTING_IOPORT_DATA, VMMDEV_TESTING_CFG_THRESHOLD_NATIVE_RECOMPILER);
     75        uValue = ASMInU16(VMMDEV_TESTING_IOPORT_DATA);
     76Bs3TestPrintf("VMMDEV_TESTING_CFG_THRESHOLD_NATIVE_RECOMPILER=%RU16\n", uValue);
     77        if (uValue > 0 && uValue < 1024)
     78            g_cBs3ThresholdNativeRecompiler = uValue;
     79    }
    6580
    6681    /*
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r103867 r104066  
    195195 *
    196196 * @{ */
    197 
    198 /** Test repetitions necessary to make sure of engaging native recompilation.
    199  * @note See iemTbCacheLookup() for the actual constant. */
    200 #define BS3_THRESHOLD_NATIVE_RECOMPILER     18
    201197
    202198
     
    36173613extern uint16_t g_usBs3TestStep;
    36183614
     3615/** Test repetitions necessary to make sure of engaging native recompilation.
     3616 * @note See iemTbCacheLookup() for the actual constant. */
     3617#define BS3_THRESHOLD_NATIVE_RECOMPILER     18
     3618
     3619/** The host configurable BS3_THRESHOLD_NATIVE_RECOMPILER value.
     3620 * The host configuration is read by Bs3TestInit, before that it has the same
     3621 * value as the compiletime constant. */
     3622extern uint16_t g_cBs3ThresholdNativeRecompiler;
     3623
    36193624/**
    36203625 * Equivalent to RTTestCreate + RTTestBanner.
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