summaryrefslogtreecommitdiff
path: root/src/VBox/VMM/VMMR3/DBGFMem.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/VMM/VMMR3/DBGFMem.cpp
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/VMM/VMMR3/DBGFMem.cpp')
-rw-r--r--src/VBox/VMM/VMMR3/DBGFMem.cpp175
1 files changed, 95 insertions, 80 deletions
diff --git a/src/VBox/VMM/VMMR3/DBGFMem.cpp b/src/VBox/VMM/VMMR3/DBGFMem.cpp
index db93d733..c601302f 100644
--- a/src/VBox/VMM/VMMR3/DBGFMem.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFMem.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2007-2010 Oracle Corporation
+ * Copyright (C) 2007-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -23,9 +23,10 @@
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/selm.h>
-#include <VBox/vmm/hwaccm.h>
+#include <VBox/vmm/hm.h>
#include "DBGFInternal.h"
#include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
#include <VBox/err.h>
#include <VBox/log.h>
#include <VBox/vmm/mm.h>
@@ -36,7 +37,7 @@
* Scan guest memory for an exact byte string.
*
* @returns VBox status code.
- * @param pVM Pointer to the VM.
+ * @param pUVM The user mode VM handle.
* @param idCpu The ID of the CPU context to search in.
* @param pAddress Where to store the mixed address.
* @param puAlign The alignment restriction imposed on the search result.
@@ -46,16 +47,18 @@
* @param cbNeedle Size of the search byte string.
* @param pHitAddress Where to put the address of the first hit.
*/
-static DECLCALLBACK(int) dbgfR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, PCRTGCUINTPTR pcbRange, RTGCUINTPTR *puAlign,
- const uint8_t *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
+static DECLCALLBACK(int) dbgfR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, PCRTGCUINTPTR pcbRange,
+ RTGCUINTPTR *puAlign, const uint8_t *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
{
+ PVM pVM = pUVM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
Assert(idCpu == VMMGetCpuId(pVM));
/*
* Validate the input we use, PGM does the rest.
*/
RTGCUINTPTR cbRange = *pcbRange;
- if (!DBGFR3AddrIsValid(pVM, pAddress))
+ if (!DBGFR3AddrIsValid(pUVM, pAddress))
return VERR_INVALID_POINTER;
if (!VALID_PTR(pHitAddress))
return VERR_INVALID_POINTER;
@@ -79,7 +82,7 @@ static DECLCALLBACK(int) dbgfR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAd
RTGCPHYS PhysHit;
rc = PGMR3DbgScanPhysical(pVM, pAddress->FlatPtr, cbRange, GCPhysAlign, pabNeedle, cbNeedle, &PhysHit);
if (RT_SUCCESS(rc))
- DBGFR3AddrFromPhys(pVM, pHitAddress, PhysHit);
+ DBGFR3AddrFromPhys(pUVM, pHitAddress, PhysHit);
}
else
{
@@ -93,7 +96,7 @@ static DECLCALLBACK(int) dbgfR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAd
RTGCUINTPTR GCPtrHit;
rc = PGMR3DbgScanVirtual(pVM, pVCpu, pAddress->FlatPtr, cbRange, *puAlign, pabNeedle, cbNeedle, &GCPtrHit);
if (RT_SUCCESS(rc))
- DBGFR3AddrFromFlat(pVM, pHitAddress, GCPtrHit);
+ DBGFR3AddrFromFlat(pUVM, pHitAddress, GCPtrHit);
}
return rc;
@@ -109,7 +112,7 @@ static DECLCALLBACK(int) dbgfR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAd
* @retval VERR_INVALID_POINTER if any of the pointer arguments are invalid.
* @retval VERR_INVALID_ARGUMENT if any other arguments are invalid.
*
- * @param pVM Pointer to the VM.
+ * @param pUVM The user mode VM handle.
* @param idCpu The ID of the CPU context to search in.
* @param pAddress Where to store the mixed address.
* @param cbRange The number of bytes to scan.
@@ -121,13 +124,13 @@ static DECLCALLBACK(int) dbgfR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAd
*
* @thread Any thread.
*/
-VMMR3DECL(int) DBGFR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,
+VMMR3DECL(int) DBGFR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,
const void *pvNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
{
- VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
- AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
- return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemScan, 8,
- pVM, idCpu, pAddress, &cbRange, &uAlign, pvNeedle, cbNeedle, pHitAddress);
+ UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+ AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
+ return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemScan, 8,
+ pUVM, idCpu, pAddress, &cbRange, &uAlign, pvNeedle, cbNeedle, pHitAddress);
}
@@ -136,19 +139,21 @@ VMMR3DECL(int) DBGFR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTG
* Read guest memory.
*
* @returns VBox status code.
- * @param pVM Pointer to the VM.
- * @param pAddress Where to start reading.
- * @param pvBuf Where to store the data we've read.
- * @param cbRead The number of bytes to read.
+ * @param pUVM The user mode VM handle.
+ * @param pAddress Where to start reading.
+ * @param pvBuf Where to store the data we've read.
+ * @param cbRead The number of bytes to read.
*/
-static DECLCALLBACK(int) dbgfR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
+static DECLCALLBACK(int) dbgfR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
{
+ PVM pVM = pUVM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
Assert(idCpu == VMMGetCpuId(pVM));
/*
* Validate the input we use, PGM does the rest.
*/
- if (!DBGFR3AddrIsValid(pVM, pAddress))
+ if (!DBGFR3AddrIsValid(pUVM, pAddress))
return VERR_INVALID_POINTER;
if (!VALID_PTR(pvBuf))
return VERR_INVALID_POINTER;
@@ -196,22 +201,24 @@ static DECLCALLBACK(int) dbgfR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAd
*
* @returns VBox status code.
*
- * @param pVM Pointer to the VM.
- * @param idCpu The ID of the source CPU context (for the address).
- * @param pAddress Where to start reading.
- * @param pvBuf Where to store the data we've read.
- * @param cbRead The number of bytes to read.
+ * @param pUVM The user mode VM handle.
+ * @param idCpu The ID of the source CPU context (for the address).
+ * @param pAddress Where to start reading.
+ * @param pvBuf Where to store the data we've read.
+ * @param cbRead The number of bytes to read.
*/
-VMMR3DECL(int) DBGFR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
+VMMR3DECL(int) DBGFR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
{
- VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
- AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
+ UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+ AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
+
if ((pAddress->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) == DBGFADDRESS_FLAGS_RING0)
{
AssertCompile(sizeof(RTHCUINTPTR) <= sizeof(pAddress->FlatPtr));
- return VMMR3ReadR0Stack(pVM, idCpu, (RTHCUINTPTR)pAddress->FlatPtr, pvBuf, cbRead);
+ VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+ return VMMR3ReadR0Stack(pUVM->pVM, idCpu, (RTHCUINTPTR)pAddress->FlatPtr, pvBuf, cbRead);
}
- return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemRead, 5, pVM, idCpu, pAddress, pvBuf, cbRead);
+ return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemRead, 5, pUVM, idCpu, pAddress, pvBuf, cbRead);
}
@@ -220,18 +227,18 @@ VMMR3DECL(int) DBGFR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, voi
*
* @returns VBox status code.
*
- * @param pVM Pointer to the VM.
- * @param idCpu The ID of the source CPU context (for the address).
- * @param pAddress Where to start reading.
- * @param pszBuf Where to store the string.
- * @param cchBuf The size of the buffer.
+ * @param pUVM The user mode VM handle.
+ * @param idCpu The ID of the source CPU context (for the address).
+ * @param pAddress Where to start reading.
+ * @param pszBuf Where to store the string.
+ * @param cchBuf The size of the buffer.
*/
-static DECLCALLBACK(int) dbgfR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
+static DECLCALLBACK(int) dbgfR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
{
/*
* Validate the input we use, PGM does the rest.
*/
- if (!DBGFR3AddrIsValid(pVM, pAddress))
+ if (!DBGFR3AddrIsValid(pUVM, pAddress))
return VERR_INVALID_POINTER;
if (!VALID_PTR(pszBuf))
return VERR_INVALID_POINTER;
@@ -239,7 +246,7 @@ static DECLCALLBACK(int) dbgfR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRE
/*
* Let dbgfR3MemRead do the job.
*/
- int rc = dbgfR3MemRead(pVM, idCpu, pAddress, pszBuf, cchBuf);
+ int rc = dbgfR3MemRead(pUVM, idCpu, pAddress, pszBuf, cchBuf);
/*
* Make sure the result is terminated and that overflow is signaled.
@@ -268,13 +275,13 @@ static DECLCALLBACK(int) dbgfR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRE
*
* @returns VBox status code.
*
- * @param pVM Pointer to the VM.
- * @param idCpu The ID of the source CPU context (for the address).
- * @param pAddress Where to start reading.
- * @param pszBuf Where to store the string.
- * @param cchBuf The size of the buffer.
+ * @param pUVM The user mode VM handle.
+ * @param idCpu The ID of the source CPU context (for the address).
+ * @param pAddress Where to start reading.
+ * @param pszBuf Where to store the string.
+ * @param cchBuf The size of the buffer.
*/
-VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
+VMMR3DECL(int) DBGFR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
{
/*
* Validate and zero output.
@@ -284,13 +291,13 @@ VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddres
if (cchBuf <= 0)
return VERR_INVALID_PARAMETER;
memset(pszBuf, 0, cchBuf);
- VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
- AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
+ UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+ AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
/*
* Pass it on to the EMT.
*/
- return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemReadString, 5, pVM, idCpu, pAddress, pszBuf, cchBuf);
+ return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemReadString, 5, pUVM, idCpu, pAddress, pszBuf, cchBuf);
}
@@ -299,21 +306,23 @@ VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddres
*
* @returns VBox status code.
*
- * @param pVM Pointer to the VM.
- * @param idCpu The ID of the target CPU context (for the address).
- * @param pAddress Where to start writing.
- * @param pvBuf The data to write.
- * @param cbWrite The number of bytes to write.
+ * @param pUVM The user mode VM handle.
+ * @param idCpu The ID of the target CPU context (for the address).
+ * @param pAddress Where to start writing.
+ * @param pvBuf The data to write.
+ * @param cbWrite The number of bytes to write.
*/
-static DECLCALLBACK(int) dbgfR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
+static DECLCALLBACK(int) dbgfR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
{
/*
* Validate the input we use, PGM does the rest.
*/
- if (!DBGFR3AddrIsValid(pVM, pAddress))
+ if (!DBGFR3AddrIsValid(pUVM, pAddress))
return VERR_INVALID_POINTER;
if (!VALID_PTR(pvBuf))
return VERR_INVALID_POINTER;
+ PVM pVM = pUVM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
/*
* HMA is always special.
@@ -356,25 +365,28 @@ static DECLCALLBACK(int) dbgfR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pA
*
* @returns VBox status code.
*
- * @param pVM Pointer to the VM.
- * @param idCpu The ID of the target CPU context (for the address).
- * @param pAddress Where to start writing.
- * @param pvBuf The data to write.
- * @param cbRead The number of bytes to write.
+ * @param pUVM The user mode VM handle.
+ * @param idCpu The ID of the target CPU context (for the address).
+ * @param pAddress Where to start writing.
+ * @param pvBuf The data to write.
+ * @param cbRead The number of bytes to write.
*/
-VMMR3DECL(int) DBGFR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
+VMMR3DECL(int) DBGFR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
{
- VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
- AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
- return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemWrite, 5, pVM, idCpu, pAddress, pvBuf, cbWrite);
+ UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+ AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
+ return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemWrite, 5, pUVM, idCpu, pAddress, pvBuf, cbWrite);
}
/**
* Worker for DBGFR3SelQueryInfo that calls into SELM.
*/
-static DECLCALLBACK(int) dbgfR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
+static DECLCALLBACK(int) dbgfR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
{
+ PVM pVM = pUVM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+
/*
* Make the query.
*/
@@ -420,7 +432,7 @@ static DECLCALLBACK(int) dbgfR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, u
}
else
{
- if (HWACCMIsEnabled(pVM))
+ if (HMIsEnabled(pVM))
rc = VERR_INVALID_STATE;
else
rc = SELMR3GetShadowSelectorInfo(pVM, Sel, pSelInfo);
@@ -445,7 +457,7 @@ static DECLCALLBACK(int) dbgfR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, u
* @retval VERR_PAGE_TABLE_NOT_PRESENT or VERR_PAGE_NOT_PRESENT if the
* pagetable or page backing the selector table wasn't present.
*
- * @param pVM Pointer to the VM.
+ * @param pUVM The user mode VM handle.
* @param idCpu The ID of the virtual CPU context.
* @param Sel The selector to get info about.
* @param fFlags Flags, see DBGFQSEL_FLAGS_*.
@@ -455,10 +467,10 @@ static DECLCALLBACK(int) dbgfR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, u
* @remarks This is a wrapper around SELMR3GetSelectorInfo and
* SELMR3GetShadowSelectorInfo.
*/
-VMMR3DECL(int) DBGFR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
+VMMR3DECL(int) DBGFR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
{
- VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
- AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
+ UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+ AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
AssertReturn(!(fFlags & ~(DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_SHADOW | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE)), VERR_INVALID_PARAMETER);
AssertReturn( (fFlags & (DBGFSELQI_FLAGS_DT_SHADOW | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE))
!= (DBGFSELQI_FLAGS_DT_SHADOW | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE), VERR_INVALID_PARAMETER);
@@ -469,7 +481,7 @@ VMMR3DECL(int) DBGFR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fF
/*
* Dispatch the request to a worker running on the target CPU.
*/
- return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3SelQueryInfo, 5, pVM, idCpu, Sel, fFlags, pSelInfo);
+ return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3SelQueryInfo, 5, pUVM, idCpu, Sel, fFlags, pSelInfo);
}
@@ -544,7 +556,7 @@ static uint32_t dbgfR3PagingDumpModeToFlags(PGMMODE enmMode)
* EMT worker for DBGFR3PagingDumpEx.
*
* @returns VBox status code.
- * @param pVM Pointer to the VM.
+ * @param pUVM The shared VM handle.
* @param idCpu The current CPU ID.
* @param fFlags The flags, DBGFPGDMP_FLAGS_XXX. Valid.
* @param pcr3 The CR3 to use (unless we're getting the current
@@ -554,7 +566,7 @@ static uint32_t dbgfR3PagingDumpModeToFlags(PGMMODE enmMode)
* @param cMaxDepth The depth.
* @param pHlp The output callbacks.
*/
-static DECLCALLBACK(int) dbgfR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t *pcr3,
+static DECLCALLBACK(int) dbgfR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t *pcr3,
uint64_t *pu64FirstAddr, uint64_t *pu64LastAddr,
uint32_t cMaxDepth, PCDBGFINFOHLP pHlp)
{
@@ -563,13 +575,16 @@ static DECLCALLBACK(int) dbgfR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFl
*/
if ((fFlags & (DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_SHADOW)) == (DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_SHADOW))
{
- int rc1 = dbgfR3PagingDumpEx(pVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_GUEST,
+ int rc1 = dbgfR3PagingDumpEx(pUVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_GUEST,
pcr3, pu64FirstAddr, pu64LastAddr, cMaxDepth, pHlp);
- int rc2 = dbgfR3PagingDumpEx(pVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_SHADOW,
+ int rc2 = dbgfR3PagingDumpEx(pUVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_SHADOW,
pcr3, pu64FirstAddr, pu64LastAddr, cMaxDepth, pHlp);
return RT_FAILURE(rc1) ? rc1 : rc2;
}
+ PVM pVM = pUVM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+
/*
* Get the current CR3/mode if required.
*/
@@ -625,7 +640,7 @@ static DECLCALLBACK(int) dbgfR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFl
* This API can be used to dump both guest and shadow structures.
*
* @returns VBox status code.
- * @param pVM Pointer to the VM.
+ * @param pUVM The user mode VM handle.
* @param idCpu The current CPU ID.
* @param fFlags The flags, DBGFPGDMP_FLAGS_XXX.
* @param cr3 The CR3 to use (unless we're getting the current
@@ -636,14 +651,14 @@ static DECLCALLBACK(int) dbgfR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFl
* @param pHlp The output callbacks. Defaults to the debug log if
* NULL.
*/
-VMMDECL(int) DBGFR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
+VMMDECL(int) DBGFR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp)
{
/*
* Input validation.
*/
- VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
- AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
+ UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+ AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
AssertReturn(!(fFlags & ~DBGFPGDMP_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER);
AssertReturn(fFlags & (DBGFPGDMP_FLAGS_SHADOW | DBGFPGDMP_FLAGS_GUEST), VERR_INVALID_PARAMETER);
AssertReturn((fFlags & DBGFPGDMP_FLAGS_CURRENT_MODE) || !(fFlags & DBGFPGDMP_FLAGS_MODE_MASK), VERR_INVALID_PARAMETER);
@@ -656,7 +671,7 @@ VMMDECL(int) DBGFR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_
/*
* Forward the request to the target CPU.
*/
- return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3PagingDumpEx, 8,
- pVM, idCpu, fFlags, &cr3, &u64FirstAddr, &u64LastAddr, cMaxDepth, pHlp);
+ return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3PagingDumpEx, 8,
+ pUVM, idCpu, fFlags, &cr3, &u64FirstAddr, &u64LastAddr, cMaxDepth, pHlp);
}