VirtualBox

Changeset 93460 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 27, 2022 4:50:15 PM (3 years ago)
Author:
vboxsync
Message:

Main/MachineDebugger,VBoxHeadless,VirtualBoxVM,VBoxSDL,VBoxDbg: Removed a few obsolete raw-mode attributes and changed the VM attribute into getUVMAndVMMFunctionTable, restricting it to calls from within the VM process. bugref:10074

Location:
trunk/src/VBox/Frontends
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp

    r93115 r93460  
    799799    unsigned cVRDEProperties = 0;
    800800    const char *aVRDEProperties[16];
    801     unsigned fRawR0 = ~0U;
    802     unsigned fRawR3 = ~0U;
    803     unsigned fPATM  = ~0U;
    804     unsigned fCSAM  = ~0U;
    805801    unsigned fPaused = 0;
    806802#ifdef VBOX_WITH_RECORDING
     
    828824    enum eHeadlessOptions
    829825    {
    830         OPT_RAW_R0 = 0x100,
    831         OPT_NO_RAW_R0,
    832         OPT_RAW_R3,
    833         OPT_NO_RAW_R3,
    834         OPT_PATM,
    835         OPT_NO_PATM,
    836         OPT_CSAM,
    837         OPT_NO_CSAM,
    838         OPT_SETTINGSPW,
     826        OPT_SETTINGSPW = 0x100,
    839827        OPT_SETTINGSPW_FILE,
    840828        OPT_COMMENT,
     
    856844        { "-vrdeproperty", 'e', RTGETOPT_REQ_STRING },
    857845        { "--vrdeproperty", 'e', RTGETOPT_REQ_STRING },
    858         { "-rawr0", OPT_RAW_R0, 0 },
    859         { "--rawr0", OPT_RAW_R0, 0 },
    860         { "-norawr0", OPT_NO_RAW_R0, 0 },
    861         { "--norawr0", OPT_NO_RAW_R0, 0 },
    862         { "-rawr3", OPT_RAW_R3, 0 },
    863         { "--rawr3", OPT_RAW_R3, 0 },
    864         { "-norawr3", OPT_NO_RAW_R3, 0 },
    865         { "--norawr3", OPT_NO_RAW_R3, 0 },
    866         { "-patm", OPT_PATM, 0 },
    867         { "--patm", OPT_PATM, 0 },
    868         { "-nopatm", OPT_NO_PATM, 0 },
    869         { "--nopatm", OPT_NO_PATM, 0 },
    870         { "-csam", OPT_CSAM, 0 },
    871         { "--csam", OPT_CSAM, 0 },
    872         { "-nocsam", OPT_NO_CSAM, 0 },
    873         { "--nocsam", OPT_NO_CSAM, 0 },
    874846        { "--settingspw", OPT_SETTINGSPW, RTGETOPT_REQ_STRING },
    875847        { "--settingspwfile", OPT_SETTINGSPW_FILE, RTGETOPT_REQ_STRING },
     
    921893                     RTPrintf("Warning: too many VRDE properties. Ignored: '%s'\n", ValueUnion.psz);
    922894                break;
    923             case OPT_RAW_R0:
    924                 fRawR0 = true;
    925                 break;
    926             case OPT_NO_RAW_R0:
    927                 fRawR0 = false;
    928                 break;
    929             case OPT_RAW_R3:
    930                 fRawR3 = true;
    931                 break;
    932             case OPT_NO_RAW_R3:
    933                 fRawR3 = false;
    934                 break;
    935             case OPT_PATM:
    936                 fPATM = true;
    937                 break;
    938             case OPT_NO_PATM:
    939                 fPATM = false;
    940                 break;
    941             case OPT_CSAM:
    942                 fCSAM = true;
    943                 break;
    944             case OPT_NO_CSAM:
    945                 fCSAM = false;
    946                 break;
    947895            case OPT_SETTINGSPW:
    948896                pcszSettingsPw = ValueUnion.psz;
     
    11641112#endif /* defined(VBOX_WITH_RECORDING) */
    11651113
     1114#if 0
    11661115        /* get the machine debugger (isn't necessarily available) */
    11671116        ComPtr <IMachineDebugger> machineDebugger;
    11681117        console->COMGETTER(Debugger)(machineDebugger.asOutParam());
    11691118        if (machineDebugger)
    1170         {
    11711119            Log(("Machine debugger available!\n"));
    1172         }
    1173 
    1174         if (fRawR0 != ~0U)
    1175         {
    1176             if (!machineDebugger)
    1177             {
    1178                 RTPrintf("Error: No debugger object; -%srawr0 cannot be executed!\n", fRawR0 ? "" : "no");
    1179                 break;
    1180             }
    1181             machineDebugger->COMSETTER(RecompileSupervisor)(!fRawR0);
    1182         }
    1183         if (fRawR3 != ~0U)
    1184         {
    1185             if (!machineDebugger)
    1186             {
    1187                 RTPrintf("Error: No debugger object; -%srawr3 cannot be executed!\n", fRawR3 ? "" : "no");
    1188                 break;
    1189             }
    1190             machineDebugger->COMSETTER(RecompileUser)(!fRawR3);
    1191         }
    1192         if (fPATM != ~0U)
    1193         {
    1194             if (!machineDebugger)
    1195             {
    1196                 RTPrintf("Error: No debugger object; -%spatm cannot be executed!\n", fPATM ? "" : "no");
    1197                 break;
    1198             }
    1199             machineDebugger->COMSETTER(PATMEnabled)(fPATM);
    1200         }
    1201         if (fCSAM != ~0U)
    1202         {
    1203             if (!machineDebugger)
    1204             {
    1205                 RTPrintf("Error: No debugger object; -%scsam cannot be executed!\n", fCSAM ? "" : "no");
    1206                 break;
    1207             }
    1208             machineDebugger->COMSETTER(CSAMEnabled)(fCSAM);
    1209         }
     1120#endif
    12101121
    12111122        /* initialize global references */
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r93115 r93460  
    683683#endif
    684684#ifdef VBOXSDL_ADVANCED_OPTIONS
    685              "  --[no]rawr0              Enable or disable raw ring 3\n"
    686              "  --[no]rawr3              Enable or disable raw ring 0\n"
    687              "  --[no]patm               Enable or disable PATM\n"
    688              "  --[no]csam               Enable or disable CSAM\n"
    689              "  --[no]hwvirtex           Permit or deny the usage of VT-x/AMD-V\n"
     685             "  --warpdrive <pct>        Sets the warp driver rate in percent (100 = normal)\n"
    690686#endif
    691687             "\n"
     
    705701             "  LCtrl + Alt + F12        Reset statistics counter\n"
    706702             "  LCtrl + Alt + F11        Dump statistics to logfile\n"
    707              "  Alt         + F12        Toggle R0 recompiler\n"
    708              "  Alt         + F11        Toggle R3 recompiler\n"
    709              "  Alt         + F10        Toggle PATM\n"
    710              "  Alt         + F9         Toggle CSAM\n"
    711703             "  Alt         + F8         Toggle single step mode\n"
    712704             "  LCtrl/RCtrl + F12        Toggle logger\n"
     
    910902#endif
    911903#ifdef VBOXSDL_ADVANCED_OPTIONS
    912     unsigned fRawR0 = ~0U;
    913     unsigned fRawR3 = ~0U;
    914     unsigned fPATM  = ~0U;
    915     unsigned fCSAM  = ~0U;
    916     unsigned fHWVirt = ~0U;
    917904    uint32_t u32WarpDrive = 0;
    918905#endif
     
    13471334#endif
    13481335#ifdef VBOXSDL_ADVANCED_OPTIONS
    1349         else if (   !strcmp(argv[curArg], "--rawr0")
    1350                  || !strcmp(argv[curArg], "-rawr0"))
    1351             fRawR0 = true;
    1352         else if (   !strcmp(argv[curArg], "--norawr0")
    1353                  || !strcmp(argv[curArg], "-norawr0"))
    1354             fRawR0 = false;
    1355         else if (   !strcmp(argv[curArg], "--rawr3")
    1356                  || !strcmp(argv[curArg], "-rawr3"))
    1357             fRawR3 = true;
    1358         else if (   !strcmp(argv[curArg], "--norawr3")
    1359                  || !strcmp(argv[curArg], "-norawr3"))
    1360             fRawR3 = false;
    1361         else if (   !strcmp(argv[curArg], "--patm")
    1362                  || !strcmp(argv[curArg], "-patm"))
    1363             fPATM = true;
    1364         else if (   !strcmp(argv[curArg], "--nopatm")
    1365                  || !strcmp(argv[curArg], "-nopatm"))
    1366             fPATM = false;
    1367         else if (   !strcmp(argv[curArg], "--csam")
    1368                  || !strcmp(argv[curArg], "-csam"))
    1369             fCSAM = true;
    1370         else if (   !strcmp(argv[curArg], "--nocsam")
    1371                  || !strcmp(argv[curArg], "-nocsam"))
    1372             fCSAM = false;
    1373         else if (   !strcmp(argv[curArg], "--hwvirtex")
    1374                  || !strcmp(argv[curArg], "-hwvirtex"))
    1375             fHWVirt = true;
    1376         else if (   !strcmp(argv[curArg], "--nohwvirtex")
    1377                  || !strcmp(argv[curArg], "-nohwvirtex"))
    1378             fHWVirt = false;
    13791336        else if (   !strcmp(argv[curArg], "--warpdrive")
    13801337                 || !strcmp(argv[curArg], "-warpdrive"))
     
    21602117    rc = E_FAIL;
    21612118#ifdef VBOXSDL_ADVANCED_OPTIONS
    2162     if (fRawR0 != ~0U)
    2163     {
    2164         if (!gpMachineDebugger)
    2165         {
    2166             RTPrintf("Error: No debugger object; -%srawr0 cannot be executed!\n", fRawR0 ? "" : "no");
    2167             goto leave;
    2168         }
    2169         gpMachineDebugger->COMSETTER(RecompileSupervisor)(!fRawR0);
    2170     }
    2171     if (fRawR3 != ~0U)
    2172     {
    2173         if (!gpMachineDebugger)
    2174         {
    2175             RTPrintf("Error: No debugger object; -%srawr3 cannot be executed!\n", fRawR3 ? "" : "no");
    2176             goto leave;
    2177         }
    2178         gpMachineDebugger->COMSETTER(RecompileUser)(!fRawR3);
    2179     }
    2180     if (fPATM != ~0U)
    2181     {
    2182         if (!gpMachineDebugger)
    2183         {
    2184             RTPrintf("Error: No debugger object; -%spatm cannot be executed!\n", fPATM ? "" : "no");
    2185             goto leave;
    2186         }
    2187         gpMachineDebugger->COMSETTER(PATMEnabled)(fPATM);
    2188     }
    2189     if (fCSAM != ~0U)
    2190     {
    2191         if (!gpMachineDebugger)
    2192         {
    2193             RTPrintf("Error: No debugger object; -%scsam cannot be executed!\n", fCSAM ? "" : "no");
    2194             goto leave;
    2195         }
    2196         gpMachineDebugger->COMSETTER(CSAMEnabled)(fCSAM);
    2197     }
    2198     if (fHWVirt != ~0U)
    2199     {
    2200         gpMachine->SetHWVirtExProperty(HWVirtExPropertyType_Enabled, fHWVirt);
    2201     }
    22022119    if (u32WarpDrive != 0)
    22032120    {
     
    37803697            switch (ev->keysym.sym)
    37813698            {
    3782                 // pressing Alt-F12 toggles the supervisor recompiler
    3783                 case SDLK_F12:
    3784                     {
    3785                         BOOL recompileSupervisor;
    3786                         gpMachineDebugger->COMGETTER(RecompileSupervisor)(&recompileSupervisor);
    3787                         gpMachineDebugger->COMSETTER(RecompileSupervisor)(!recompileSupervisor);
    3788                         break;
    3789                     }
    3790                     // pressing Alt-F11 toggles the user recompiler
    3791                 case SDLK_F11:
    3792                     {
    3793                         BOOL recompileUser;
    3794                         gpMachineDebugger->COMGETTER(RecompileUser)(&recompileUser);
    3795                         gpMachineDebugger->COMSETTER(RecompileUser)(!recompileUser);
    3796                         break;
    3797                     }
    3798                     // pressing Alt-F10 toggles the patch manager
    3799                 case SDLK_F10:
    3800                     {
    3801                         BOOL patmEnabled;
    3802                         gpMachineDebugger->COMGETTER(PATMEnabled)(&patmEnabled);
    3803                         gpMachineDebugger->COMSETTER(PATMEnabled)(!patmEnabled);
    3804                         break;
    3805                     }
    3806                     // pressing Alt-F9 toggles CSAM
    3807                 case SDLK_F9:
    3808                     {
    3809                         BOOL csamEnabled;
    3810                         gpMachineDebugger->COMGETTER(CSAMEnabled)(&csamEnabled);
    3811                         gpMachineDebugger->COMSETTER(CSAMEnabled)(!csamEnabled);
    3812                         break;
    3813                     }
    3814                     // pressing Alt-F8 toggles singlestepping mode
     3699                // pressing Alt-F8 toggles singlestepping mode
    38153700                case SDLK_F8:
    3816                     {
    3817                         BOOL singlestepEnabled;
    3818                         gpMachineDebugger->COMGETTER(SingleStep)(&singlestepEnabled);
    3819                         gpMachineDebugger->COMSETTER(SingleStep)(!singlestepEnabled);
    3820                         break;
    3821                     }
     3701                {
     3702                    BOOL singlestepEnabled;
     3703                    gpMachineDebugger->COMGETTER(SingleStep)(&singlestepEnabled);
     3704                    gpMachineDebugger->COMSETTER(SingleStep)(!singlestepEnabled);
     3705                    break;
     3706                }
    38223707                default:
    38233708                    break;
     
    44014286            {
    44024287                // query the machine state
    4403                 BOOL recompileSupervisor = FALSE;
    4404                 BOOL recompileUser = FALSE;
    4405                 BOOL patmEnabled = FALSE;
    4406                 BOOL csamEnabled = FALSE;
    44074288                BOOL singlestepEnabled = FALSE;
    44084289                BOOL logEnabled = FALSE;
    4409                 BOOL hwVirtEnabled = FALSE;
     4290                VMExecutionEngine_T enmExecEngine = VMExecutionEngine_NotSet;
    44104291                ULONG virtualTimeRate = 100;
    4411                 gpMachineDebugger->COMGETTER(RecompileSupervisor)(&recompileSupervisor);
    4412                 gpMachineDebugger->COMGETTER(RecompileUser)(&recompileUser);
    4413                 gpMachineDebugger->COMGETTER(PATMEnabled)(&patmEnabled);
    4414                 gpMachineDebugger->COMGETTER(CSAMEnabled)(&csamEnabled);
    44154292                gpMachineDebugger->COMGETTER(LogEnabled)(&logEnabled);
    44164293                gpMachineDebugger->COMGETTER(SingleStep)(&singlestepEnabled);
    4417                 gpMachineDebugger->COMGETTER(HWVirtExEnabled)(&hwVirtEnabled);
     4294                gpMachineDebugger->COMGETTER(ExecutionEngine)(&enmExecEngine);
    44184295                gpMachineDebugger->COMGETTER(VirtualTimeRate)(&virtualTimeRate);
    44194296                RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle),
    4420                             " [STEP=%d CS=%d PAT=%d RR0=%d RR3=%d LOG=%d HWVirt=%d",
    4421                             singlestepEnabled == TRUE, csamEnabled == TRUE, patmEnabled == TRUE,
    4422                             recompileSupervisor == FALSE, recompileUser == FALSE,
    4423                             logEnabled == TRUE, hwVirtEnabled == TRUE);
     4297                            " [STEP=%d LOG=%d EXEC=%s",
     4298                            singlestepEnabled == TRUE, logEnabled == TRUE,
     4299                            enmExecEngine == VMExecutionEngine_NotSet ? "NotSet"
     4300                            : enmExecEngine == VMExecutionEngine_RawMode ? "RAW"
     4301                            : enmExecEngine == VMExecutionEngine_HwVirt ? "HM"
     4302                            : enmExecEngine == VMExecutionEngine_NativeApi ? "NEM" : "UNK");
    44244303                char *psz = strchr(szTitle, '\0');
    44254304                if (virtualTimeRate != 100)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r93115 r93460  
    192192#endif
    193193    , m_fRestoreCurrentSnapshot(false)
    194     , m_fDisablePatm(false)
    195     , m_fDisableCsam(false)
    196     , m_fRecompileSupervisor(false)
    197     , m_fRecompileUser(false)
    198194    , m_fExecuteAllInIem(false)
    199195    , m_uWarpPct(100)
     
    488484        }
    489485        /* VMM Options: */
    490         else if (!::strcmp(arg, "--disable-patm"))
     486        else if (!::strcmp(arg, "--execute-all-in-iem"))
    491487        {
    492488            enmOptType = OptType_VMRunner;
    493             m_fDisablePatm = true;
    494         }
    495         else if (!::strcmp(arg, "--disable-csam"))
    496         {
    497             enmOptType = OptType_VMRunner;
    498             m_fDisableCsam = true;
    499         }
    500         else if (!::strcmp(arg, "--recompile-supervisor"))
    501         {
    502             enmOptType = OptType_VMRunner;
    503             m_fRecompileSupervisor = true;
    504         }
    505         else if (!::strcmp(arg, "--recompile-user"))
    506         {
    507             enmOptType = OptType_VMRunner;
    508             m_fRecompileUser = true;
    509         }
    510         else if (!::strcmp(arg, "--recompile-all"))
    511         {
    512             enmOptType = OptType_VMRunner;
    513             m_fDisablePatm = m_fDisableCsam = m_fRecompileSupervisor = m_fRecompileUser = true;
    514         }
    515         else if (!::strcmp(arg, "--execute-all-in-iem"))
    516         {
    517             enmOptType = OptType_VMRunner;
    518             m_fDisablePatm = m_fDisableCsam = m_fExecuteAllInIem = true;
     489            m_fExecuteAllInIem = true;
    519490        }
    520491        else if (!::strcmp(arg, "--driverless"))
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r93115 r93460  
    256256        QUuid getDvdImage() const { return m_uDvdImage; }
    257257
    258         /** Returns the --disable-patm option value. */
    259         bool isPatmDisabled() const { return m_fDisablePatm; }
    260         /** Returns the --disable-csam option value. */
    261         bool isCsamDisabled() const { return m_fDisableCsam; }
    262         /** Returns the --recompile-supervisor option value. */
    263         bool isSupervisorCodeExecedRecompiled() const { return m_fRecompileSupervisor; }
    264         /** Returns the --recompile-user option value. */
    265         bool isUserCodeExecedRecompiled() const { return m_fRecompileUser; }
    266258        /** Returns the --execute-all-in-iem option value. */
    267259        bool areWeToExecuteAllInIem() const { return m_fExecuteAllInIem; }
     
    678670        QUuid  m_uDvdImage;
    679671
    680         /** Holds the --disable-patm option value. */
    681         bool      m_fDisablePatm;
    682         /** Holds the --disable-csam option value. */
    683         bool      m_fDisableCsam;
    684         /** Holds the --recompile-supervisor option value. */
    685         bool      m_fRecompileSupervisor;
    686         /** Holds the --recompile-user option value. */
    687         bool      m_fRecompileUser;
    688672        /** Holds the --execute-all-in-iem option value. */
    689673        bool      m_fExecuteAllInIem;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r93115 r93460  
    173173    if (!debugger().isNull() && debugger().isOk())
    174174    {
    175         if (uiCommon().isPatmDisabled())
    176             debugger().SetPATMEnabled(false);
    177         if (uiCommon().isCsamDisabled())
    178             debugger().SetCSAMEnabled(false);
    179         if (uiCommon().isSupervisorCodeExecedRecompiled())
    180             debugger().SetRecompileSupervisor(true);
    181         if (uiCommon().isUserCodeExecedRecompiled())
    182             debugger().SetRecompileUser(true);
    183175        if (uiCommon().areWeToExecuteAllInIem())
    184176            debugger().SetExecuteAllInIEM(true);
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