VirtualBox

Changeset 30724 in vbox for trunk/src/VBox/Devices/VMMDev


Ignore:
Timestamp:
Jul 8, 2010 8:30:20 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63489
Message:

Recommitted r63480 - VMMDev: Adding an optional (disabled by default) testing side to the device to assist simple guest benchmarks and tests. Started on a MMIO and IOPort benchmark (for comparison with network performance numbers).

Location:
trunk/src/VBox/Devices/VMMDev
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r30718 r30724  
    2727#include <VBox/log.h>
    2828#include <VBox/param.h>
    29 #include <VBox/mm.h>
    3029#include <VBox/pgm.h>
    3130#include <VBox/err.h>
     
    4847#ifdef VBOX_WITH_HGCM
    4948# include "VMMDevHGCM.h"
     49#endif
     50#ifndef VBOX_WITHOUT_TESTING_FEATURES
     51# include "VMMDevTesting.h"
    5052#endif
    5153
     
    27282730        pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->guestCaps);
    27292731
    2730     /* Generate a unique session id for this VM; it will be changed for each start, reset or restore. 
     2732    /* Generate a unique session id for this VM; it will be changed for each start, reset or restore.
    27312733     * This can be used for restore detection inside the guest.
    27322734     */
    27332735    pThis->idSession = ASMReadTSC();
     2736}
     2737
     2738
     2739/**
     2740 * @interface_method_impl{PDMDEVREG,pfnRelocate}
     2741 */
     2742static DECLCALLBACK(void) vmmdevRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
     2743{
     2744    NOREF(pDevIns);
     2745    NOREF(offDelta);
    27342746}
    27352747
     
    27452757    Assert(iInstance == 0);
    27462758    PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);
    2747 
    2748     /*
    2749      * Validate and read the configuration.
    2750      */
    2751     if (!CFGMR3AreValuesValid(pCfg,
    2752                               "GetHostTimeDisabled\0"
    2753                               "BackdoorLogDisabled\0"
    2754                               "KeepCredentials\0"
    2755                               "HeapEnabled\0"
    2756                               ))
    2757         return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
    2758 
    2759     rc = CFGMR3QueryBoolDef(pCfg, "GetHostTimeDisabled", &pThis->fGetHostTimeDisabled, false);
    2760     if (RT_FAILURE(rc))
    2761         return PDMDEV_SET_ERROR(pDevIns, rc,
    2762                                 N_("Configuration error: Failed querying \"GetHostTimeDisabled\" as a boolean"));
    2763 
    2764     rc = CFGMR3QueryBoolDef(pCfg, "BackdoorLogDisabled", &pThis->fBackdoorLogDisabled, false);
    2765     if (RT_FAILURE(rc))
    2766         return PDMDEV_SET_ERROR(pDevIns, rc,
    2767                                 N_("Configuration error: Failed querying \"BackdoorLogDisabled\" as a boolean"));
    2768 
    2769     rc = CFGMR3QueryBoolDef(pCfg, "KeepCredentials", &pThis->fKeepCredentials, false);
    2770     if (RT_FAILURE(rc))
    2771         return PDMDEV_SET_ERROR(pDevIns, rc,
    2772                                 N_("Configuration error: Failed querying \"KeepCredentials\" as a boolean"));
    2773 
    2774     rc = CFGMR3QueryBoolDef(pCfg, "HeapEnabled", &pThis->fHeapEnabled, true);
    2775     if (RT_FAILURE(rc))
    2776         return PDMDEV_SET_ERROR(pDevIns, rc,
    2777                                 N_("Configuration error: Failed querying \"HeapEnabled\" as a boolean"));
    27782759
    27792760    /*
     
    28282809#endif
    28292810
    2830     /** @todo convert this into a config parameter like we do everywhere else! */
    2831     pThis->cbGuestRAM = MMR3PhysGetRamSize(PDMDevHlpGetVM(pDevIns));
     2811    /*
     2812     * Validate and read the configuration.
     2813     */
     2814    PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns,
     2815                                  "GetHostTimeDisabled|"
     2816                                  "BackdoorLogDisabled|"
     2817                                  "KeepCredentials|"
     2818                                  "HeapEnabled|"
     2819                                  "RamSize|"
     2820                                  "TestingEnabled"
     2821                                  ,
     2822                                  "");
     2823
     2824    rc = CFGMR3QueryU64(pCfg, "RamSize", &pThis->cbGuestRAM);
     2825    if (RT_FAILURE(rc))
     2826        return PDMDEV_SET_ERROR(pDevIns, rc,
     2827                                N_("Configuration error: Failed querying \"RamSize\" as a 64-bit unsigned integer"));
     2828
     2829    rc = CFGMR3QueryBoolDef(pCfg, "GetHostTimeDisabled", &pThis->fGetHostTimeDisabled, false);
     2830    if (RT_FAILURE(rc))
     2831        return PDMDEV_SET_ERROR(pDevIns, rc,
     2832                                N_("Configuration error: Failed querying \"GetHostTimeDisabled\" as a boolean"));
     2833
     2834    rc = CFGMR3QueryBoolDef(pCfg, "BackdoorLogDisabled", &pThis->fBackdoorLogDisabled, false);
     2835    if (RT_FAILURE(rc))
     2836        return PDMDEV_SET_ERROR(pDevIns, rc,
     2837                                N_("Configuration error: Failed querying \"BackdoorLogDisabled\" as a boolean"));
     2838
     2839    rc = CFGMR3QueryBoolDef(pCfg, "KeepCredentials", &pThis->fKeepCredentials, false);
     2840    if (RT_FAILURE(rc))
     2841        return PDMDEV_SET_ERROR(pDevIns, rc,
     2842                                N_("Configuration error: Failed querying \"KeepCredentials\" as a boolean"));
     2843
     2844    rc = CFGMR3QueryBoolDef(pCfg, "HeapEnabled", &pThis->fHeapEnabled, true);
     2845    if (RT_FAILURE(rc))
     2846        return PDMDEV_SET_ERROR(pDevIns, rc,
     2847                                N_("Configuration error: Failed querying \"HeapEnabled\" as a boolean"));
     2848
     2849    rc = CFGMR3QueryBoolDef(pCfg, "RZEnabled", &pThis->fRZEnabled, true);
     2850    if (RT_FAILURE(rc))
     2851        return PDMDEV_SET_ERROR(pDevIns, rc,
     2852                                N_("Configuration error: Failed querying \"RZEnabled\" as a boolean"));
     2853
     2854#ifndef VBOX_WITHOUT_TESTING_FEATURES
     2855    rc = CFGMR3QueryBoolDef(pCfg, "TestingEnabled", &pThis->fTestingEnabled, false);
     2856    if (RT_FAILURE(rc))
     2857        return PDMDEV_SET_ERROR(pDevIns, rc,
     2858                                N_("Configuration error: Failed querying \"TestingEnabled\" as a boolean"));
     2859# ifdef DEBUG_bird /* lazy bird */
     2860    pThis->fTestingEnabled = true;
     2861# endif
     2862    /** @todo image-to-load-filename? */
     2863#endif
    28322864
    28332865    /*
     
    28902922    }
    28912923
     2924#ifndef VBOX_WITHOUT_TESTING_FEATURES
     2925    /*
     2926     * Initialize testing.
     2927     */
     2928    rc = vmmdevTestingInitialize(pDevIns);
     2929    if (RT_FAILURE(rc))
     2930        return rc;
     2931#endif
     2932
    28922933    /*
    28932934     * Get the corresponding connector interface
     
    29492990    pThis->u32HGCMEnabled = 0;
    29502991#endif /* VBOX_WITH_HGCM */
     2992
    29512993    /* In this version of VirtualBox the GUI checks whether "needs host cursor"
    29522994     * changes. */
     
    29552997    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatMemBalloonChunks, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Memory balloon size", "/Devices/VMMDev/BalloonChunks");
    29562998
    2957     /* Generate a unique session id for this VM; it will be changed for each start, reset or restore. 
     2999    /* Generate a unique session id for this VM; it will be changed for each start, reset or restore.
    29583000     * This can be used for restore detection inside the guest.
    29593001     */
     
    29723014    "VMMDev",
    29733015    /* szRCMod */
    2974     "",
     3016    "VBoxDDGC.gc",
    29753017    /* szR0Mod */
    2976     "",
     3018    "VBoxDDR0.r0",
    29773019    /* pszDescription */
    29783020    "VirtualBox VMM Device\n",
    29793021    /* fFlags */
    2980     PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT | PDM_DEVREG_FLAGS_GUEST_BITS_DEFAULT,
     3022    PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT | PDM_DEVREG_FLAGS_GUEST_BITS_DEFAULT | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0,
    29813023    /* fClass */
    29823024    PDM_DEVREG_CLASS_VMM_DEV,
     
    29903032    NULL,
    29913033    /* pfnRelocate */
    2992     NULL,
     3034    vmmdevRelocate,
    29933035    /* pfnIOCtl */
    29943036    NULL,
  • trunk/src/VBox/Devices/VMMDev/VMMDevState.h

    r30718 r30724  
    164164    /* guest ram size */
    165165    uint64_t    cbGuestRAM;
    166    
     166
    167167    /* unique session id; the id will be different after each start, reset or restore of the VM. */
    168168    uint64_t    idSession;
     
    215215
    216216    /** FLag whether CPU hotplug events are monitored */
    217     bool                 fCpuHotPlugEventsEnabled;
     217    bool                fCpuHotPlugEventsEnabled;
    218218    /** CPU hotplug event */
    219     VMMDevCpuEventType   enmCpuHotPlugEvent;
     219    VMMDevCpuEventType  enmCpuHotPlugEvent;
    220220    /** Core id of the CPU to change */
    221     uint32_t             idCpuCore;
     221    uint32_t            idCpuCore;
    222222    /** Package id of the CPU to changhe */
    223     uint32_t             idCpuPackage;
    224 
    225     uint32_t             StatMemBalloonChunks;
     223    uint32_t            idCpuPackage;
     224
     225    uint32_t            StatMemBalloonChunks;
     226
     227    /** Set if RC/R0 is enabled. */
     228    bool                fRZEnabled;
     229    /** Set if testing is enabled. */
     230    bool                fTestingEnabled;
     231    /** The high timestamp value. */
     232    uint32_t            u32TestingHighTimestamp;
     233
    226234} VMMDevState;
    227235AssertCompileMemberAlignment(VMMDevState, CritSect, 8);
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