~ubuntu-branches/ubuntu/trusty/virtualbox/trusty-proposed

« back to all changes in this revision

Viewing changes to src/VBox/VMM/VMMR3/PGMDbg.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2013-03-07 16:38:36 UTC
  • mfrom: (1.1.13) (3.1.20 experimental)
  • Revision ID: package-import@ubuntu.com-20130307163836-p93jpbgx39tp3gb4
Tags: 4.2.8-dfsg-0ubuntu1
* New upstream release. (Closes: #691148)
  - Fixes compatibility with kernel 3.8. (Closes: #700823; LP: #1101867)
* Switch to my @debian.org email address.
* Move package to contrib as virtualbox 4.2 needs a non-free compiler to
  build the BIOS.
* Build-depend on libdevmapper-dev.
* Refresh patches.
  - Drop 36-fix-ftbfs-xserver-112.patch, cve-2012-3221.patch,
    CVE-2013-0420.patch 37-kcompat-3.6.patch and 38-kcompat-3.7.patch.
* Drop all virtualbox-ose transitional packages.
* Drop the virtualbox-fuse package as vdfuse fails to build with
  virtualbox 4.2.
* Update install files and VBox.sh.
* Bump required kbuild version to 0.1.9998svn2577.
* Fix path to VBoxCreateUSBNode.sh in virtualbox.postinst. (Closes: #700479)
* Add an init script to virtuabox-guest-x11 which loads the vboxvideo
  kernel module. The X Server 1.13 doesn't load it anymore. (Closes: #686994)
* Update man pages. (Closes: #680053)
* Add 36-python-multiarch.patch from Rico Tzschichholz to fix detection of
  python in multiarch paths using pkg-config.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 */
5
5
 
6
6
/*
7
 
 * Copyright (C) 2006-2010 Oracle Corporation
 
7
 * Copyright (C) 2006-2012 Oracle Corporation
8
8
 *
9
9
 * This file is part of VirtualBox Open Source Edition (OSE), as
10
10
 * available from http://www.virtualbox.org. This file is free software;
48
48
 */
49
49
typedef struct PGMR3DUMPHIERARCHYSTATE
50
50
{
51
 
    /** The VM handle. */
 
51
    /** Pointer to the VM. */
52
52
    PVM             pVM;
53
53
    /** Output helpers. */
54
54
    PCDBGFINFOHLP   pHlp;
102
102
 * @retval  VINF_SUCCESS on success, *pGCPhys is set.
103
103
 * @retval  VERR_INVALID_POINTER if the pointer is not within the GC physical memory.
104
104
 *
105
 
 * @param   pVM         The VM handle.
 
105
 * @param   pVM         Pointer to the VM.
106
106
 * @param   R3Ptr       The R3 pointer to convert.
107
107
 * @param   pGCPhys     Where to store the GC physical address on success.
108
108
 */
109
109
VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PVM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
110
110
{
 
111
    NOREF(pVM); NOREF(R3Ptr);
111
112
    *pGCPhys = NIL_RTGCPHYS;
112
113
    return VERR_NOT_IMPLEMENTED;
113
114
}
123
124
 * @retval  VERR_PGM_PHYS_PAGE_RESERVED it it's a valid GC physical page but has no physical backing.
124
125
 * @retval  VERR_INVALID_POINTER if the pointer is not within the GC physical memory.
125
126
 *
126
 
 * @param   pVM         The VM handle.
 
127
 * @param   pVM         Pointer to the VM.
127
128
 * @param   R3Ptr       The R3 pointer to convert.
128
129
 * @param   pHCPhys     Where to store the HC physical address on success.
129
130
 */
130
131
VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PVM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
131
132
{
 
133
    NOREF(pVM); NOREF(R3Ptr);
132
134
    *pHCPhys = NIL_RTHCPHYS;
133
135
    return VERR_NOT_IMPLEMENTED;
134
136
}
143
145
 * @retval  VINF_SUCCESS on success, *pGCPhys is set.
144
146
 * @retval  VERR_INVALID_POINTER if the HC physical address is not within the GC physical memory.
145
147
 *
146
 
 * @param   pVM     The VM handle.
 
148
 * @param   pVM     Pointer to the VM.
147
149
 * @param   HCPhys  The HC physical address to convert.
148
150
 * @param   pGCPhys Where to store the GC physical address on success.
149
151
 */
181
183
 *
182
184
 * @returns VBox status code.
183
185
 *
184
 
 * @param   pVM         The VM handle.
 
186
 * @param   pVM         Pointer to the VM.
185
187
 * @param   pvDst       Where to store what's read.
186
188
 * @param   GCPhysDst   Where to start reading from.
187
189
 * @param   cb          The number of bytes to attempt reading.
203
205
 
204
206
    /* partial read that failed, chop it up in pages. */
205
207
    *pcbRead = 0;
206
 
    size_t const cbReq = cb;
207
208
    rc = VINF_SUCCESS;
208
209
    while (cb > 0)
209
210
    {
233
234
 *
234
235
 * @returns VBox status code.
235
236
 *
236
 
 * @param   pVM         The VM handle.
 
237
 * @param   pVM         Pointer to the VM.
237
238
 * @param   GCPhysDst   Where to start writing.
238
239
 * @param   pvSrc       What to write.
239
240
 * @param   cb          The number of bytes to attempt writing.
284
285
 *
285
286
 * @returns VBox status code.
286
287
 *
287
 
 * @param   pVM         The VM handle.
 
288
 * @param   pVM         Pointer to the VM.
288
289
 * @param   pvDst       Where to store what's read.
289
290
 * @param   GCPtrDst    Where to start reading from.
290
291
 * @param   cb          The number of bytes to attempt reading.
340
341
 *
341
342
 * @returns VBox status code.
342
343
 *
343
 
 * @param   pVM         The VM handle.
 
344
 * @param   pVM         Pointer to the VM.
344
345
 * @param   GCPtrDst    Where to start writing.
345
346
 * @param   pvSrc       What to write.
346
347
 * @param   cb          The number of bytes to attempt writing.
559
560
 * @retval  VERR_INVALID_POINTER if any of the pointer arguments are invalid.
560
561
 * @retval  VERR_INVALID_ARGUMENT if any other arguments are invalid.
561
562
 *
562
 
 * @param   pVM             Pointer to the shared VM structure.
 
563
 * @param   pVM             Pointer to the VM.
563
564
 * @param   GCPhys          Where to start searching.
564
565
 * @param   cbRange         The number of bytes to search.
565
566
 * @param   GCPhysAlign     The alignment of the needle. Must be a power of two
718
719
 * @retval  VERR_INVALID_POINTER if any of the pointer arguments are invalid.
719
720
 * @retval  VERR_INVALID_ARGUMENT if any other arguments are invalid.
720
721
 *
721
 
 * @param   pVM             Pointer to the shared VM structure.
 
722
 * @param   pVM             Pointer to the VM.
722
723
 * @param   pVCpu           The CPU context to search in.
723
724
 * @param   GCPtr           Where to start searching.
724
725
 * @param   GCPtrAlign      The alignment of the needle. Must be a power of two
847
848
 * Initializes the dumper state.
848
849
 *
849
850
 * @param   pState          The state to initialize.
850
 
 * @param   pVM             The VM handle.
 
851
 * @param   pVM             Pointer to the VM.
851
852
 * @param   fFlags          The flags.
852
853
 * @param   u64FirstAddr    The first address.
853
854
 * @param   u64LastAddr     The last address.
1058
1059
        else
1059
1060
            pState->pHlp->pfnPrintf(pState->pHlp, " not found");
1060
1061
    }
 
1062
    NOREF(cbPage);
1061
1063
}
1062
1064
 
1063
1065
 
1323
1325
 * Dumps a 32-bit shadow page table.
1324
1326
 *
1325
1327
 * @returns VBox status code (VINF_SUCCESS).
1326
 
 * @param   pVM         The VM handle.
 
1328
 * @param   pVM         Pointer to the VM.
1327
1329
 * @param   HCPhys      The physical address of the table.
1328
1330
 * @param   cMaxDepth   The maximum depth.
1329
1331
 */
1400
1402
 * Dumps a 32-bit shadow page table.
1401
1403
 *
1402
1404
 * @returns VBox status code (VINF_SUCCESS).
1403
 
 * @param   pVM         The VM handle.
 
1405
 * @param   pVM         Pointer to the VM.
1404
1406
 * @param   pPT         Pointer to the page table.
1405
1407
 * @param   fMapping    Set if it's a guest mapping.
1406
1408
 */
1465
1467
    cMaxDepth--;
1466
1468
 
1467
1469
    uint32_t iFirst, iLast;
1468
 
    uint64_t u64BaseAddress = pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast);
 
1470
    pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast);
1469
1471
    for (uint32_t i = iFirst; i <= iLast; i++)
1470
1472
    {
1471
1473
        X86PDE Pde = pPD->a[i];
1627
1629
 * dbgfR3PagingDumpEx worker.
1628
1630
 *
1629
1631
 * @returns VBox status code.
1630
 
 * @param   pVM             The VM handle.
 
1632
 * @param   pVM             Pointer to the VM.
1631
1633
 * @param   cr3             The CR3 register value.
1632
1634
 * @param   fFlags          The flags, DBGFPGDMP_FLAGS_XXX.
1633
1635
 * @param   u64FirstAddr    The start address.
1655
1657
 * Dumps a page table hierarchy use only physical addresses and cr4/lm flags.
1656
1658
 *
1657
1659
 * @returns VBox status code (VINF_SUCCESS).
1658
 
 * @param   pVM         The VM handle.
 
1660
 * @param   pVM         Pointer to the VM.
1659
1661
 * @param   cr3         The root of the hierarchy.
1660
1662
 * @param   cr4         The cr4, only PAE and PSE is currently used.
1661
1663
 * @param   fLongMode   Set if long mode, false if not long mode.
1725
1727
        strcpy(szPage, " not found");
1726
1728
    pgmUnlock(pState->pVM);
1727
1729
    pState->pHlp->pfnPrintf(pState->pHlp, "%s", szPage);
 
1730
    NOREF(cbPage);
1728
1731
}
1729
1732
 
1730
1733
 
1995
1998
 * Dumps a 32-bit shadow page table.
1996
1999
 *
1997
2000
 * @returns VBox status code (VINF_SUCCESS).
1998
 
 * @param   pVM         The VM handle.
 
2001
 * @param   pVM         Pointer to the VM.
1999
2002
 * @param   GCPhys      The physical address of the table.
2000
2003
 * @param   cMaxDepth   The maximum depth.
2001
2004
 */
2142
2145
    cMaxDepth--;
2143
2146
 
2144
2147
    uint32_t iFirst, iLast;
2145
 
    uint64_t u64BaseAddress = pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast);
 
2148
    pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast);
2146
2149
    for (uint32_t i = iFirst; i <= iLast; i++)
2147
2150
    {
2148
2151
        X86PDE Pde = pPD->a[i];
2304
2307
 * dbgfR3PagingDumpEx worker.
2305
2308
 *
2306
2309
 * @returns VBox status code.
2307
 
 * @param   pVM             The VM handle.
 
2310
 * @param   pVM             Pointer to the VM.
2308
2311
 * @param   cr3             The CR3 register value.
2309
2312
 * @param   fFlags          The flags, DBGFPGDMP_FLAGS_XXX.
2310
2313
 * @param   FirstAddr       The start address.