VirtualBox

Changeset 81569 in vbox for trunk/src/VBox/Devices/VMMDev


Ignore:
Timestamp:
Oct 29, 2019 11:26:34 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134309
Message:

VMMDev: cleanups. bugref:9218

Location:
trunk/src/VBox/Devices/VMMDev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r81514 r81569  
    242242    {
    243243        /* Filter unsupported events */
    244         uint32_t fEvents = pThis->u32HostEventFlags & pThis->CTX_SUFF(pVMMDevRAM)->V.V1_03.u32GuestEventMask;
    245 
    246         Log(("vmmdevSetIRQ: fEvents=%#010x, u32HostEventFlags=%#010x, u32GuestEventMask=%#010x.\n",
    247              fEvents, pThis->u32HostEventFlags, pThis->CTX_SUFF(pVMMDevRAM)->V.V1_03.u32GuestEventMask));
     244        uint32_t fEvents = pThis->fHostEventFlags & pThis->CTX_SUFF(pVMMDevRAM)->V.V1_03.u32GuestEventMask;
     245
     246        Log(("vmmdevSetIRQ: fEvents=%#010x, fHostEventFlags=%#010x, u32GuestEventMask=%#010x.\n",
     247             fEvents, pThis->fHostEventFlags, pThis->CTX_SUFF(pVMMDevRAM)->V.V1_03.u32GuestEventMask));
    248248
    249249        /* Move event flags to VMMDev RAM */
     
    254254        {
    255255            /* Clear host flags which will be delivered to guest. */
    256             pThis->u32HostEventFlags &= ~fEvents;
    257             Log(("vmmdevSetIRQ: u32HostEventFlags=%#010x\n", pThis->u32HostEventFlags));
     256            pThis->fHostEventFlags &= ~fEvents;
     257            Log(("vmmdevSetIRQ: fHostEventFlags=%#010x\n", pThis->fHostEventFlags));
    258258            uIRQLevel = 1;
    259259        }
     
    278278static void vmmdevMaybeSetIRQ(PVMMDEV pThis)
    279279{
    280     Log3(("vmmdevMaybeSetIRQ: u32HostEventFlags=%#010x, u32GuestFilterMask=%#010x.\n",
    281           pThis->u32HostEventFlags, pThis->u32GuestFilterMask));
    282 
    283     if (pThis->u32HostEventFlags & pThis->u32GuestFilterMask)
     280    Log3(("vmmdevMaybeSetIRQ: fHostEventFlags=%#010x, fGuestFilterMask=%#010x.\n",
     281          pThis->fHostEventFlags, pThis->fGuestFilterMask));
     282
     283    if (pThis->fHostEventFlags & pThis->fGuestFilterMask)
    284284    {
    285285        /*
     
    313313        if (pThis->fu32AdditionsOk)
    314314        {
    315             const bool fHadEvents = (pThis->u32HostEventFlags & pThis->u32GuestFilterMask) != 0;
    316 
    317             Log3(("vmmdevNotifyGuestWorker: fHadEvents=%d, u32HostEventFlags=%#010x, u32GuestFilterMask=%#010x.\n",
    318                   fHadEvents, pThis->u32HostEventFlags, pThis->u32GuestFilterMask));
    319 
    320             pThis->u32HostEventFlags |= fAddEvents;
     315            const bool fHadEvents = (pThis->fHostEventFlags & pThis->fGuestFilterMask) != 0;
     316
     317            Log3(("vmmdevNotifyGuestWorker: fHadEvents=%d, fHostEventFlags=%#010x, fGuestFilterMask=%#010x.\n",
     318                  fHadEvents, pThis->fHostEventFlags, pThis->fGuestFilterMask));
     319
     320            pThis->fHostEventFlags |= fAddEvents;
    321321
    322322            if (!fHadEvents)
     
    325325        else
    326326        {
    327             pThis->u32HostEventFlags |= fAddEvents;
     327            pThis->fHostEventFlags |= fAddEvents;
    328328            Log(("vmmdevNotifyGuestWorker: IRQ is not generated, guest has not yet reported to us.\n"));
    329329        }
     
    333333        Log3(("vmmdevNotifyGuestWorker: Old additions detected.\n"));
    334334
    335         pThis->u32HostEventFlags |= fAddEvents;
     335        pThis->fHostEventFlags |= fAddEvents;
    336336        vmmdevSetIRQ_Legacy(pThis);
    337337    }
     
    396396    PDMCritSectEnter(&pThis->CritSect, VERR_IGNORED);
    397397
    398     const bool fHadEvents = (pThis->u32HostEventFlags & pThis->u32GuestFilterMask) != 0;
     398    const bool fHadEvents = (pThis->fHostEventFlags & pThis->fGuestFilterMask) != 0;
    399399
    400400    Log(("VMMDevCtlSetGuestFilterMask: fOrMask=%#010x, u32NotMask=%#010x, fHadEvents=%d.\n", fOrMask, fNotMask, fHadEvents));
    401401    if (fHadEvents)
    402402    {
    403         if (!pThis->fNewGuestFilterMask)
    404             pThis->u32NewGuestFilterMask = pThis->u32GuestFilterMask;
    405 
    406         pThis->u32NewGuestFilterMask |= fOrMask;
    407         pThis->u32NewGuestFilterMask &= ~fNotMask;
    408         pThis->fNewGuestFilterMask = true;
     403        if (!pThis->fNewGuestFilterMaskValid)
     404            pThis->fNewGuestFilterMask = pThis->fGuestFilterMask;
     405
     406        pThis->fNewGuestFilterMask |= fOrMask;
     407        pThis->fNewGuestFilterMask &= ~fNotMask;
     408        pThis->fNewGuestFilterMaskValid = true;
    409409    }
    410410    else
    411411    {
    412         pThis->u32GuestFilterMask |= fOrMask;
    413         pThis->u32GuestFilterMask &= ~fNotMask;
     412        pThis->fGuestFilterMask |= fOrMask;
     413        pThis->fGuestFilterMask &= ~fNotMask;
    414414        vmmdevMaybeSetIRQ(pThis);
    415415    }
     
    975975    const uint32_t fu32Caps = pReq->caps | VMMDEV_GUEST_SUPPORTS_GRAPHICS;
    976976
    977     if (pThis->guestCaps != fu32Caps)
     977    if (pThis->fGuestCaps != fu32Caps)
    978978    {
    979979        /* make a copy of supplied information */
    980         pThis->guestCaps = fu32Caps;
     980        pThis->fGuestCaps = fu32Caps;
    981981
    982982        LogRel(("VMMDev: Guest Additions capability report (legacy): (0x%x) seamless: %s, hostWindowMapping: %s, graphics: yes\n",
     
    10041004    AssertMsgReturn(pReq->header.size == sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER);
    10051005
    1006     uint32_t fu32Caps = pThis->guestCaps;
     1006    uint32_t fu32Caps = pThis->fGuestCaps;
    10071007    fu32Caps |= pReq->u32OrMask;
    10081008    fu32Caps &= ~pReq->u32NotMask;
    10091009
    10101010    LogRel(("VMMDev: Guest Additions capability report: (%#x -> %#x) seamless: %s, hostWindowMapping: %s, graphics: %s\n",
    1011             pThis->guestCaps, fu32Caps,
     1011            pThis->fGuestCaps, fu32Caps,
    10121012            fu32Caps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no",
    10131013            fu32Caps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no",
    10141014            fu32Caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no"));
    10151015
    1016     pThis->guestCaps = fu32Caps;
     1016    pThis->fGuestCaps = fu32Caps;
    10171017
    10181018    if (pThis->pDrv && pThis->pDrv->pfnUpdateGuestCapabilities)
     
    10351035    AssertMsgReturn(pReq->header.size == sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER);
    10361036
    1037     pReq->mouseFeatures = pThis->mouseCapabilities
     1037    pReq->mouseFeatures = pThis->fMouseCapabilities
    10381038                        & VMMDEV_MOUSE_MASK;
    1039     pReq->pointerXPos   = pThis->mouseXAbs;
    1040     pReq->pointerYPos   = pThis->mouseYAbs;
     1039    pReq->pointerXPos   = pThis->xMouseAbs;
     1040    pReq->pointerYPos   = pThis->yMouseAbs;
    10411041    LogRel2(("VMMDev: vmmdevReqHandler_GetMouseStatus: mouseFeatures=%#x, xAbs=%d, yAbs=%d\n",
    10421042             pReq->mouseFeatures, pReq->pointerXPos, pReq->pointerYPos));
     
    10611061    bool fNotify = false;
    10621062    if (   (pReq->mouseFeatures & VMMDEV_MOUSE_NOTIFY_HOST_MASK)
    1063         != (  pThis->mouseCapabilities
     1063        != (  pThis->fMouseCapabilities
    10641064            & VMMDEV_MOUSE_NOTIFY_HOST_MASK))
    10651065        fNotify = true;
    10661066
    1067     pThis->mouseCapabilities &= ~VMMDEV_MOUSE_GUEST_MASK;
    1068     pThis->mouseCapabilities |= (pReq->mouseFeatures & VMMDEV_MOUSE_GUEST_MASK);
    1069 
    1070     LogRelFlow(("VMMDev: vmmdevReqHandler_SetMouseStatus: New host capabilities: %#x\n", pThis->mouseCapabilities));
     1067    pThis->fMouseCapabilities &= ~VMMDEV_MOUSE_GUEST_MASK;
     1068    pThis->fMouseCapabilities |= (pReq->mouseFeatures & VMMDEV_MOUSE_GUEST_MASK);
     1069
     1070    LogRelFlow(("VMMDev: vmmdevReqHandler_SetMouseStatus: New host capabilities: %#x\n", pThis->fMouseCapabilities));
    10711071
    10721072    /*
     
    10761076    {
    10771077        LogRelFlow(("VMMDev: vmmdevReqHandler_SetMouseStatus: Notifying connector\n"));
    1078         pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->mouseCapabilities);
     1078        pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->fMouseCapabilities);
    10791079    }
    10801080
     
    16731673         * Note! This code is duplicated in vmmdevFastRequestIrqAck.
    16741674         */
    1675         if (pThis->fNewGuestFilterMask)
    1676         {
    1677             pThis->fNewGuestFilterMask = false;
    1678             pThis->u32GuestFilterMask = pThis->u32NewGuestFilterMask;
    1679         }
    1680 
    1681         pReq->events = pThis->u32HostEventFlags & pThis->u32GuestFilterMask;
    1682 
    1683         pThis->u32HostEventFlags &= ~pThis->u32GuestFilterMask;
     1675        if (pThis->fNewGuestFilterMaskValid)
     1676        {
     1677            pThis->fNewGuestFilterMaskValid = false;
     1678            pThis->fGuestFilterMask = pThis->fNewGuestFilterMask;
     1679        }
     1680
     1681        pReq->events = pThis->fHostEventFlags & pThis->fGuestFilterMask;
     1682
     1683        pThis->fHostEventFlags &= ~pThis->fGuestFilterMask;
    16841684        pThis->CTX_SUFF(pVMMDevRAM)->V.V1_04.fHaveEvents = false;
    16851685
     
    20672067    Log(("VMMDevReq_GetStatisticsChangeRequest\n"));
    20682068    /* just pass on the information */
    2069     Log(("VMMDev: returning statistics interval %d seconds\n", pThis->u32StatIntervalSize));
    2070     pReq->u32StatInterval = pThis->u32StatIntervalSize;
     2069    Log(("VMMDev: returning statistics interval %d seconds\n", pThis->cSecsStatInterval));
     2070    pReq->u32StatInterval = pThis->cSecsStatInterval;
    20712071
    20722072    if (pReq->eventAck == VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST)
    20732073    {
    20742074        /* Remember which mode the client has queried. */
    2075         pThis->u32LastStatIntervalSize= pThis->u32StatIntervalSize;
     2075        pThis->cSecsLastStatInterval = pThis->cSecsStatInterval;
    20762076    }
    20772077
     
    31603160                STAM_REL_COUNTER_INC(&pThis->CTX_SUFF_Z(StatFastIrqAck));
    31613161
    3162                 if (pThis->fNewGuestFilterMask)
     3162                if (pThis->fNewGuestFilterMaskValid)
    31633163                {
    3164                     pThis->fNewGuestFilterMask = false;
    3165                     pThis->u32GuestFilterMask = pThis->u32NewGuestFilterMask;
     3164                    pThis->fNewGuestFilterMaskValid = false;
     3165                    pThis->fGuestFilterMask = pThis->fNewGuestFilterMask;
    31663166                }
    31673167
    3168                 *pu32 = pThis->u32HostEventFlags & pThis->u32GuestFilterMask;
    3169 
    3170                 pThis->u32HostEventFlags &= ~pThis->u32GuestFilterMask;
     3168                *pu32 = pThis->fHostEventFlags & pThis->fGuestFilterMask;
     3169
     3170                pThis->fHostEventFlags &= ~pThis->fGuestFilterMask;
    31713171                pThis->CTX_SUFF(pVMMDevRAM)->V.V1_04.fHaveEvents = false;
    31723172
     
    33333333
    33343334        /* The readable, buffered version. */
     3335        uint32_t offMsg = RT_MIN(pThis->offMsg, sizeof(pThis->szMsg) - 1);
    33353336        if (u32 == '\n' || u32 == '\r')
    33363337        {
    3337             pThis->szMsg[pThis->iMsg] = '\0';
    3338             if (pThis->iMsg)
    3339                 LogRelIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP_DEV_VMM_BACKDOOR, ("VMMDev: Guest Log: %s\n", pThis->szMsg));
    3340             pThis->iMsg = 0;
     3338            pThis->szMsg[offMsg] = '\0';
     3339            if (offMsg)
     3340                LogRelIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP_DEV_VMM_BACKDOOR, ("VMMDev: Guest Log: %.*s\n", offMsg, pThis->szMsg));
     3341            pThis->offMsg = 0;
    33413342        }
    33423343        else
    33433344        {
    3344             if (pThis->iMsg >= sizeof(pThis->szMsg)-1)
     3345            if (offMsg >= sizeof(pThis->szMsg) - 1)
    33453346            {
    3346                 pThis->szMsg[pThis->iMsg] = '\0';
    3347                 LogRelIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP_DEV_VMM_BACKDOOR, ("VMMDev: Guest Log: %s\n", pThis->szMsg));
    3348                 pThis->iMsg = 0;
     3347                pThis->szMsg[sizeof(pThis->szMsg) - 1] = '\0';
     3348                LogRelIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP_DEV_VMM_BACKDOOR,
     3349                         ("VMMDev: Guest Log: %.*s\n", sizeof(pThis->szMsg) - 1, pThis->szMsg));
     3350                offMsg = 0;
    33493351            }
    3350             pThis->szMsg[pThis->iMsg] = (char )u32;
    3351             pThis->szMsg[++pThis->iMsg] = '\0';
     3352            pThis->szMsg[offMsg++] = (char )u32;
     3353            pThis->szMsg[offMsg]   = '\0';
     3354            pThis->offMsg = offMsg;
    33523355        }
    33533356    }
     
    33963399    {
    33973400        if (pThis->fTimesyncBackdoorLo)
    3398             *pu32 = (uint32_t)pThis->hostTime;
     3401            *pu32 = (uint32_t)pThis->msLatchedHostTime;
    33993402        else
    34003403        {
    34013404            /* Reading the high dword gets and saves the current time. */
    34023405            RTTIMESPEC Now;
    3403             pThis->hostTime = RTTimeSpecGetMilli(PDMDevHlpTMUtcNow(pDevIns, &Now));
    3404             *pu32 = (uint32_t)(pThis->hostTime >> 32);
     3406            pThis->msLatchedHostTime = RTTimeSpecGetMilli(PDMDevHlpTMUtcNow(pDevIns, &Now));
     3407            *pu32 = (uint32_t)(pThis->msLatchedHostTime >> 32);
    34053408        }
    34063409        rc = VINF_SUCCESS;
     
    34733476     * rules making sure we won't see a halfwritten value. */
    34743477    if (pxAbs)
    3475         *pxAbs = ASMAtomicReadS32(&pThis->mouseXAbs); /* why the atomic read? */
     3478        *pxAbs = ASMAtomicReadS32(&pThis->xMouseAbs); /* why the atomic read? */
    34763479    if (pyAbs)
    3477         *pyAbs = ASMAtomicReadS32(&pThis->mouseYAbs);
     3480        *pyAbs = ASMAtomicReadS32(&pThis->yMouseAbs);
    34783481
    34793482    return VINF_SUCCESS;
     
    34883491    PDMCritSectEnter(&pThis->CritSect, VERR_IGNORED);
    34893492
    3490     if (   pThis->mouseXAbs != xAbs
    3491         || pThis->mouseYAbs != yAbs)
     3493    if (   pThis->xMouseAbs != xAbs
     3494        || pThis->yMouseAbs != yAbs)
    34923495    {
    34933496        Log2(("vmmdevIPort_SetAbsoluteMouse : settings absolute position to x = %d, y = %d\n", xAbs, yAbs));
    3494         pThis->mouseXAbs = xAbs;
    3495         pThis->mouseYAbs = yAbs;
     3497        pThis->xMouseAbs = xAbs;
     3498        pThis->yMouseAbs = yAbs;
    34963499        VMMDevNotifyGuest(pThis, VMMDEV_EVENT_MOUSE_POSITION_CHANGED);
    34973500    }
     
    35093512    AssertPtrReturn(pfCapabilities, VERR_INVALID_PARAMETER);
    35103513
    3511     *pfCapabilities = pThis->mouseCapabilities;
     3514    *pfCapabilities = pThis->fMouseCapabilities;
    35123515    return VINF_SUCCESS;
    35133516}
     
    35223525    PDMCritSectEnter(&pThis->CritSect, VERR_IGNORED);
    35233526
    3524     uint32_t fOldCaps = pThis->mouseCapabilities;
    3525     pThis->mouseCapabilities &= ~(fCapsRemoved & VMMDEV_MOUSE_HOST_MASK);
    3526     pThis->mouseCapabilities |= (fCapsAdded & VMMDEV_MOUSE_HOST_MASK)
     3527    uint32_t fOldCaps = pThis->fMouseCapabilities;
     3528    pThis->fMouseCapabilities &= ~(fCapsRemoved & VMMDEV_MOUSE_HOST_MASK);
     3529    pThis->fMouseCapabilities |= (fCapsAdded & VMMDEV_MOUSE_HOST_MASK)
    35273530                              | VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR;
    3528     bool fNotify = fOldCaps != pThis->mouseCapabilities;
     3531    bool fNotify = fOldCaps != pThis->fMouseCapabilities;
    35293532
    35303533    LogRelFlow(("VMMDev: vmmdevIPort_UpdateMouseCapabilities: fCapsAdded=0x%x, fCapsRemoved=0x%x, fNotify=%RTbool\n", fCapsAdded,
     
    37193722
    37203723    /* Verify that the new resolution is different and that guest does not yet know about it. */
    3721     bool fSame = (pThis->u32LastStatIntervalSize == cSecsStatInterval);
    3722 
    3723     Log(("vmmdevIPort_SetStatisticsInterval: old=%d. new=%d\n", pThis->u32LastStatIntervalSize, cSecsStatInterval));
     3724    bool fSame = (pThis->cSecsLastStatInterval == cSecsStatInterval);
     3725
     3726    Log(("vmmdevIPort_SetStatisticsInterval: old=%d. new=%d\n", pThis->cSecsLastStatInterval, cSecsStatInterval));
    37243727
    37253728    if (!fSame)
    37263729    {
    37273730        /* we could validate the information here but hey, the guest can do that as well! */
    3728         pThis->u32StatIntervalSize = cSecsStatInterval;
     3731        pThis->cSecsStatInterval = cSecsStatInterval;
    37293732
    37303733        /* IRQ so the guest knows what's going on */
     
    38843887    vmmdevLiveExec(pDevIns, pSSM, SSM_PASS_FINAL);
    38853888
    3886     SSMR3PutU32(pSSM, pThis->hypervisorSize);
    3887     SSMR3PutU32(pSSM, pThis->mouseCapabilities);
    3888     SSMR3PutS32(pSSM, pThis->mouseXAbs);
    3889     SSMR3PutS32(pSSM, pThis->mouseYAbs);
    3890 
    3891     SSMR3PutBool(pSSM, pThis->fNewGuestFilterMask);
    3892     SSMR3PutU32(pSSM, pThis->u32NewGuestFilterMask);
    3893     SSMR3PutU32(pSSM, pThis->u32GuestFilterMask);
    3894     SSMR3PutU32(pSSM, pThis->u32HostEventFlags);
     3889    SSMR3PutU32(pSSM, 0 /*was pThis->hypervisorSize, which was always zero*/);
     3890    SSMR3PutU32(pSSM, pThis->fMouseCapabilities);
     3891    SSMR3PutS32(pSSM, pThis->xMouseAbs);
     3892    SSMR3PutS32(pSSM, pThis->yMouseAbs);
     3893
     3894    SSMR3PutBool(pSSM, pThis->fNewGuestFilterMaskValid);
     3895    SSMR3PutU32(pSSM, pThis->fNewGuestFilterMask);
     3896    SSMR3PutU32(pSSM, pThis->fGuestFilterMask);
     3897    SSMR3PutU32(pSSM, pThis->fHostEventFlags);
    38953898    /* The following is not strictly necessary as PGM restores MMIO2, keeping it for historical reasons. */
    38963899    SSMR3PutMem(pSSM, &pThis->pVMMDevRAMR3->V, sizeof(pThis->pVMMDevRAMR3->V));
     
    39013904    SSMR3PutBool(pSSM, pThis->displayChangeData.fGuestSentChangeEventAck);
    39023905
    3903     SSMR3PutU32(pSSM, pThis->guestCaps);
     3906    SSMR3PutU32(pSSM, pThis->fGuestCaps);
    39043907
    39053908#ifdef VBOX_WITH_HGCM
     
    39723975
    39733976    /* state */
    3974     SSMR3GetU32(pSSM, &pThis->hypervisorSize);
    3975     SSMR3GetU32(pSSM, &pThis->mouseCapabilities);
    3976     SSMR3GetS32(pSSM, &pThis->mouseXAbs);
    3977     SSMR3GetS32(pSSM, &pThis->mouseYAbs);
    3978 
    3979     SSMR3GetBool(pSSM, &pThis->fNewGuestFilterMask);
    3980     SSMR3GetU32(pSSM, &pThis->u32NewGuestFilterMask);
    3981     SSMR3GetU32(pSSM, &pThis->u32GuestFilterMask);
    3982     SSMR3GetU32(pSSM, &pThis->u32HostEventFlags);
     3977    uint32_t uIgn;
     3978    SSMR3GetU32(pSSM, &uIgn);
     3979    SSMR3GetU32(pSSM, &pThis->fMouseCapabilities);
     3980    SSMR3GetS32(pSSM, &pThis->xMouseAbs);
     3981    SSMR3GetS32(pSSM, &pThis->yMouseAbs);
     3982
     3983    SSMR3GetBool(pSSM, &pThis->fNewGuestFilterMaskValid);
     3984    SSMR3GetU32(pSSM, &pThis->fNewGuestFilterMask);
     3985    SSMR3GetU32(pSSM, &pThis->fGuestFilterMask);
     3986    SSMR3GetU32(pSSM, &pThis->fHostEventFlags);
    39833987
    39843988    //SSMR3GetBool(pSSM, &pThis->pVMMDevRAMR3->fHaveEvents);
     
    39923996        SSMR3GetBool(pSSM, &pThis->displayChangeData.fGuestSentChangeEventAck);
    39933997
    3994     rc = SSMR3GetU32(pSSM, &pThis->guestCaps);
     3998    rc = SSMR3GetU32(pSSM, &pThis->fGuestCaps);
    39953999
    39964000    /* Attributes which were temporarily introduced in r30072 */
     
    40684072     * that listeners can sync their state again
    40694073     */
    4070     Log(("vmmdevLoadState: capabilities changed (%x), informing connector\n", pThis->mouseCapabilities));
     4074    Log(("vmmdevLoadState: capabilities changed (%x), informing connector\n", pThis->fMouseCapabilities));
    40714075    if (pThis->pDrv)
    40724076    {
    4073         pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->mouseCapabilities);
     4077        pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->fMouseCapabilities);
    40744078        if (uVersion >= 10)
    40754079            pThis->pDrv->pfnUpdatePointerShape(pThis->pDrv,
     
    41064110    }
    41074111    if (pThis->pDrv && pThis->pDrv->pfnUpdateGuestCapabilities)
    4108         pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->guestCaps);
     4112        pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->fGuestCaps);
    41094113
    41104114    return VINF_SUCCESS;
     
    41674171     * Reset the mouse integration feature bits
    41684172     */
    4169     if (pThis->mouseCapabilities & VMMDEV_MOUSE_GUEST_MASK)
    4170     {
    4171         pThis->mouseCapabilities &= ~VMMDEV_MOUSE_GUEST_MASK;
     4173    if (pThis->fMouseCapabilities & VMMDEV_MOUSE_GUEST_MASK)
     4174    {
     4175        pThis->fMouseCapabilities &= ~VMMDEV_MOUSE_GUEST_MASK;
    41724176        /* notify the connector */
    4173         Log(("vmmdevReset: capabilities changed (%x), informing connector\n", pThis->mouseCapabilities));
    4174         pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->mouseCapabilities);
     4177        Log(("vmmdevReset: capabilities changed (%x), informing connector\n", pThis->fMouseCapabilities));
     4178        pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->fMouseCapabilities);
    41754179    }
    41764180    pThis->fHostCursorRequested = false;
    4177 
    4178     pThis->hypervisorSize = 0;
    41794181
    41804182    /* re-initialize the VMMDev memory */
     
    42034205    memset (&pThis->guestInfo, 0, sizeof (pThis->guestInfo));
    42044206    RT_ZERO(pThis->guestInfo2);
    4205     const bool fCapsChanged = pThis->guestCaps != 0; /* Report transition to 0. */
    4206     pThis->guestCaps = 0;
     4207    const bool fCapsChanged = pThis->fGuestCaps != 0; /* Report transition to 0. */
     4208    pThis->fGuestCaps = 0;
    42074209
    42084210    /* Clear facilities. No need to tell Main as it will get a
     
    42334235
    42344236    /* disabled statistics updating */
    4235     pThis->u32LastStatIntervalSize = 0;
     4237    pThis->cSecsLastStatInterval = 0;
    42364238
    42374239#ifdef VBOX_WITH_HGCM
     
    42534255     * Clear the event variables.
    42544256     *
    4255      * XXX By design we should NOT clear pThis->u32HostEventFlags because it is designed
     4257     * XXX By design we should NOT clear pThis->fHostEventFlags because it is designed
    42564258     *     that way so host events do not depend on guest resets. However, the pending
    42574259     *     event flags actually _were_ cleared since ages so we mask out events from
    42584260     *     clearing which we really need to survive the reset. See xtracker 5767.
    42594261     */
    4260     pThis->u32HostEventFlags    &= VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST;
    4261     pThis->u32GuestFilterMask    = 0;
    4262     pThis->u32NewGuestFilterMask = 0;
    4263     pThis->fNewGuestFilterMask   = 0;
     4262    pThis->fHostEventFlags    &= VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST;
     4263    pThis->fGuestFilterMask    = 0;
     4264    pThis->fNewGuestFilterMask = 0;
     4265    pThis->fNewGuestFilterMaskValid   = 0;
    42644266
    42654267    /*
     
    42694271        pThis->pDrv->pfnUpdateGuestInfo(pThis->pDrv, &pThis->guestInfo);
    42704272    if (fCapsChanged && pThis->pDrv && pThis->pDrv->pfnUpdateGuestCapabilities)
    4271         pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->guestCaps);
     4273        pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->fGuestCaps);
    42724274
    42734275    /*
     
    47044706     * changes.
    47054707     */
    4706     pThis->mouseCapabilities |= VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR;
     4708    pThis->fMouseCapabilities |= VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR;
    47074709
    47084710    /*
  • trunk/src/VBox/Devices/VMMDev/VMMDevState.h

    r81031 r81569  
    127127    PDMCRITSECT         CritSect;
    128128
    129     /** hypervisor address space size */
    130     uint32_t hypervisorSize;
    131 
    132129    /** mouse capabilities of host and guest */
    133     uint32_t mouseCapabilities;
    134     /** absolute mouse position in pixels */
    135     int32_t mouseXAbs;
    136     int32_t mouseYAbs;
     130    uint32_t            fMouseCapabilities;
     131    /** @name Absolute mouse position in pixels
     132     * @{ */
     133    int32_t             xMouseAbs;
     134    int32_t             yMouseAbs;
     135    /** @} */
    137136    /** Does the guest currently want the host pointer to be shown? */
    138     uint32_t fHostCursorRequested;
    139 
    140 #ifdef VBOX_WITH_RAW_MODE_KEEP
    141     /** Pointer to device instance - RC pointer. */
    142     PPDMDEVINSRC pDevInsRC;
    143 #else
    144     uint32_t u32Alignment0;
    145 #endif
     137    uint32_t            fHostCursorRequested;
     138
    146139    /** Pointer to device instance - R3 poitner. */
    147     PPDMDEVINSR3 pDevInsR3;
     140    PPDMDEVINSR3        pDevInsR3;
    148141    /** Pointer to device instance - R0 pointer. */
    149     PPDMDEVINSR0 pDevInsR0;
     142    PPDMDEVINSR0        pDevInsR0;
    150143
    151144    /** LUN\#0 + Status: VMMDev port base interface. */
    152     PDMIBASE IBase;
     145    PDMIBASE            IBase;
    153146    /** LUN\#0: VMMDev port interface. */
    154     PDMIVMMDEVPORT IPort;
     147    PDMIVMMDEVPORT      IPort;
    155148#ifdef VBOX_WITH_HGCM
    156149    /** LUN\#0: HGCM port interface. */
    157     PDMIHGCMPORT IHGCMPort;
     150    PDMIHGCMPORT        IHGCMPort;
    158151//# if HC_ARCH_BITS == 32
    159152//    RTR3PTR      R3PtrAlignment1;
     
    169162#endif
    170163    /** message buffer for backdoor logging. */
    171     char szMsg[512];
     164    char                szMsg[512];
    172165    /** message buffer index. */
    173     uint32_t iMsg;
     166    uint32_t            offMsg;
    174167    /** Alignment padding. */
    175     uint32_t u32Alignment2;
     168    uint32_t            u32Alignment2;
    176169
    177170    /** Statistics counter for slow IRQ ACK. */
    178     STAMCOUNTER StatSlowIrqAck;
     171    STAMCOUNTER         StatSlowIrqAck;
    179172    /** Statistics counter for fast IRQ ACK - R3. */
    180     STAMCOUNTER StatFastIrqAckR3;
     173    STAMCOUNTER         StatFastIrqAckR3;
    181174    /** Statistics counter for fast IRQ ACK - R0 / RC. */
    182     STAMCOUNTER StatFastIrqAckRZ;
    183     /** IRQ number assigned to the device */
    184     uint32_t irq;
    185     /** Current host side event flags */
    186     uint32_t u32HostEventFlags;
    187     /** Mask of events guest is interested in.
     175    STAMCOUNTER         StatFastIrqAckRZ;
     176    /** Current host side event flags - VMMDEV_EVENT_XXX. */
     177    uint32_t            fHostEventFlags;
     178    /** Mask of events guest is interested in - VMMDEV_EVENT_XXX.
    188179     * @note The HGCM events are enabled automatically by the VMMDev device when
    189180     *       guest issues HGCM commands. */
    190     uint32_t u32GuestFilterMask;
    191     /** Delayed mask of guest events */
    192     uint32_t u32NewGuestFilterMask;
    193     /** Flag whether u32NewGuestFilterMask is valid */
    194     bool fNewGuestFilterMask;
     181    uint32_t            fGuestFilterMask;
     182    /** Delayed mask of guest events - VMMDEV_EVENT_XXX. */
     183    uint32_t            fNewGuestFilterMask;
     184    /** Flag whether fNewGuestFilterMask is valid */
     185    bool                fNewGuestFilterMaskValid;
    195186    /** Alignment padding. */
    196     bool afAlignment3[3];
     187    bool                afAlignment3[7];
    197188
    198189    /** GC physical address of VMMDev RAM area */
     
    211202    R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3;
    212203    /** GC physical address of VMMDev Heap RAM area */
    213     RTGCPHYS32 GCPhysVMMDevHeap;
     204    RTGCPHYS32          GCPhysVMMDevHeap;
    214205
    215206    /** Information reported by guest via VMMDevReportGuestInfo generic request.
    216207     * Until this information is reported the VMMDev refuses any other requests.
    217208     */
    218     VBoxGuestInfo guestInfo;
     209    VBoxGuestInfo       guestInfo;
    219210    /** Information report \#2, chewed a little. */
    220211    struct
    221212    {
    222         uint32_t uFullVersion; /**< non-zero if info is present. */
    223         uint32_t uRevision;
    224         uint32_t fFeatures;
    225         char     szName[128];
    226     } guestInfo2;
     213        uint32_t            uFullVersion; /**< non-zero if info is present. */
     214        uint32_t            uRevision;
     215        uint32_t            fFeatures;
     216        char                szName[128];
     217    }                   guestInfo2;
    227218
    228219    /** Array of guest facility statuses. */
    229     VMMDEVFACILITYSTATUSENTRY   aFacilityStatuses[32];
     220    VMMDEVFACILITYSTATUSENTRY aFacilityStatuses[32];
    230221    /** The number of valid entries in the facility status array. */
    231     uint32_t                    cFacilityStatuses;
    232 
    233     /** Information reported by guest via VMMDevReportGuestCapabilities. */
    234     uint32_t      guestCaps;
     222    uint32_t            cFacilityStatuses;
     223
     224    /** Information reported by guest via VMMDevReportGuestCapabilities - VMMDEV_GUEST_SUPPORTS_XXX. */
     225    uint32_t            fGuestCaps;
    235226
    236227    /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo,
     
    238229     * of the version in guestInfo.
    239230     */
    240     uint32_t fu32AdditionsOk;
     231    uint32_t            fu32AdditionsOk;
    241232
    242233    /** Video acceleration status set by guest. */
    243     uint32_t u32VideoAccelEnabled;
    244 
    245     DISPLAYCHANGEDATA displayChangeData;
     234    uint32_t            u32VideoAccelEnabled;
     235
     236    DISPLAYCHANGEDATA   displayChangeData;
    246237
    247238    /** Pointer to the credentials. */
     
    249240
    250241#if HC_ARCH_BITS == 32
    251     uint32_t uAlignment4;
    252 #endif
    253 
    254     /* memory balloon change request */
    255     uint32_t    cMbMemoryBalloon;
     242    uint32_t            uAlignment4;
     243#endif
     244
     245    /** memory balloon change request */
     246    uint32_t            cMbMemoryBalloon;
    256247    /** The last balloon size queried by the guest additions. */
    257     uint32_t    cMbMemoryBalloonLast;
    258 
    259     /* guest ram size */
    260     uint64_t    cbGuestRAM;
    261 
    262     /* unique session id; the id will be different after each start, reset or restore of the VM. */
    263     uint64_t    idSession;
    264 
    265     /* statistics interval change request */
    266     uint32_t    u32StatIntervalSize, u32LastStatIntervalSize;
    267 
    268     /* seamless mode change request */
    269     bool fLastSeamlessEnabled, fSeamlessEnabled;
    270     bool afAlignment5[1];
    271 
    272     bool fVRDPEnabled;
    273     uint32_t uVRDPExperienceLevel;
     248    uint32_t            cMbMemoryBalloonLast;
     249
     250    /** guest ram size */
     251    uint64_t            cbGuestRAM;
     252
     253    /** unique session id; the id will be different after each start, reset or restore of the VM. */
     254    uint64_t            idSession;
     255
     256    /** Statistics interval in seconds.  */
     257    uint32_t            cSecsStatInterval;
     258    /** The statistics interval last returned to the guest. */
     259    uint32_t            cSecsLastStatInterval;
     260
     261    /** Whether seamless is enabled or not. */
     262    bool                fSeamlessEnabled;
     263    /** The last fSeamlessEnabled state returned to the guest. */
     264    bool                fLastSeamlessEnabled;
     265    bool                afAlignment5[1];
     266
     267    bool                fVRDPEnabled;
     268    uint32_t            uVRDPExperienceLevel;
    274269
    275270#ifdef VMMDEV_WITH_ALT_TIMESYNC
    276     uint64_t hostTime;
    277     bool fTimesyncBackdoorLo;
    278     bool afAlignment6[2];
     271    uint64_t            msLatchedHostTime;
     272    bool                fTimesyncBackdoorLo;
     273    bool                afAlignment6[2];
    279274#else
    280     bool afAlignment6[1+2];
    281 #endif
     275    bool                afAlignment6[1+2];
     276#endif
     277
    282278    /** Set if GetHostTime should fail.
    283279     * Loaded from the GetHostTimeDisabled configuration value. */
    284     bool fGetHostTimeDisabled;
    285 
     280    bool                fGetHostTimeDisabled;
    286281    /** Set if backdoor logging should be disabled (output will be ignored then) */
    287     bool fBackdoorLogDisabled;
    288 
     282    bool                fBackdoorLogDisabled;
    289283    /** Don't clear credentials */
    290     bool fKeepCredentials;
    291 
     284    bool                fKeepCredentials;
    292285    /** Heap enabled. */
    293     bool fHeapEnabled;
     286    bool                fHeapEnabled;
    294287
    295288    /** Guest Core Dumping enabled. */
    296     bool fGuestCoreDumpEnabled;
    297 
     289    bool                fGuestCoreDumpEnabled;
    298290    /** Guest Core Dump location. */
    299     char szGuestCoreDumpDir[RTPATH_MAX];
    300 
     291    char                szGuestCoreDumpDir[RTPATH_MAX];
    301292    /** Number of additional cores to keep around. */
    302     uint32_t cGuestCoreDumps;
     293    uint32_t            cGuestCoreDumps;
    303294
    304295#ifdef VBOX_WITH_HGCM
    305296    /** List of pending HGCM requests (VBOXHGCMCMD). */
    306     RTLISTANCHORR3 listHGCMCmd;
     297    RTLISTANCHORR3      listHGCMCmd;
    307298    /** Critical section to protect the list. */
    308     RTCRITSECT critsectHGCMCmdList;
     299    RTCRITSECT          critsectHGCMCmdList;
    309300    /** Whether the HGCM events are already automatically enabled. */
    310     uint32_t u32HGCMEnabled;
     301    uint32_t            u32HGCMEnabled;
    311302    /** Saved state version of restored commands. */
    312     uint32_t u32SSMVersion;
    313     RTMEMCACHE  hHgcmCmdCache;
    314     STAMPROFILE StatHgcmCmdArrival;
    315     STAMPROFILE StatHgcmCmdCompletion;
    316     STAMPROFILE StatHgcmCmdTotal;
    317     STAMCOUNTER StatHgcmLargeCmdAllocs;
    318     STAMCOUNTER StatHgcmFailedPageListLocking;
     303    uint32_t            u32SSMVersion;
     304    RTMEMCACHE          hHgcmCmdCache;
     305    STAMPROFILE         StatHgcmCmdArrival;
     306    STAMPROFILE         StatHgcmCmdCompletion;
     307    STAMPROFILE         StatHgcmCmdTotal;
     308    STAMCOUNTER         StatHgcmLargeCmdAllocs;
     309    STAMCOUNTER         StatHgcmFailedPageListLocking;
    319310#endif /* VBOX_WITH_HGCM */
    320     STAMCOUNTER StatReqBufAllocs;
     311    STAMCOUNTER         StatReqBufAllocs;
    321312
    322313    /** Per CPU request 4K sized buffers, allocated as needed. */
Note: See TracChangeset for help on using the changeset viewer.

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