VirtualBox

Changeset 14679

Show
Ignore:
Timestamp:
11/27/08 03:07:39 (1 month ago)
Author:
vboxsync
Message:

HWVMX,VMM: make 100% sure the logger doesn't screw us during the guest/host setup.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/VBox/vmm.h

    r14543 r14679  
    294294VMMR0DECL(int)      VMMR0EntryEx(PVM pVM, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION); 
    295295VMMR0DECL(int)      VMMR0CallHost(PVM pVM, VMMCALLHOST enmOperation, uint64_t uArg); 
     296VMMR0DECL(void)     VMMR0LogFlushDisable(PVMCPU pVCpu); 
     297VMMR0DECL(void)     VMMR0LogFlushEnable(PVMCPU pVCpu); 
    296298 
    297299/** @} */ 
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r14654 r14679  
    19021902    idCpuCheck = RTMpCpuId(); 
    19031903#endif 
     1904#ifdef LOG_LOGGING 
     1905    VMMR0LogFlushDisable(pVCpu); 
     1906#endif 
    19041907    /* Save the host state first. */ 
    19051908    rc  = VMXR0SaveHostState(pVM, pVCpu); 
     
    19901993 
    19911994    /* Note! NOW IT'S SAFE FOR LOGGING! */ 
     1995#ifdef LOG_LOGGING 
     1996    VMMR0LogFlushEnable(pVCpu); 
     1997#endif 
    19921998    Log2(("Raw exit reason %08x\n", exitReason)); 
    19931999 
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r14671 r14679  
    10241024    if (    !VALID_PTR(pR0Logger) 
    10251025        ||  !VALID_PTR(pR0Logger + 1) 
    1026         ||  !VALID_PTR(pLogger) 
    10271026        ||  pLogger->u32Magic != RTLOGGER_MAGIC) 
    10281027    { 
     
    10321031        return; 
    10331032    } 
     1033    if (pR0Logger->fFlushingDisabled) 
     1034        return; /* quietly */ 
    10341035 
    10351036    PVM pVM = pR0Logger->pVM; 
     
    10551056        SUPR0Printf("vmmR0LoggerFlush: Jump buffer isn't armed!\n"); 
    10561057#endif 
    1057         pLogger->offScratch = 0; 
    10581058        return; 
    10591059    } 
     
    10631063 
    10641064/** 
     1065 * Disables flushing of the ring-0 debug log. 
     1066 * 
     1067 * @param   pVCpu       The shared virtual cpu structure. 
     1068 */ 
     1069VMMR0DECL(void) VMMR0LogFlushDisable(PVMCPU pVCpu) 
     1070{ 
     1071    PVM pVM = pVCpu->pVMR0; 
     1072    if (pVM->vmm.s.pR0LoggerR0) 
     1073        pVM->vmm.s.pR0LoggerR0->fFlushingDisabled = true; 
     1074} 
     1075 
     1076 
     1077/** 
     1078 * Enables flushing of the ring-0 debug log. 
     1079 * 
     1080 * @param   pVCpu       The shared virtual cpu structure. 
     1081 */ 
     1082VMMR0DECL(void) VMMR0LogFlushEnable(PVMCPU pVCpu) 
     1083{ 
     1084    PVM pVM = pVCpu->pVMR0; 
     1085    if (pVM->vmm.s.pR0LoggerR0) 
     1086        pVM->vmm.s.pR0LoggerR0->fFlushingDisabled = false; 
     1087} 
     1088 
     1089 
     1090/** 
    10651091 * Jump back to ring-3 if we're the EMT and the longjmp is armed. 
    10661092 * 
     
    10691095DECLEXPORT(bool) RTCALL RTAssertShouldPanic(void) 
    10701096{ 
     1097#if 0 
     1098    return true; 
     1099#else 
    10711100    PVM pVM = GVMMR0GetVMByEMT(NIL_RTNATIVETHREAD); 
    10721101    if (pVM) 
     
    10861115#else 
    10871116    return false; 
     1117#endif 
    10881118#endif 
    10891119} 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy