VirtualBox

Changeset 30072 in vbox for trunk/src/VBox/VMM/VMM.cpp


Ignore:
Timestamp:
Jun 7, 2010 1:54:47 PM (15 years ago)
Author:
vboxsync
Message:

VMM: Ring-0 stack on guru meditations originating with an assertion for all 32-bit targets. The symbol resolving is ugly. Dump register context as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMM.cpp

    r29902 r30072  
    17791779 * @param   pVM             Pointer to the shared VM structure.
    17801780 * @param   idCpu           The ID of the source CPU context (for the address).
    1781  * @param   pAddress        Where to start reading.
     1781 * @param   R0Addr          Where to start reading.
    17821782 * @param   pvBuf           Where to store the data we've read.
    17831783 * @param   cbRead          The number of bytes to read.
    17841784 */
    1785 VMMR3DECL(int) VMMR3ReadR0Stack(PVM pVM, VMCPUID idCpu, RTHCUINTPTR pAddress, void *pvBuf, size_t cbRead)
    1786 {
    1787     PVMCPU  pVCpu  = VMMGetCpuById(pVM, idCpu);
     1785VMMR3DECL(int) VMMR3ReadR0Stack(PVM pVM, VMCPUID idCpu, RTHCUINTPTR R0Addr, void *pvBuf, size_t cbRead)
     1786{
     1787    PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
    17881788    AssertReturn(pVCpu, VERR_INVALID_PARAMETER);
    17891789
    1790     RTHCUINTPTR offset = pVCpu->vmm.s.CallRing3JmpBufR0.SpCheck - pAddress;
    1791     if (offset >= pVCpu->vmm.s.CallRing3JmpBufR0.cbSavedStack)
     1790#ifdef VMM_R0_SWITCH_STACK
     1791    RTHCUINTPTR off = R0Addr - MMHyperCCToR0(pVM, pVCpu->vmm.s.pbEMTStackR3);
     1792#else
     1793    RTHCUINTPTR off = pVCpu->vmm.s.CallRing3JmpBufR0.cbSavedStack - (pVCpu->vmm.s.CallRing3JmpBufR0.SpCheck - R0Addr);
     1794#endif
     1795    if (   off          >  VMM_STACK_SIZE
     1796        || off + cbRead >= VMM_STACK_SIZE)
    17921797        return VERR_INVALID_POINTER;
    17931798
    1794     memcpy(pvBuf, pVCpu->vmm.s.pbEMTStackR3 + pVCpu->vmm.s.CallRing3JmpBufR0.cbSavedStack - offset, cbRead);
     1799    memcpy(pvBuf, &pVCpu->vmm.s.pbEMTStackR3[off], cbRead);
    17951800    return VINF_SUCCESS;
    17961801}
     
    21272132#else
    21282133            pVCpu->vmm.s.CallRing3JmpBufR0.rip = 0;
     2134#endif
     2135#ifdef VMM_R0_SWITCH_STACK
     2136            *(uint64_t *)pVCpu->vmm.s.pbEMTStackR3 = 0; /* clear marker  */
    21292137#endif
    21302138            LogRel((pVM->vmm.s.szRing0AssertMsg1));
Note: See TracChangeset for help on using the changeset viewer.

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