VirtualBox

Changeset 51283 in vbox


Ignore:
Timestamp:
May 19, 2014 7:48:18 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
93750
Message:

VMM: Expose CPUMR3MsrRangesInsert().

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r51281 r51283  
    3030#include <VBox/types.h>
    3131#include <VBox/vmm/cpumctx.h>
     32#include <VBox/vmm/stam.h>
    3233
    3334RT_C_DECLS_BEGIN
     
    329330typedef CPUMUKNOWNCPUID *PCPUMUKNOWNCPUID;
    330331
     332
     333/**
     334 * MSR range.
     335 */
     336typedef struct CPUMMSRRANGE
     337{
     338    /** The first MSR. [0] */
     339    uint32_t    uFirst;
     340    /** The last MSR. [4] */
     341    uint32_t    uLast;
     342    /** The read function (CPUMMSRRDFN). [8] */
     343    uint16_t    enmRdFn;
     344    /** The write function (CPUMMSRWRFN). [10] */
     345    uint16_t    enmWrFn;
     346    /** The offset of the 64-bit MSR value relative to the start of CPUMCPU.
     347     * UINT16_MAX if not used by the read and write functions.  [12] */
     348    uint16_t    offCpumCpu;
     349    /** Reserved for future hacks. [14] */
     350    uint16_t    fReserved;
     351    /** The init/read value. [16]
     352     * When enmRdFn is kCpumMsrRdFn_INIT_VALUE, this is the value returned on RDMSR.
     353     * offCpumCpu must be UINT16_MAX in that case, otherwise it must be a valid
     354     * offset into CPUM. */
     355    uint64_t    uValue;
     356    /** The bits to ignore when writing. [24]   */
     357    uint64_t    fWrIgnMask;
     358    /** The bits that will cause a GP(0) when writing. [32]
     359     * This is always checked prior to calling the write function.  Using
     360     * UINT64_MAX effectively marks the MSR as read-only. */
     361    uint64_t    fWrGpMask;
     362    /** The register name, if applicable. [40] */
     363    char        szName[56];
     364
     365#ifdef VBOX_WITH_STATISTICS
     366    /** The number of reads. */
     367    STAMCOUNTER cReads;
     368    /** The number of writes. */
     369    STAMCOUNTER cWrites;
     370    /** The number of times ignored bits were written. */
     371    STAMCOUNTER cIgnoredBits;
     372    /** The number of GPs generated. */
     373    STAMCOUNTER cGps;
     374#endif
     375} CPUMMSRRANGE;
     376#ifdef VBOX_WITH_STATISTICS
     377AssertCompileSize(CPUMMSRRANGE, 128);
     378#else
     379AssertCompileSize(CPUMMSRRANGE, 96);
     380#endif
     381/** Pointer to an MSR range. */
     382typedef CPUMMSRRANGE *PCPUMMSRRANGE;
     383/** Pointer to a const MSR range. */
     384typedef CPUMMSRRANGE const *PCCPUMMSRRANGE;
    331385
    332386
     
    725779VMMR3DECL(const char *)     CPUMR3CpuVendorName(CPUMCPUVENDOR enmVendor);
    726780
     781VMMR3DECL(int)              CPUMR3MsrRangesInsert(PVM pVM, PCCPUMMSRRANGE pNewRange);
     782
    727783/** @} */
    728784#endif /* IN_RING3 */
  • trunk/src/VBox/VMM/VMMR3/CPUMR3Db.cpp

    r51274 r51283  
    756756
    757757
    758 #if 0
    759758/**
    760759 * Insert an MSR range into the VM.
     
    769768VMMR3DECL(int) CPUMR3MsrRangesInsert(PVM pVM, PCCPUMMSRRANGE pNewRange)
    770769{
     770    AssertReturn(pVM, VERR_INVALID_PARAMETER);
     771    AssertReturn(pNewRange, VERR_INVALID_PARAMETER);
     772
    771773    return cpumR3MsrRangesInsert(pVM, NULL /* ppaMsrRanges */, NULL /* pcMsrRanges */, pNewRange);
    772774}
    773 #endif
    774775
    775776
  • trunk/src/VBox/VMM/include/CPUMInternal.h

    r51271 r51283  
    601601} CPUMMSRWRFN;
    602602
    603 /**
    604  * MSR range.
    605  */
    606 typedef struct CPUMMSRRANGE
    607 {
    608     /** The first MSR. [0] */
    609     uint32_t    uFirst;
    610     /** The last MSR. [4] */
    611     uint32_t    uLast;
    612     /** The read function (CPUMMSRRDFN). [8] */
    613     uint16_t    enmRdFn;
    614     /** The write function (CPUMMSRWRFN). [10] */
    615     uint16_t    enmWrFn;
    616     /** The offset of the 64-bit MSR value relative to the start of CPUMCPU.
    617      * UINT16_MAX if not used by the read and write functions.  [12] */
    618     uint16_t    offCpumCpu;
    619     /** Reserved for future hacks. [14] */
    620     uint16_t    fReserved;
    621     /** The init/read value. [16]
    622      * When enmRdFn is kCpumMsrRdFn_INIT_VALUE, this is the value returned on RDMSR.
    623      * offCpumCpu must be UINT16_MAX in that case, otherwise it must be a valid
    624      * offset into CPUM. */
    625     uint64_t    uValue;
    626     /** The bits to ignore when writing. [24]   */
    627     uint64_t    fWrIgnMask;
    628     /** The bits that will cause a GP(0) when writing. [32]
    629      * This is always checked prior to calling the write function.  Using
    630      * UINT64_MAX effectively marks the MSR as read-only. */
    631     uint64_t    fWrGpMask;
    632     /** The register name, if applicable. [40] */
    633     char        szName[56];
    634 
    635 #ifdef VBOX_WITH_STATISTICS
    636     /** The number of reads. */
    637     STAMCOUNTER cReads;
    638     /** The number of writes. */
    639     STAMCOUNTER cWrites;
    640     /** The number of times ignored bits were written. */
    641     STAMCOUNTER cIgnoredBits;
    642     /** The number of GPs generated. */
    643     STAMCOUNTER cGps;
    644 #endif
    645 } CPUMMSRRANGE;
    646 #ifdef VBOX_WITH_STATISTICS
    647 AssertCompileSize(CPUMMSRRANGE, 128);
    648 #else
    649 AssertCompileSize(CPUMMSRRANGE, 96);
    650 #endif
    651 /** Pointer to an MSR range. */
    652 typedef CPUMMSRRANGE *PCPUMMSRRANGE;
    653 /** Pointer to a const MSR range. */
    654 typedef CPUMMSRRANGE const *PCCPUMMSRRANGE;
    655 
    656 
    657 
    658603
    659604/**
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