VirtualBox

忽略:
時間撮記:
2013-1-27 下午09:12:53 (12 年 以前)
作者:
vboxsync
訊息:

DBGF,DBGC,++: PVM -> PUVM. Some refactoring and cleanup as well.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp

    r41803 r44399  
    2525#include <VBox/vmm/mm.h>
    2626#include <VBox/vmm/vm.h>
     27#include <VBox/vmm/uvm.h>
    2728#include <VBox/param.h>
    2829#include <VBox/err.h>
     
    3738*******************************************************************************/
    3839/** Locks the register database for writing. */
    39 #define DBGF_REG_DB_LOCK_WRITE(pVM) \
     40#define DBGF_REG_DB_LOCK_WRITE(pUVM) \
    4041    do { \
    41         int rcSem = RTSemRWRequestWrite((pVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
     42        int rcSem = RTSemRWRequestWrite((pUVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
    4243        AssertRC(rcSem); \
    4344    } while (0)
    4445
    4546/** Unlocks the register database after writing. */
    46 #define DBGF_REG_DB_UNLOCK_WRITE(pVM) \
     47#define DBGF_REG_DB_UNLOCK_WRITE(pUVM) \
    4748    do { \
    48         int rcSem = RTSemRWReleaseWrite((pVM)->dbgf.s.hRegDbLock); \
     49        int rcSem = RTSemRWReleaseWrite((pUVM)->dbgf.s.hRegDbLock); \
    4950        AssertRC(rcSem); \
    5051    } while (0)
    5152
    5253/** Locks the register database for reading. */
    53 #define DBGF_REG_DB_LOCK_READ(pVM) \
     54#define DBGF_REG_DB_LOCK_READ(pUVM) \
    5455    do { \
    55         int rcSem = RTSemRWRequestRead((pVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
     56        int rcSem = RTSemRWRequestRead((pUVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
    5657        AssertRC(rcSem); \
    5758    } while (0)
    5859
    5960/** Unlocks the register database after reading. */
    60 #define DBGF_REG_DB_UNLOCK_READ(pVM) \
     61#define DBGF_REG_DB_UNLOCK_READ(pUVM) \
    6162    do { \
    62         int rcSem = RTSemRWReleaseRead((pVM)->dbgf.s.hRegDbLock); \
     63        int rcSem = RTSemRWReleaseRead((pUVM)->dbgf.s.hRegDbLock); \
    6364        AssertRC(rcSem); \
    6465    } while (0)
     
    161162    /** The number of entries in the output array. */
    162163    size_t          cRegs;
    163     /** The current register number when enumerating the string space. */
     164    /** The current register number when enumerating the string space.
     165     * @remarks Only used by EMT(0). */
    164166    size_t          iReg;
    165167} DBGFR3REGNMQUERYALLARGS;
     
    174176typedef struct DBGFR3REGPRINTFARGS
    175177{
    176     /** Pointer to the VM. */
    177     PVM         pVM;
     178    /** The user mode VM handle. */
     179    PUVM        pUVM;
    178180    /** The target CPU. */
    179181    VMCPUID     idCpu;
     
    204206 *
    205207 * @returns VBox status code.
    206  * @param   pVM                 Pointer to the VM.
    207  */
    208 int dbgfR3RegInit(PVM pVM)
    209 {
    210     int rc = VINF_SUCCESS;
    211     if (!pVM->dbgf.s.fRegDbInitialized)
    212     {
    213         rc = RTSemRWCreate(&pVM->dbgf.s.hRegDbLock);
    214         pVM->dbgf.s.fRegDbInitialized = RT_SUCCESS(rc);
     208 * @param   pUVM                The user mode VM handle.
     209 */
     210int dbgfR3RegInit(PUVM pUVM)
     211{
     212    int  rc  = VINF_SUCCESS;
     213    if (!pUVM->dbgf.s.fRegDbInitialized)
     214    {
     215        rc = RTSemRWCreate(&pUVM->dbgf.s.hRegDbLock);
     216        pUVM->dbgf.s.fRegDbInitialized = RT_SUCCESS(rc);
    215217    }
    216218    return rc;
     
    221223 * Terminates the register database.
    222224 *
    223  * @param   pVM                 Pointer to the VM.
    224  */
    225 void dbgfR3RegTerm(PVM pVM)
    226 {
    227     RTSemRWDestroy(pVM->dbgf.s.hRegDbLock);
    228     pVM->dbgf.s.hRegDbLock = NIL_RTSEMRW;
    229     pVM->dbgf.s.fRegDbInitialized = false;
     225 * @param   pUVM                The user mode VM handle.
     226 */
     227void dbgfR3RegTerm(PUVM pUVM)
     228{
     229    RTSemRWDestroy(pUVM->dbgf.s.hRegDbLock);
     230    pUVM->dbgf.s.hRegDbLock = NIL_RTSEMRW;
     231    pUVM->dbgf.s.fRegDbInitialized = false;
    230232}
    231233
     
    262264 *
    263265 * @returns VBox status code.
    264  * @param   pVM                 Pointer to the VM.
     266 * @param   pUVM                The user mode VM handle.
    265267 * @param   paRegisters         The register descriptors.
    266268 * @param   enmType             The set type.
     
    270272 *                              pszPrefix when creating the set name.
    271273 */
    272 static int dbgfR3RegRegisterCommon(PVM pVM, PCDBGFREGDESC paRegisters, DBGFREGSETTYPE enmType, void *pvUserArg,
     274static int dbgfR3RegRegisterCommon(PUVM pUVM, PCDBGFREGDESC paRegisters, DBGFREGSETTYPE enmType, void *pvUserArg,
    273275                                   const char *pszPrefix, uint32_t iInstance)
    274276{
     
    338340
    339341    /* Check the instance number of the CPUs. */
    340     AssertReturn(enmType != DBGFREGSETTYPE_CPU || iInstance < pVM->cCpus, VERR_INVALID_CPU_ID);
     342    AssertReturn(enmType != DBGFREGSETTYPE_CPU || iInstance < pUVM->cCpus, VERR_INVALID_CPU_ID);
    341343
    342344    /*
     
    348350    cbRegSet += cLookupRecs * sizeof(DBGFREGLOOKUP);
    349351
    350     PDBGFREGSET pRegSet = (PDBGFREGSET)MMR3HeapAllocZ(pVM, MM_TAG_DBGF_REG, cbRegSet);
     352    PDBGFREGSET pRegSet = (PDBGFREGSET)MMR3HeapAllocZU(pUVM, MM_TAG_DBGF_REG, cbRegSet);
    351353    if (!pRegSet)
    352354        return VERR_NO_MEMORY;
     
    382384    {
    383385        strcpy(pszReg, paRegisters[iDesc].pszName);
    384         pLookupRec->Core.pszString = MMR3HeapStrDup(pVM, MM_TAG_DBGF_REG, szName);
     386        pLookupRec->Core.pszString = MMR3HeapStrDupU(pUVM, MM_TAG_DBGF_REG, szName);
    385387        if (!pLookupRec->Core.pszString)
    386388            rc = VERR_NO_STR_MEMORY;
     
    411413                {
    412414                    strcpy(pszSub, paSubFields[iSubField].pszName);
    413                     pLookupRec->Core.pszString = MMR3HeapStrDup(pVM, MM_TAG_DBGF_REG, szName);
     415                    pLookupRec->Core.pszString = MMR3HeapStrDupU(pUVM, MM_TAG_DBGF_REG, szName);
    414416                    if (!pLookupRec->Core.pszString)
    415417                        rc = VERR_NO_STR_MEMORY;
     
    432434            /* The alias record. */
    433435            strcpy(pszReg, pszRegName);
    434             pLookupRec->Core.pszString = MMR3HeapStrDup(pVM, MM_TAG_DBGF_REG, szName);
     436            pLookupRec->Core.pszString = MMR3HeapStrDupU(pUVM, MM_TAG_DBGF_REG, szName);
    435437            if (!pLookupRec->Core.pszString)
    436438                rc = VERR_NO_STR_MEMORY;
     
    450452         * the CPU register set cache.
    451453         */
    452         DBGF_REG_DB_LOCK_WRITE(pVM);
    453 
    454         bool fInserted = RTStrSpaceInsert(&pVM->dbgf.s.RegSetSpace, &pRegSet->Core);
     454        DBGF_REG_DB_LOCK_WRITE(pUVM);
     455
     456        bool fInserted = RTStrSpaceInsert(&pUVM->dbgf.s.RegSetSpace, &pRegSet->Core);
    455457        if (fInserted)
    456458        {
    457             pVM->dbgf.s.cRegs += pRegSet->cDescs;
     459            pUVM->dbgf.s.cRegs += pRegSet->cDescs;
    458460            if (enmType == DBGFREGSETTYPE_CPU)
    459461            {
    460462                if (pRegSet->cDescs > DBGFREG_ALL_COUNT)
    461                     pVM->dbgf.s.cRegs -= pRegSet->cDescs - DBGFREG_ALL_COUNT;
     463                    pUVM->dbgf.s.cRegs -= pRegSet->cDescs - DBGFREG_ALL_COUNT;
    462464                if (!strcmp(pszPrefix, "cpu"))
    463                     pVM->aCpus[iInstance].dbgf.s.pGuestRegSet = pRegSet;
     465                    pUVM->aCpus[iInstance].dbgf.s.pGuestRegSet = pRegSet;
    464466                else
    465                     pVM->aCpus[iInstance].dbgf.s.pHyperRegSet = pRegSet;
     467                    pUVM->aCpus[iInstance].dbgf.s.pHyperRegSet = pRegSet;
    466468            }
    467469
     
    470472            while (iLookupRec-- > 0)
    471473            {
    472                 bool fInserted2 = RTStrSpaceInsert(&pVM->dbgf.s.RegSpace, &paLookupRecs[iLookupRec].Core);
     474                bool fInserted2 = RTStrSpaceInsert(&pUVM->dbgf.s.RegSpace, &paLookupRecs[iLookupRec].Core);
    473475                AssertMsg(fInserted2, ("'%s'", paLookupRecs[iLookupRec].Core.pszString)); NOREF(fInserted2);
    474476            }
    475477
    476             DBGF_REG_DB_UNLOCK_WRITE(pVM);
     478            DBGF_REG_DB_UNLOCK_WRITE(pUVM);
    477479            return VINF_SUCCESS;
    478480        }
    479481
    480         DBGF_REG_DB_UNLOCK_WRITE(pVM);
     482        DBGF_REG_DB_UNLOCK_WRITE(pUVM);
    481483        rc = VERR_DUPLICATE;
    482484    }
     
    505507VMMR3_INT_DECL(int) DBGFR3RegRegisterCpu(PVM pVM, PVMCPU pVCpu, PCDBGFREGDESC paRegisters, bool fGuestRegs)
    506508{
    507     if (!pVM->dbgf.s.fRegDbInitialized)
    508     {
    509         int rc = dbgfR3RegInit(pVM);
     509    PUVM pUVM = pVM->pUVM;
     510    if (!pUVM->dbgf.s.fRegDbInitialized)
     511    {
     512        int rc = dbgfR3RegInit(pUVM);
    510513        if (RT_FAILURE(rc))
    511514            return rc;
    512515    }
    513516
    514     return dbgfR3RegRegisterCommon(pVM, paRegisters, DBGFREGSETTYPE_CPU, pVCpu, fGuestRegs ? "cpu" : "hypercpu", pVCpu->idCpu);
     517    return dbgfR3RegRegisterCommon(pUVM, paRegisters, DBGFREGSETTYPE_CPU, pVCpu,
     518                                   fGuestRegs ? "cpu" : "hypercpu", pVCpu->idCpu);
    515519}
    516520
     
    525529 *                              the standard name.
    526530 */
    527 VMMR3DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix, uint32_t iInstance)
    528 {
    529     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     531VMMR3_INT_DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix,
     532                                            uint32_t iInstance)
     533{
    530534    AssertPtrReturn(paRegisters, VERR_INVALID_POINTER);
    531535    AssertPtrReturn(pDevIns, VERR_INVALID_POINTER);
    532536    AssertPtrReturn(pszPrefix, VERR_INVALID_POINTER);
    533537
    534     return dbgfR3RegRegisterCommon(pVM, paRegisters, DBGFREGSETTYPE_DEVICE, pDevIns, pszPrefix, iInstance);
     538    return dbgfR3RegRegisterCommon(pVM->pUVM, paRegisters, DBGFREGSETTYPE_DEVICE, pDevIns, pszPrefix, iInstance);
    535539}
    536540
     
    782786 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    783787 *
    784  * @param   pVM                 Pointer to the VM.
     788 * @param   pUVM                The user mode VM handle.
    785789 * @param   idCpu               The virtual CPU ID.
    786790 * @param   enmReg              The register to query.
     
    790794 * @param   pValue              Where to return the register value.
    791795 */
    792 static DECLCALLBACK(int) dbgfR3RegCpuQueryWorkerOnCpu(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType,
     796static DECLCALLBACK(int) dbgfR3RegCpuQueryWorkerOnCpu(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType,
    793797                                                      bool fGuestRegs, PDBGFREGVAL pValue)
    794798{
    795799    int rc = VINF_SUCCESS;
    796     DBGF_REG_DB_LOCK_READ(pVM);
     800    DBGF_REG_DB_LOCK_READ(pUVM);
    797801
    798802    /*
     
    800804     */
    801805    PDBGFREGSET pSet = fGuestRegs
    802                      ? pVM->aCpus[idCpu].dbgf.s.pGuestRegSet
    803                      : pVM->aCpus[idCpu].dbgf.s.pHyperRegSet;
     806                     ? pUVM->aCpus[idCpu].dbgf.s.pGuestRegSet
     807                     : pUVM->aCpus[idCpu].dbgf.s.pHyperRegSet;
    804808    if (RT_LIKELY(pSet))
    805809    {
     
    831835        rc = VERR_INVALID_CPU_ID;
    832836
    833     DBGF_REG_DB_UNLOCK_READ(pVM);
     837    DBGF_REG_DB_UNLOCK_READ(pUVM);
    834838    return rc;
    835839}
     
    848852 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    849853 *
    850  * @param   pVM                 Pointer to the VM.
     854 * @param   pUVM                The user mode VM handle.
    851855 * @param   idCpu               The virtual CPU ID.  Can be OR'ed with
    852856 *                              DBGFREG_HYPER_VMCPUID.
     
    855859 * @param   pValue              Where to return the register value.
    856860 */
    857 static int dbgfR3RegCpuQueryWorker(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType, PDBGFREGVAL pValue)
    858 {
    859     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     861static int dbgfR3RegCpuQueryWorker(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType, PDBGFREGVAL pValue)
     862{
     863    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     864    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
    860865    AssertMsgReturn(enmReg >= DBGFREG_AL && enmReg <= DBGFREG_END, ("%d\n", enmReg), VERR_INVALID_PARAMETER);
    861866
    862867    bool const fGuestRegs = !(idCpu & DBGFREG_HYPER_VMCPUID);
    863868    idCpu &= ~DBGFREG_HYPER_VMCPUID;
    864     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
    865 
    866     return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryWorkerOnCpu, 6,
    867                                    pVM, idCpu, enmReg, enmType, fGuestRegs, pValue);
     869    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     870
     871    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryWorkerOnCpu, 6,
     872                                    pUVM, idCpu, enmReg, enmType, fGuestRegs, pValue);
    868873}
    869874
     
    879884 * @retval  VINF_DBGF_TRUNCATED_REGISTER
    880885 *
    881  * @param   pVM                 Pointer to the VM.
     886 * @param   pUVM                The user mode VM handle.
    882887 * @param   idCpu               The target CPU ID. Can be OR'ed with
    883888 *                              DBGFREG_HYPER_VMCPUID.
     
    885890 * @param   pu8                 Where to store the register value.
    886891 */
    887 VMMR3DECL(int) DBGFR3RegCpuQueryU8(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8)
     892VMMR3DECL(int) DBGFR3RegCpuQueryU8(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8)
    888893{
    889894    DBGFREGVAL Value;
    890     int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U8, &Value);
     895    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U8, &Value);
    891896    if (RT_SUCCESS(rc))
    892897        *pu8 = Value.u8;
     
    908913 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    909914 *
    910  * @param   pVM                 Pointer to the VM.
     915 * @param   pUVM                The user mode VM handle.
    911916 * @param   idCpu               The target CPU ID.  Can be OR'ed with
    912917 *                              DBGFREG_HYPER_VMCPUID.
     
    914919 * @param   pu16                Where to store the register value.
    915920 */
    916 VMMR3DECL(int) DBGFR3RegCpuQueryU16(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16)
     921VMMR3DECL(int) DBGFR3RegCpuQueryU16(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16)
    917922{
    918923    DBGFREGVAL Value;
    919     int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U16, &Value);
     924    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U16, &Value);
    920925    if (RT_SUCCESS(rc))
    921926        *pu16 = Value.u16;
     
    937942 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    938943 *
    939  * @param   pVM                 Pointer to the VM.
     944 * @param   pUVM                The user mode VM handle.
    940945 * @param   idCpu               The target CPU ID.  Can be OR'ed with
    941946 *                              DBGFREG_HYPER_VMCPUID.
     
    943948 * @param   pu32                Where to store the register value.
    944949 */
    945 VMMR3DECL(int) DBGFR3RegCpuQueryU32(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32)
     950VMMR3DECL(int) DBGFR3RegCpuQueryU32(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32)
    946951{
    947952    DBGFREGVAL Value;
    948     int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U32, &Value);
     953    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U32, &Value);
    949954    if (RT_SUCCESS(rc))
    950955        *pu32 = Value.u32;
     
    966971 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    967972 *
    968  * @param   pVM                 Pointer to the VM.
     973 * @param   pUVM                The user mode VM handle.
    969974 * @param   idCpu               The target CPU ID.  Can be OR'ed with
    970975 *                              DBGFREG_HYPER_VMCPUID.
     
    972977 * @param   pu64                Where to store the register value.
    973978 */
    974 VMMR3DECL(int) DBGFR3RegCpuQueryU64(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64)
     979VMMR3DECL(int) DBGFR3RegCpuQueryU64(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64)
    975980{
    976981    DBGFREGVAL Value;
    977     int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U64, &Value);
     982    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U64, &Value);
    978983    if (RT_SUCCESS(rc))
    979984        *pu64 = Value.u64;
     
    10081013
    10091014
    1010 static DECLCALLBACK(int) dbgfR3RegCpuQueryBatchWorker(PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
     1015static DECLCALLBACK(int) dbgfR3RegCpuQueryBatchWorker(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
    10111016{
    10121017#if 0
    1013     PVMCPU    pVCpu = &pVM->aCpus[idCpu];
     1018    PVMCPU    pVCpu = &pUVM->pVM->aCpus[idCpu];
    10141019    PCCPUMCTX pCtx  = CPUMQueryGuestCtxPtr(pVCpu);
    10151020
     
    10711076 * @retval  VERR_DBGF_REGISTER_NOT_FOUND
    10721077 *
    1073  * @param   pVM                 Pointer to the VM.
     1078 * @param   pUVM                The user mode VM handle.
    10741079 * @param   idCpu               The target CPU ID.  Can be OR'ed with
    10751080 *                              DBGFREG_HYPER_VMCPUID.
     
    10811086 * @param   cRegs               The number of entries in @a paRegs.
    10821087 */
    1083 VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
    1084 {
    1085     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    1086     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
     1088VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
     1089{
     1090    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
     1091    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
     1092    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
    10871093    if (!cRegs)
    10881094        return VINF_SUCCESS;
     
    10961102    }
    10971103
    1098     return VMR3ReqCallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pVM, idCpu, paRegs, cRegs);
     1104    return VMR3ReqCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pUVM, idCpu, paRegs, cRegs);
    10991105}
    11001106
     
    11071113 * @retval  VERR_INVALID_CPU_ID
    11081114 *
    1109  * @param   pVM                 Pointer to the VM.
     1115 * @param   pUVM                The user mode VM handle.
    11101116 * @param   idCpu               The target CPU ID.  Can be OR'ed with
    11111117 *                              DBGFREG_HYPER_VMCPUID.
     
    11181124 *                              recommended value is DBGFREG_ALL_COUNT.
    11191125 */
    1120 VMMR3DECL(int) DBGFR3RegCpuQueryAll(PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
     1126VMMR3DECL(int) DBGFR3RegCpuQueryAll(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
    11211127{
    11221128    /*
    11231129     * Validate input.
    11241130     */
    1125     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    1126     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
     1131    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
     1132    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
     1133    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
    11271134    if (!cRegs)
    11281135        return VINF_SUCCESS;
     
    11421149        paRegs[iReg++].enmReg = DBGFREG_END;
    11431150
    1144     return VMR3ReqCallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pVM, idCpu, paRegs, cRegs);
     1151    return VMR3ReqCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pUVM, idCpu, paRegs, cRegs);
    11451152}
    11461153
     
    11531160 *          parameters are invalid.
    11541161 *
    1155  * @param   pVM                 Pointer to the VM.
     1162 * @param   pUVM                The user mode VM handle.
    11561163 * @param   enmReg              The register identifier.
    11571164 * @param   enmType             The register type.  This is for sort out
     
    11591166 *                              the standard name.
    11601167 */
    1161 VMMR3DECL(const char *) DBGFR3RegCpuName(PVM pVM, DBGFREG enmReg, DBGFREGVALTYPE enmType)
     1168VMMR3DECL(const char *) DBGFR3RegCpuName(PUVM pUVM, DBGFREG enmReg, DBGFREGVALTYPE enmType)
    11621169{
    11631170    AssertReturn(enmReg >= DBGFREG_AL && enmReg < DBGFREG_END, NULL);
    11641171    AssertReturn(enmType >= DBGFREGVALTYPE_INVALID && enmType < DBGFREGVALTYPE_END, NULL);
    1165     VM_ASSERT_VALID_EXT_RETURN(pVM, NULL);
    1166 
    1167     PCDBGFREGSET    pSet    = pVM->aCpus[0].dbgf.s.pGuestRegSet;
     1172    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
     1173    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
     1174
     1175    PCDBGFREGSET    pSet    = pUVM->aCpus[0].dbgf.s.pGuestRegSet;
    11681176    if (RT_UNLIKELY(!pSet))
    11691177        return NULL;
     
    12211229 *
    12221230 * @returns Lookup record.
    1223  * @param   pVM                 Pointer to the VM.
     1231 * @param   pUVM                The user mode VM handle.
    12241232 * @param   idDefCpu            The default CPU ID set.
    12251233 * @param   pszReg              The register name.
     
    12271235 *                              hypervisor CPU registers if clear.
    12281236 */
    1229 static PCDBGFREGLOOKUP dbgfR3RegResolve(PVM pVM, VMCPUID idDefCpu, const char *pszReg, bool fGuestRegs)
    1230 {
    1231     DBGF_REG_DB_LOCK_READ(pVM);
     1237static PCDBGFREGLOOKUP dbgfR3RegResolve(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, bool fGuestRegs)
     1238{
     1239    DBGF_REG_DB_LOCK_READ(pUVM);
    12321240
    12331241    /* Try looking up the name without any case folding or cpu prefixing. */
    1234     PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pVM->dbgf.s.RegSpace, pszReg);
     1242    PRTSTRSPACE pRegSpace = &pUVM->dbgf.s.RegSpace;
     1243    PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, pszReg);
    12351244    if (!pLookupRec)
    12361245    {
     
    12401249        ssize_t cchFolded = dbgfR3RegCopyToLower(pszReg, RTSTR_MAX, szName, sizeof(szName) - DBGF_REG_MAX_NAME);
    12411250        if (cchFolded > 0)
    1242             pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pVM->dbgf.s.RegSpace, szName);
     1251            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
    12431252        if (   !pLookupRec
    12441253            && cchFolded >= 0
     
    12481257            size_t cchCpuSet = RTStrPrintf(szName, sizeof(szName), fGuestRegs ? "cpu%u." : "hypercpu%u.", idDefCpu);
    12491258            dbgfR3RegCopyToLower(pszReg, RTSTR_MAX, &szName[cchCpuSet], sizeof(szName) - cchCpuSet);
    1250             pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pVM->dbgf.s.RegSpace, szName);
     1259            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
    12511260        }
    12521261    }
    12531262
    1254     DBGF_REG_DB_UNLOCK_READ(pVM);
     1263    DBGF_REG_DB_UNLOCK_READ(pUVM);
    12551264    return pLookupRec;
    12561265}
     
    12641273 * @retval  VERR_DBGF_REGISTER_NOT_FOUND if not found.
    12651274 *
    1266  * @param   pVM                 Pointer to the VM.
     1275 * @param   pUVM                The user mode VM handle.
    12671276 * @param   idDefCpu            The default CPU.
    12681277 * @param   pszReg              The registe name.
    12691278 */
    1270 VMMR3DECL(int) DBGFR3RegNmValidate(PVM pVM, VMCPUID idDefCpu, const char *pszReg)
     1279VMMR3DECL(int) DBGFR3RegNmValidate(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg)
    12711280{
    12721281    /*
    12731282     * Validate input.
    12741283     */
    1275     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    1276     AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
     1284    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1285    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     1286    AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pUVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
    12771287    AssertPtrReturn(pszReg, VERR_INVALID_POINTER);
    12781288
     
    12811291     */
    12821292    bool const fGuestRegs = !(idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY;
    1283     PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pVM, idDefCpu, pszReg, fGuestRegs);
     1293    PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pUVM, idDefCpu, pszReg, fGuestRegs);
    12841294    if (!pLookupRec)
    12851295        return VERR_DBGF_REGISTER_NOT_FOUND;
     
    12941304 * @returns VBox status code.
    12951305 *
    1296  * @param   pVM                 Pointer to the VM.
     1306 * @param   pUVM                The user mode VM handle.
    12971307 * @param   pLookupRec          The register lookup record.
    12981308 * @param   enmType             The desired return type.
     
    13011311 *                              Optional.
    13021312 */
    1303 static DECLCALLBACK(int) dbgfR3RegNmQueryWorkerOnCpu(PVM pVM, PCDBGFREGLOOKUP pLookupRec, DBGFREGVALTYPE enmType,
     1313static DECLCALLBACK(int) dbgfR3RegNmQueryWorkerOnCpu(PUVM pUVM, PCDBGFREGLOOKUP pLookupRec, DBGFREGVALTYPE enmType,
    13041314                                                     PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
    13051315{
     
    13101320    int                 rc;
    13111321
    1312     NOREF(pVM);
     1322    NOREF(pUVM);
    13131323
    13141324    /*
     
    14091419 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    14101420 *
    1411  * @param   pVM                 Pointer to the VM.
     1421 * @param   pUVM                The user mode VM handle.
    14121422 * @param   idDefCpu            The virtual CPU ID for the default CPU register
    14131423 *                              set.  Can be OR'ed with DBGFREG_HYPER_VMCPUID.
     
    14181428 *                              Optional.
    14191429 */
    1420 static int dbgfR3RegNmQueryWorker(PVM pVM, VMCPUID idDefCpu, const char *pszReg, DBGFREGVALTYPE enmType,
     1430static int dbgfR3RegNmQueryWorker(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, DBGFREGVALTYPE enmType,
    14211431                                  PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
    14221432{
     
    14241434     * Validate input.
    14251435     */
    1426     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    1427     AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
     1436    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1437    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     1438    AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pUVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
    14281439    AssertPtrReturn(pszReg, VERR_INVALID_POINTER);
    14291440
     
    14351446     */
    14361447    bool const fGuestRegs = !(idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY;
    1437     PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pVM, idDefCpu, pszReg, fGuestRegs);
     1448    PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pUVM, idDefCpu, pszReg, fGuestRegs);
    14381449    if (pLookupRec)
    14391450    {
     
    14421453        else if (idDefCpu != VMCPUID_ANY)
    14431454            idDefCpu &= ~DBGFREG_HYPER_VMCPUID;
    1444         return VMR3ReqPriorityCallWait(pVM, idDefCpu, (PFNRT)dbgfR3RegNmQueryWorkerOnCpu, 5, pVM, pLookupRec, enmType, pValue, penmType);
     1455        return VMR3ReqPriorityCallWaitU(pUVM, idDefCpu, (PFNRT)dbgfR3RegNmQueryWorkerOnCpu, 5,
     1456                                        pUVM, pLookupRec, enmType, pValue, penmType);
    14451457    }
    14461458    return VERR_DBGF_REGISTER_NOT_FOUND;
     
    14561468 * @retval  VERR_DBGF_REGISTER_NOT_FOUND
    14571469 *
    1458  * @param   pVM                 Pointer to the VM.
     1470 * @param   pUVM                The user mode VM handle.
    14591471 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    14601472 *                              applicable. Can be OR'ed with
     
    14661478 * @param   penmType            Where to store the register value type.
    14671479 */
    1468 VMMR3DECL(int) DBGFR3RegNmQuery(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
    1469 {
    1470     return dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_END, pValue, penmType);
     1480VMMR3DECL(int) DBGFR3RegNmQuery(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
     1481{
     1482    return dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_END, pValue, penmType);
    14711483}
    14721484
     
    14821494 * @retval  VINF_DBGF_TRUNCATED_REGISTER
    14831495 *
    1484  * @param   pVM                 Pointer to the VM.
     1496 * @param   pUVM                The user mode VM handle.
    14851497 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    14861498 *                              applicable. Can be OR'ed with
     
    14911503 * @param   pu8                 Where to store the register value.
    14921504 */
    1493 VMMR3DECL(int) DBGFR3RegNmQueryU8(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint8_t *pu8)
     1505VMMR3DECL(int) DBGFR3RegNmQueryU8(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint8_t *pu8)
    14941506{
    14951507    DBGFREGVAL Value;
    1496     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U8, &Value, NULL);
     1508    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U8, &Value, NULL);
    14971509    if (RT_SUCCESS(rc))
    14981510        *pu8 = Value.u8;
     
    15141526 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    15151527 *
    1516  * @param   pVM                 Pointer to the VM.
     1528 * @param   pUVM                The user mode VM handle.
    15171529 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    15181530 *                              applicable.  Can be OR'ed with
     
    15231535 * @param   pu16                Where to store the register value.
    15241536 */
    1525 VMMR3DECL(int) DBGFR3RegNmQueryU16(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint16_t *pu16)
     1537VMMR3DECL(int) DBGFR3RegNmQueryU16(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint16_t *pu16)
    15261538{
    15271539    DBGFREGVAL Value;
    1528     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U16, &Value, NULL);
     1540    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U16, &Value, NULL);
    15291541    if (RT_SUCCESS(rc))
    15301542        *pu16 = Value.u16;
     
    15461558 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    15471559 *
    1548  * @param   pVM                 Pointer to the VM.
     1560 * @param   pUVM                The user mode VM handle.
    15491561 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    15501562 *                              applicable.  Can be OR'ed with
     
    15551567 * @param   pu32                Where to store the register value.
    15561568 */
    1557 VMMR3DECL(int) DBGFR3RegNmQueryU32(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint32_t *pu32)
     1569VMMR3DECL(int) DBGFR3RegNmQueryU32(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint32_t *pu32)
    15581570{
    15591571    DBGFREGVAL Value;
    1560     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U32, &Value, NULL);
     1572    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U32, &Value, NULL);
    15611573    if (RT_SUCCESS(rc))
    15621574        *pu32 = Value.u32;
     
    15781590 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    15791591 *
    1580  * @param   pVM                 Pointer to the VM.
     1592 * @param   pUVM                The user mode VM handle.
    15811593 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    15821594 *                              applicable.  Can be OR'ed with
     
    15871599 * @param   pu64                Where to store the register value.
    15881600 */
    1589 VMMR3DECL(int) DBGFR3RegNmQueryU64(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64)
     1601VMMR3DECL(int) DBGFR3RegNmQueryU64(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64)
    15901602{
    15911603    DBGFREGVAL Value;
    1592     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U64, &Value, NULL);
     1604    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U64, &Value, NULL);
    15931605    if (RT_SUCCESS(rc))
    15941606        *pu64 = Value.u64;
     
    16101622 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    16111623 *
    1612  * @param   pVM                 Pointer to the VM.
     1624 * @param   pUVM                The user mode VM handle.
    16131625 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    16141626 *                              applicable.  Can be OR'ed with
     
    16191631 * @param   pu128               Where to store the register value.
    16201632 */
    1621 VMMR3DECL(int) DBGFR3RegNmQueryU128(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U pu128)
     1633VMMR3DECL(int) DBGFR3RegNmQueryU128(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U pu128)
    16221634{
    16231635    DBGFREGVAL Value;
    1624     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U128, &Value, NULL);
     1636    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U128, &Value, NULL);
    16251637    if (RT_SUCCESS(rc))
    16261638        *pu128 = Value.u128;
     
    16431655 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    16441656 *
    1645  * @param   pVM                 Pointer to the VM.
     1657 * @param   pUVM                The user mode VM handle.
    16461658 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    16471659 *                              applicable.  Can be OR'ed with
     
    16521664 * @param   plrd                Where to store the register value.
    16531665 */
    1654 VMMR3DECL(int) DBGFR3RegNmQueryLrd(PVM pVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd)
     1666VMMR3DECL(int) DBGFR3RegNmQueryLrd(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd)
    16551667{
    16561668    DBGFREGVAL Value;
    1657     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_R80, &Value, NULL);
     1669    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_R80, &Value, NULL);
    16581670    if (RT_SUCCESS(rc))
    16591671        *plrd = Value.lrd;
     
    16761688 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    16771689 *
    1678  * @param   pVM                 Pointer to the VM.
     1690 * @param   pUVM                The user mode VM handle.
    16791691 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    16801692 *                              applicable.  Can be OR'ed with
     
    16861698 * @param   pu32Limit           Where to store the register limit value.
    16871699 */
    1688 VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint32_t *pu32Limit)
     1700VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint32_t *pu32Limit)
    16891701{
    16901702    DBGFREGVAL Value;
    1691     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_DTR, &Value, NULL);
     1703    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_DTR, &Value, NULL);
    16921704    if (RT_SUCCESS(rc))
    16931705    {
     
    17041716
    17051717
    1706 /// @todo VMMR3DECL(int) DBGFR3RegNmQueryBatch(PVM pVM,VMCPUID idDefCpu, DBGFREGENTRYNM paRegs, size_t cRegs);
     1718/// @todo VMMR3DECL(int) DBGFR3RegNmQueryBatch(PUVM pUVM,VMCPUID idDefCpu, DBGFREGENTRYNM paRegs, size_t cRegs);
    17071719
    17081720
     
    17111723 *
    17121724 * @returns VBox status code.
    1713  * @param   pVM                 Pointer to the VM.
     1725 * @param   pUVM                The user mode VM handle.
    17141726 * @param   pcRegs              Where to return the register count.
    17151727 */
    1716 VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PVM pVM, size_t *pcRegs)
    1717 {
    1718     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    1719     *pcRegs = pVM->dbgf.s.cRegs;
     1728VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PUVM pUVM, size_t *pcRegs)
     1729{
     1730    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1731    *pcRegs = pUVM->dbgf.s.cRegs;
    17201732    return VINF_SUCCESS;
    17211733}
     
    18031815    PDBGFREGENTRYNM             paRegs = pArgs->paRegs;
    18041816    size_t const                cRegs  = pArgs->cRegs;
    1805 
    1806     DBGF_REG_DB_LOCK_READ(pVM);
     1817    PUVM                        pUVM   = pVM->pUVM;
     1818    PUVMCPU                     pUVCpu = pVCpu->pUVCpu;
     1819
     1820    DBGF_REG_DB_LOCK_READ(pUVM);
    18071821
    18081822    /*
     
    18101824     */
    18111825    size_t iCpuReg = pVCpu->idCpu * DBGFREG_ALL_COUNT;
    1812     if (pVCpu->dbgf.s.pGuestRegSet)
     1826    if (pUVCpu->dbgf.s.pGuestRegSet)
    18131827    {
    18141828        if (iCpuReg < cRegs)
    1815             dbgfR3RegNmQueryAllInSet(pVCpu->dbgf.s.pGuestRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
     1829            dbgfR3RegNmQueryAllInSet(pUVCpu->dbgf.s.pGuestRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
    18161830    }
    18171831    else
     
    18211835     * My hypervisor CPU registers.
    18221836     */
    1823     iCpuReg = pVM->cCpus * DBGFREG_ALL_COUNT + pVCpu->idCpu * DBGFREG_ALL_COUNT;
    1824     if (pVCpu->dbgf.s.pHyperRegSet)
     1837    iCpuReg = pUVM->cCpus * DBGFREG_ALL_COUNT + pUVCpu->idCpu * DBGFREG_ALL_COUNT;
     1838    if (pUVCpu->dbgf.s.pHyperRegSet)
    18251839    {
    18261840        if (iCpuReg < cRegs)
    1827             dbgfR3RegNmQueryAllInSet(pVCpu->dbgf.s.pHyperRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
     1841            dbgfR3RegNmQueryAllInSet(pUVCpu->dbgf.s.pHyperRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
    18281842    }
    18291843    else
     
    18331847     * The primary CPU does all the other registers.
    18341848     */
    1835     if (pVCpu->idCpu == 0)
    1836     {
    1837         pArgs->iReg = pVM->cCpus * DBGFREG_ALL_COUNT * 2;
    1838         RTStrSpaceEnumerate(&pVM->dbgf.s.RegSetSpace, dbgfR3RegNmQueryAllEnum, pArgs);
     1849    if (pUVCpu->idCpu == 0)
     1850    {
     1851        pArgs->iReg = pUVM->cCpus * DBGFREG_ALL_COUNT * 2;
     1852        RTStrSpaceEnumerate(&pUVM->dbgf.s.RegSetSpace, dbgfR3RegNmQueryAllEnum, pArgs);
    18391853        dbgfR3RegNmQueryAllPadEntries(paRegs, cRegs, pArgs->iReg, cRegs);
    18401854    }
    18411855
    1842     DBGF_REG_DB_UNLOCK_READ(pVM);
     1856    DBGF_REG_DB_UNLOCK_READ(pUVM);
    18431857    return VINF_SUCCESS; /* Ignore errors. */
    18441858}
     
    18491863 *
    18501864 * @returns VBox status code.
    1851  * @param   pVM                 Pointer to the VM.
     1865 * @param   pUVM                The user mode VM handle.
    18521866 * @param   paRegs              The output register value array.  The register
    18531867 *                              name string is read only and shall not be freed
     
    18571871 *                              DBGFR3RegNmQueryAllCount.
    18581872 */
    1859 VMMR3DECL(int) DBGFR3RegNmQueryAll(PVM pVM, PDBGFREGENTRYNM paRegs, size_t cRegs)
    1860 {
     1873VMMR3DECL(int) DBGFR3RegNmQueryAll(PUVM pUVM, PDBGFREGENTRYNM paRegs, size_t cRegs)
     1874{
     1875    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1876    PVM pVM = pUVM->pVM;
    18611877    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    18621878    AssertPtrReturn(paRegs, VERR_INVALID_POINTER);
     
    18711887
    18721888
    1873 VMMR3DECL(int) DBGFR3RegNmSet(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
    1874 {
    1875     NOREF(pVM); NOREF(idDefCpu); NOREF(pszReg); NOREF(pValue); NOREF(enmType);
     1889VMMR3DECL(int) DBGFR3RegNmSet(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
     1890{
     1891    NOREF(pUVM); NOREF(idDefCpu); NOREF(pszReg); NOREF(pValue); NOREF(enmType);
    18761892    return VERR_NOT_IMPLEMENTED;
    18771893}
     
    19231939
    19241940
    1925 
    19261941/**
    19271942 * Format a register value, extended version.
     
    19391954 * @param   fFlags          String formatting flags, RTSTR_F_XXX.
    19401955 */
    1941 VMMDECL(ssize_t) DBGFR3RegFormatValueEx(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType,
    1942                                         unsigned uBase, signed int cchWidth, signed int cchPrecision, uint32_t fFlags)
     1956VMMR3DECL(ssize_t) DBGFR3RegFormatValueEx(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType,
     1957                                          unsigned uBase, signed int cchWidth, signed int cchPrecision, uint32_t fFlags)
    19431958{
    19441959    /*
     
    19761991 * @param   fSpecial        Same as RTSTR_F_SPECIAL.
    19771992 */
    1978 VMMDECL(ssize_t) DBGFR3RegFormatValue(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, bool fSpecial)
     1993VMMR3DECL(ssize_t) DBGFR3RegFormatValue(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, bool fSpecial)
    19791994{
    19801995    int cchWidth = 0;
     
    20212036    DBGFREGVAL      Value;
    20222037    DBGFREGVALTYPE  enmType;
    2023     int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
     2038    int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pUVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
    20242039    if (RT_FAILURE(rc))
    20252040    {
     
    21142129    DBGFREGVAL      Value;
    21152130    DBGFREGVALTYPE  enmType;
    2116     int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
     2131    int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pUVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
    21172132    if (RT_FAILURE(rc))
    21182133    {
     
    21772192     * input string termination.
    21782193     */
     2194    PRTSTRSPACE pRegSpace = &pThis->pUVM->dbgf.s.RegSpace;
    21792195    /* Try looking up the name without any case folding or cpu prefixing. */
    2180     PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGetN(&pThis->pVM->dbgf.s.RegSpace, pachReg, cchReg);
     2196    PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGetN(pRegSpace, pachReg, cchReg);
    21812197    if (!pLookupRec)
    21822198    {
     
    21852201        ssize_t cchFolded = dbgfR3RegCopyToLower(pachReg, cchReg, szName, sizeof(szName) - DBGF_REG_MAX_NAME);
    21862202        if (cchFolded > 0)
    2187             pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pThis->pVM->dbgf.s.RegSpace, szName);
     2203            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
    21882204        if (   !pLookupRec
    21892205            && cchFolded >= 0
     
    21932209            size_t cchCpuSet = RTStrPrintf(szName, sizeof(szName), pThis->fGuestRegs ? "cpu%u." : "hypercpu%u.", pThis->idCpu);
    21942210            dbgfR3RegCopyToLower(pachReg, cchReg, &szName[cchCpuSet], sizeof(szName) - cchCpuSet);
    2195             pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pThis->pVM->dbgf.s.RegSpace, szName);
     2211            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
    21962212        }
    21972213    }
     
    22702286static DECLCALLBACK(int) dbgfR3RegPrintfWorkerOnCpu(PDBGFR3REGPRINTFARGS pArgs)
    22712287{
    2272     DBGF_REG_DB_LOCK_READ(pArgs->pVM);
     2288    DBGF_REG_DB_LOCK_READ(pArgs->pUVM);
    22732289    RTStrFormatV(dbgfR3RegPrintfCbOutput, pArgs, dbgfR3RegPrintfCbFormat, pArgs, pArgs->pszFormat, pArgs->va);
    2274     DBGF_REG_DB_UNLOCK_READ(pArgs->pVM);
     2290    DBGF_REG_DB_UNLOCK_READ(pArgs->pUVM);
    22752291    return pArgs->rc;
    22762292}
     
    22832299 *
    22842300 * @returns VBox status code.
    2285  * @param   pVM                 Pointer to the VM.
     2301 * @param   pUVM                The user mode VM handle.
    22862302 * @param   idCpu               The CPU ID of any CPU registers that may be
    22872303 *                              printed, pass VMCPUID_ANY if not applicable.
     
    22922308 * @param   va                  Other format arguments.
    22932309 */
    2294 VMMR3DECL(int) DBGFR3RegPrintfV(PVM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va)
     2310VMMR3DECL(int) DBGFR3RegPrintfV(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va)
    22952311{
    22962312    AssertPtrReturn(pszBuf, VERR_INVALID_POINTER);
     
    22982314    *pszBuf = '\0';
    22992315
    2300     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    2301     AssertReturn((idCpu & ~DBGFREG_HYPER_VMCPUID) < pVM->cCpus || idCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
     2316    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     2317    AssertReturn((idCpu & ~DBGFREG_HYPER_VMCPUID) < pUVM->cCpus || idCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
    23022318    AssertPtrReturn(pszFormat, VERR_INVALID_POINTER);
    23032319
     
    23072323     */
    23082324    DBGFR3REGPRINTFARGS Args;
    2309     Args.pVM        = pVM;
     2325    Args.pUVM       = pUVM;
    23102326    Args.idCpu      = idCpu != VMCPUID_ANY ? idCpu & ~DBGFREG_HYPER_VMCPUID : idCpu;
    23112327    Args.fGuestRegs = idCpu != VMCPUID_ANY && !(idCpu & DBGFREG_HYPER_VMCPUID);
     
    23162332    Args.cchLeftBuf = cbBuf - 1;
    23172333    Args.rc         = VINF_SUCCESS;
    2318     int rc = VMR3ReqPriorityCallWait(pVM, Args.idCpu, (PFNRT)dbgfR3RegPrintfWorkerOnCpu, 1, &Args);
     2334    int rc = VMR3ReqPriorityCallWaitU(pUVM, Args.idCpu, (PFNRT)dbgfR3RegPrintfWorkerOnCpu, 1, &Args);
    23192335    va_end(Args.va);
    23202336    return rc;
     
    23282344 *
    23292345 * @returns VBox status code.
    2330  * @param   pVM                 Pointer to the VM.
     2346 * @param   pUVM                The user mode VM handle.
    23312347 * @param   idCpu               The CPU ID of any CPU registers that may be
    23322348 *                              printed, pass VMCPUID_ANY if not applicable.
     
    23402356 * @param   ...                 Other format arguments.
    23412357 */
    2342 VMMR3DECL(int) DBGFR3RegPrintf(PVM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
     2358VMMR3DECL(int) DBGFR3RegPrintf(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
    23432359{
    23442360    va_list va;
    23452361    va_start(va, pszFormat);
    2346     int rc = DBGFR3RegPrintfV(pVM, idCpu, pszBuf, cbBuf, pszFormat, va);
     2362    int rc = DBGFR3RegPrintfV(pUVM, idCpu, pszBuf, cbBuf, pszFormat, va);
    23472363    va_end(va);
    23482364    return rc;
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette