Changeset 81569 in vbox for trunk/src/VBox/Devices/VMMDev
- Timestamp:
- Oct 29, 2019 11:26:34 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 134309
- Location:
- trunk/src/VBox/Devices/VMMDev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r81514 r81569 242 242 { 243 243 /* 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)); 248 248 249 249 /* Move event flags to VMMDev RAM */ … … 254 254 { 255 255 /* 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)); 258 258 uIRQLevel = 1; 259 259 } … … 278 278 static void vmmdevMaybeSetIRQ(PVMMDEV pThis) 279 279 { 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) 284 284 { 285 285 /* … … 313 313 if (pThis->fu32AdditionsOk) 314 314 { 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; 321 321 322 322 if (!fHadEvents) … … 325 325 else 326 326 { 327 pThis-> u32HostEventFlags |= fAddEvents;327 pThis->fHostEventFlags |= fAddEvents; 328 328 Log(("vmmdevNotifyGuestWorker: IRQ is not generated, guest has not yet reported to us.\n")); 329 329 } … … 333 333 Log3(("vmmdevNotifyGuestWorker: Old additions detected.\n")); 334 334 335 pThis-> u32HostEventFlags |= fAddEvents;335 pThis->fHostEventFlags |= fAddEvents; 336 336 vmmdevSetIRQ_Legacy(pThis); 337 337 } … … 396 396 PDMCritSectEnter(&pThis->CritSect, VERR_IGNORED); 397 397 398 const bool fHadEvents = (pThis-> u32HostEventFlags & pThis->u32GuestFilterMask) != 0;398 const bool fHadEvents = (pThis->fHostEventFlags & pThis->fGuestFilterMask) != 0; 399 399 400 400 Log(("VMMDevCtlSetGuestFilterMask: fOrMask=%#010x, u32NotMask=%#010x, fHadEvents=%d.\n", fOrMask, fNotMask, fHadEvents)); 401 401 if (fHadEvents) 402 402 { 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; 409 409 } 410 410 else 411 411 { 412 pThis-> u32GuestFilterMask |= fOrMask;413 pThis-> u32GuestFilterMask &= ~fNotMask;412 pThis->fGuestFilterMask |= fOrMask; 413 pThis->fGuestFilterMask &= ~fNotMask; 414 414 vmmdevMaybeSetIRQ(pThis); 415 415 } … … 975 975 const uint32_t fu32Caps = pReq->caps | VMMDEV_GUEST_SUPPORTS_GRAPHICS; 976 976 977 if (pThis-> guestCaps != fu32Caps)977 if (pThis->fGuestCaps != fu32Caps) 978 978 { 979 979 /* make a copy of supplied information */ 980 pThis-> guestCaps = fu32Caps;980 pThis->fGuestCaps = fu32Caps; 981 981 982 982 LogRel(("VMMDev: Guest Additions capability report (legacy): (0x%x) seamless: %s, hostWindowMapping: %s, graphics: yes\n", … … 1004 1004 AssertMsgReturn(pReq->header.size == sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER); 1005 1005 1006 uint32_t fu32Caps = pThis-> guestCaps;1006 uint32_t fu32Caps = pThis->fGuestCaps; 1007 1007 fu32Caps |= pReq->u32OrMask; 1008 1008 fu32Caps &= ~pReq->u32NotMask; 1009 1009 1010 1010 LogRel(("VMMDev: Guest Additions capability report: (%#x -> %#x) seamless: %s, hostWindowMapping: %s, graphics: %s\n", 1011 pThis-> guestCaps, fu32Caps,1011 pThis->fGuestCaps, fu32Caps, 1012 1012 fu32Caps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no", 1013 1013 fu32Caps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no", 1014 1014 fu32Caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no")); 1015 1015 1016 pThis-> guestCaps = fu32Caps;1016 pThis->fGuestCaps = fu32Caps; 1017 1017 1018 1018 if (pThis->pDrv && pThis->pDrv->pfnUpdateGuestCapabilities) … … 1035 1035 AssertMsgReturn(pReq->header.size == sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER); 1036 1036 1037 pReq->mouseFeatures = pThis-> mouseCapabilities1037 pReq->mouseFeatures = pThis->fMouseCapabilities 1038 1038 & VMMDEV_MOUSE_MASK; 1039 pReq->pointerXPos = pThis-> mouseXAbs;1040 pReq->pointerYPos = pThis-> mouseYAbs;1039 pReq->pointerXPos = pThis->xMouseAbs; 1040 pReq->pointerYPos = pThis->yMouseAbs; 1041 1041 LogRel2(("VMMDev: vmmdevReqHandler_GetMouseStatus: mouseFeatures=%#x, xAbs=%d, yAbs=%d\n", 1042 1042 pReq->mouseFeatures, pReq->pointerXPos, pReq->pointerYPos)); … … 1061 1061 bool fNotify = false; 1062 1062 if ( (pReq->mouseFeatures & VMMDEV_MOUSE_NOTIFY_HOST_MASK) 1063 != ( pThis-> mouseCapabilities1063 != ( pThis->fMouseCapabilities 1064 1064 & VMMDEV_MOUSE_NOTIFY_HOST_MASK)) 1065 1065 fNotify = true; 1066 1066 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)); 1071 1071 1072 1072 /* … … 1076 1076 { 1077 1077 LogRelFlow(("VMMDev: vmmdevReqHandler_SetMouseStatus: Notifying connector\n")); 1078 pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis-> mouseCapabilities);1078 pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->fMouseCapabilities); 1079 1079 } 1080 1080 … … 1673 1673 * Note! This code is duplicated in vmmdevFastRequestIrqAck. 1674 1674 */ 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; 1684 1684 pThis->CTX_SUFF(pVMMDevRAM)->V.V1_04.fHaveEvents = false; 1685 1685 … … 2067 2067 Log(("VMMDevReq_GetStatisticsChangeRequest\n")); 2068 2068 /* 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; 2071 2071 2072 2072 if (pReq->eventAck == VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST) 2073 2073 { 2074 2074 /* Remember which mode the client has queried. */ 2075 pThis-> u32LastStatIntervalSize= pThis->u32StatIntervalSize;2075 pThis->cSecsLastStatInterval = pThis->cSecsStatInterval; 2076 2076 } 2077 2077 … … 3160 3160 STAM_REL_COUNTER_INC(&pThis->CTX_SUFF_Z(StatFastIrqAck)); 3161 3161 3162 if (pThis->fNewGuestFilterMask )3162 if (pThis->fNewGuestFilterMaskValid) 3163 3163 { 3164 pThis->fNewGuestFilterMask = false;3165 pThis-> u32GuestFilterMask = pThis->u32NewGuestFilterMask;3164 pThis->fNewGuestFilterMaskValid = false; 3165 pThis->fGuestFilterMask = pThis->fNewGuestFilterMask; 3166 3166 } 3167 3167 3168 *pu32 = pThis-> u32HostEventFlags & pThis->u32GuestFilterMask;3169 3170 pThis-> u32HostEventFlags &= ~pThis->u32GuestFilterMask;3168 *pu32 = pThis->fHostEventFlags & pThis->fGuestFilterMask; 3169 3170 pThis->fHostEventFlags &= ~pThis->fGuestFilterMask; 3171 3171 pThis->CTX_SUFF(pVMMDevRAM)->V.V1_04.fHaveEvents = false; 3172 3172 … … 3333 3333 3334 3334 /* The readable, buffered version. */ 3335 uint32_t offMsg = RT_MIN(pThis->offMsg, sizeof(pThis->szMsg) - 1); 3335 3336 if (u32 == '\n' || u32 == '\r') 3336 3337 { 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; 3341 3342 } 3342 3343 else 3343 3344 { 3344 if ( pThis->iMsg >= sizeof(pThis->szMsg)-1)3345 if (offMsg >= sizeof(pThis->szMsg) - 1) 3345 3346 { 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; 3349 3351 } 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; 3352 3355 } 3353 3356 } … … 3396 3399 { 3397 3400 if (pThis->fTimesyncBackdoorLo) 3398 *pu32 = (uint32_t)pThis-> hostTime;3401 *pu32 = (uint32_t)pThis->msLatchedHostTime; 3399 3402 else 3400 3403 { 3401 3404 /* Reading the high dword gets and saves the current time. */ 3402 3405 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); 3405 3408 } 3406 3409 rc = VINF_SUCCESS; … … 3473 3476 * rules making sure we won't see a halfwritten value. */ 3474 3477 if (pxAbs) 3475 *pxAbs = ASMAtomicReadS32(&pThis-> mouseXAbs); /* why the atomic read? */3478 *pxAbs = ASMAtomicReadS32(&pThis->xMouseAbs); /* why the atomic read? */ 3476 3479 if (pyAbs) 3477 *pyAbs = ASMAtomicReadS32(&pThis-> mouseYAbs);3480 *pyAbs = ASMAtomicReadS32(&pThis->yMouseAbs); 3478 3481 3479 3482 return VINF_SUCCESS; … … 3488 3491 PDMCritSectEnter(&pThis->CritSect, VERR_IGNORED); 3489 3492 3490 if ( pThis-> mouseXAbs != xAbs3491 || pThis-> mouseYAbs != yAbs)3493 if ( pThis->xMouseAbs != xAbs 3494 || pThis->yMouseAbs != yAbs) 3492 3495 { 3493 3496 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; 3496 3499 VMMDevNotifyGuest(pThis, VMMDEV_EVENT_MOUSE_POSITION_CHANGED); 3497 3500 } … … 3509 3512 AssertPtrReturn(pfCapabilities, VERR_INVALID_PARAMETER); 3510 3513 3511 *pfCapabilities = pThis-> mouseCapabilities;3514 *pfCapabilities = pThis->fMouseCapabilities; 3512 3515 return VINF_SUCCESS; 3513 3516 } … … 3522 3525 PDMCritSectEnter(&pThis->CritSect, VERR_IGNORED); 3523 3526 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) 3527 3530 | VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR; 3528 bool fNotify = fOldCaps != pThis-> mouseCapabilities;3531 bool fNotify = fOldCaps != pThis->fMouseCapabilities; 3529 3532 3530 3533 LogRelFlow(("VMMDev: vmmdevIPort_UpdateMouseCapabilities: fCapsAdded=0x%x, fCapsRemoved=0x%x, fNotify=%RTbool\n", fCapsAdded, … … 3719 3722 3720 3723 /* 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)); 3724 3727 3725 3728 if (!fSame) 3726 3729 { 3727 3730 /* we could validate the information here but hey, the guest can do that as well! */ 3728 pThis-> u32StatIntervalSize= cSecsStatInterval;3731 pThis->cSecsStatInterval = cSecsStatInterval; 3729 3732 3730 3733 /* IRQ so the guest knows what's going on */ … … 3884 3887 vmmdevLiveExec(pDevIns, pSSM, SSM_PASS_FINAL); 3885 3888 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); 3895 3898 /* The following is not strictly necessary as PGM restores MMIO2, keeping it for historical reasons. */ 3896 3899 SSMR3PutMem(pSSM, &pThis->pVMMDevRAMR3->V, sizeof(pThis->pVMMDevRAMR3->V)); … … 3901 3904 SSMR3PutBool(pSSM, pThis->displayChangeData.fGuestSentChangeEventAck); 3902 3905 3903 SSMR3PutU32(pSSM, pThis-> guestCaps);3906 SSMR3PutU32(pSSM, pThis->fGuestCaps); 3904 3907 3905 3908 #ifdef VBOX_WITH_HGCM … … 3972 3975 3973 3976 /* 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); 3983 3987 3984 3988 //SSMR3GetBool(pSSM, &pThis->pVMMDevRAMR3->fHaveEvents); … … 3992 3996 SSMR3GetBool(pSSM, &pThis->displayChangeData.fGuestSentChangeEventAck); 3993 3997 3994 rc = SSMR3GetU32(pSSM, &pThis-> guestCaps);3998 rc = SSMR3GetU32(pSSM, &pThis->fGuestCaps); 3995 3999 3996 4000 /* Attributes which were temporarily introduced in r30072 */ … … 4068 4072 * that listeners can sync their state again 4069 4073 */ 4070 Log(("vmmdevLoadState: capabilities changed (%x), informing connector\n", pThis-> mouseCapabilities));4074 Log(("vmmdevLoadState: capabilities changed (%x), informing connector\n", pThis->fMouseCapabilities)); 4071 4075 if (pThis->pDrv) 4072 4076 { 4073 pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis-> mouseCapabilities);4077 pThis->pDrv->pfnUpdateMouseCapabilities(pThis->pDrv, pThis->fMouseCapabilities); 4074 4078 if (uVersion >= 10) 4075 4079 pThis->pDrv->pfnUpdatePointerShape(pThis->pDrv, … … 4106 4110 } 4107 4111 if (pThis->pDrv && pThis->pDrv->pfnUpdateGuestCapabilities) 4108 pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis-> guestCaps);4112 pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->fGuestCaps); 4109 4113 4110 4114 return VINF_SUCCESS; … … 4167 4171 * Reset the mouse integration feature bits 4168 4172 */ 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; 4172 4176 /* 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); 4175 4179 } 4176 4180 pThis->fHostCursorRequested = false; 4177 4178 pThis->hypervisorSize = 0;4179 4181 4180 4182 /* re-initialize the VMMDev memory */ … … 4203 4205 memset (&pThis->guestInfo, 0, sizeof (pThis->guestInfo)); 4204 4206 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; 4207 4209 4208 4210 /* Clear facilities. No need to tell Main as it will get a … … 4233 4235 4234 4236 /* disabled statistics updating */ 4235 pThis-> u32LastStatIntervalSize= 0;4237 pThis->cSecsLastStatInterval = 0; 4236 4238 4237 4239 #ifdef VBOX_WITH_HGCM … … 4253 4255 * Clear the event variables. 4254 4256 * 4255 * XXX By design we should NOT clear pThis-> u32HostEventFlags because it is designed4257 * XXX By design we should NOT clear pThis->fHostEventFlags because it is designed 4256 4258 * that way so host events do not depend on guest resets. However, the pending 4257 4259 * event flags actually _were_ cleared since ages so we mask out events from 4258 4260 * clearing which we really need to survive the reset. See xtracker 5767. 4259 4261 */ 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; 4264 4266 4265 4267 /* … … 4269 4271 pThis->pDrv->pfnUpdateGuestInfo(pThis->pDrv, &pThis->guestInfo); 4270 4272 if (fCapsChanged && pThis->pDrv && pThis->pDrv->pfnUpdateGuestCapabilities) 4271 pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis-> guestCaps);4273 pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->fGuestCaps); 4272 4274 4273 4275 /* … … 4704 4706 * changes. 4705 4707 */ 4706 pThis-> mouseCapabilities |= VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR;4708 pThis->fMouseCapabilities |= VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR; 4707 4709 4708 4710 /* -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r81031 r81569 127 127 PDMCRITSECT CritSect; 128 128 129 /** hypervisor address space size */130 uint32_t hypervisorSize;131 132 129 /** 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 /** @} */ 137 136 /** 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 146 139 /** Pointer to device instance - R3 poitner. */ 147 PPDMDEVINSR3 pDevInsR3;140 PPDMDEVINSR3 pDevInsR3; 148 141 /** Pointer to device instance - R0 pointer. */ 149 PPDMDEVINSR0 pDevInsR0;142 PPDMDEVINSR0 pDevInsR0; 150 143 151 144 /** LUN\#0 + Status: VMMDev port base interface. */ 152 PDMIBASE IBase;145 PDMIBASE IBase; 153 146 /** LUN\#0: VMMDev port interface. */ 154 PDMIVMMDEVPORT IPort;147 PDMIVMMDEVPORT IPort; 155 148 #ifdef VBOX_WITH_HGCM 156 149 /** LUN\#0: HGCM port interface. */ 157 PDMIHGCMPORT IHGCMPort;150 PDMIHGCMPORT IHGCMPort; 158 151 //# if HC_ARCH_BITS == 32 159 152 // RTR3PTR R3PtrAlignment1; … … 169 162 #endif 170 163 /** message buffer for backdoor logging. */ 171 char szMsg[512];164 char szMsg[512]; 172 165 /** message buffer index. */ 173 uint32_t iMsg;166 uint32_t offMsg; 174 167 /** Alignment padding. */ 175 uint32_t u32Alignment2;168 uint32_t u32Alignment2; 176 169 177 170 /** Statistics counter for slow IRQ ACK. */ 178 STAMCOUNTER StatSlowIrqAck;171 STAMCOUNTER StatSlowIrqAck; 179 172 /** Statistics counter for fast IRQ ACK - R3. */ 180 STAMCOUNTER StatFastIrqAckR3;173 STAMCOUNTER StatFastIrqAckR3; 181 174 /** 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. 188 179 * @note The HGCM events are enabled automatically by the VMMDev device when 189 180 * 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; 195 186 /** Alignment padding. */ 196 bool afAlignment3[3];187 bool afAlignment3[7]; 197 188 198 189 /** GC physical address of VMMDev RAM area */ … … 211 202 R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3; 212 203 /** GC physical address of VMMDev Heap RAM area */ 213 RTGCPHYS32 GCPhysVMMDevHeap;204 RTGCPHYS32 GCPhysVMMDevHeap; 214 205 215 206 /** Information reported by guest via VMMDevReportGuestInfo generic request. 216 207 * Until this information is reported the VMMDev refuses any other requests. 217 208 */ 218 VBoxGuestInfo guestInfo;209 VBoxGuestInfo guestInfo; 219 210 /** Information report \#2, chewed a little. */ 220 211 struct 221 212 { 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; 227 218 228 219 /** Array of guest facility statuses. */ 229 VMMDEVFACILITYSTATUSENTRY 220 VMMDEVFACILITYSTATUSENTRY aFacilityStatuses[32]; 230 221 /** The number of valid entries in the facility status array. */ 231 uint32_t 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; 235 226 236 227 /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo, … … 238 229 * of the version in guestInfo. 239 230 */ 240 uint32_t fu32AdditionsOk;231 uint32_t fu32AdditionsOk; 241 232 242 233 /** Video acceleration status set by guest. */ 243 uint32_t u32VideoAccelEnabled;244 245 DISPLAYCHANGEDATA displayChangeData;234 uint32_t u32VideoAccelEnabled; 235 236 DISPLAYCHANGEDATA displayChangeData; 246 237 247 238 /** Pointer to the credentials. */ … … 249 240 250 241 #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; 256 247 /** 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; 274 269 275 270 #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]; 279 274 #else 280 bool afAlignment6[1+2]; 281 #endif 275 bool afAlignment6[1+2]; 276 #endif 277 282 278 /** Set if GetHostTime should fail. 283 279 * Loaded from the GetHostTimeDisabled configuration value. */ 284 bool fGetHostTimeDisabled; 285 280 bool fGetHostTimeDisabled; 286 281 /** Set if backdoor logging should be disabled (output will be ignored then) */ 287 bool fBackdoorLogDisabled; 288 282 bool fBackdoorLogDisabled; 289 283 /** Don't clear credentials */ 290 bool fKeepCredentials; 291 284 bool fKeepCredentials; 292 285 /** Heap enabled. */ 293 bool fHeapEnabled;286 bool fHeapEnabled; 294 287 295 288 /** Guest Core Dumping enabled. */ 296 bool fGuestCoreDumpEnabled; 297 289 bool fGuestCoreDumpEnabled; 298 290 /** Guest Core Dump location. */ 299 char szGuestCoreDumpDir[RTPATH_MAX]; 300 291 char szGuestCoreDumpDir[RTPATH_MAX]; 301 292 /** Number of additional cores to keep around. */ 302 uint32_t cGuestCoreDumps;293 uint32_t cGuestCoreDumps; 303 294 304 295 #ifdef VBOX_WITH_HGCM 305 296 /** List of pending HGCM requests (VBOXHGCMCMD). */ 306 RTLISTANCHORR3 listHGCMCmd;297 RTLISTANCHORR3 listHGCMCmd; 307 298 /** Critical section to protect the list. */ 308 RTCRITSECT critsectHGCMCmdList;299 RTCRITSECT critsectHGCMCmdList; 309 300 /** Whether the HGCM events are already automatically enabled. */ 310 uint32_t u32HGCMEnabled;301 uint32_t u32HGCMEnabled; 311 302 /** 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; 319 310 #endif /* VBOX_WITH_HGCM */ 320 STAMCOUNTER StatReqBufAllocs;311 STAMCOUNTER StatReqBufAllocs; 321 312 322 313 /** Per CPU request 4K sized buffers, allocated as needed. */
Note:
See TracChangeset
for help on using the changeset viewer.