Changeset 44788 in vbox for trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
- Timestamp:
- Feb 21, 2013 5:05:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r44785 r44788 2456 2456 /* 2457 2457 * The caller has passed the guest context physical address of the request 2458 * structure. Copy the request packet. 2458 * structure. We'll copy all of it into a heap buffer eventually, but we 2459 * will have to start off with the header. 2459 2460 */ 2460 2461 VMMDevRequestHeader requestHeader; … … 2462 2463 PDMDevHlpPhysRead(pDevIns, (RTGCPHYS)u32, &requestHeader, sizeof(requestHeader)); 2463 2464 2464 /* the structure size must be greater or equal to the header size*/2465 /* The structure size must be greater or equal to the header size. */ 2465 2466 if (requestHeader.size < sizeof(VMMDevRequestHeader)) 2466 2467 { … … 2469 2470 } 2470 2471 2471 /* check the version of the header structure*/2472 /* Check the version of the header structure. */ 2472 2473 if (requestHeader.version != VMMDEV_REQUEST_HEADER_VERSION) 2473 2474 { … … 2478 2479 Log2(("VMMDev request issued: %d\n", requestHeader.requestType)); 2479 2480 2481 int rcRet = VINF_SUCCESS; 2480 2482 bool fDelayedUnlock = false; 2481 int rcRet = VINF_SUCCESS;2482 2483 VMMDevRequestHeader *pRequestHeader = NULL; 2483 2484 2485 /* Check that is doesn't exceed the max packet size. */ 2484 2486 if (requestHeader.size <= VMMDEV_MAX_VMMDEVREQ_SIZE) 2485 2487 { 2486 PDMCritSectEnter(&pThis->CritSect, VERR_IGNORED); /** @todo could probably move this to after the 2nd memory read, maybe after fu32AdditionsOk making volatile, if feeling paranoid. */ 2487 2488 /* Newer additions starts with VMMDevReq_ReportGuestInfo2, older additions 2489 started with VMMDevReq_ReportGuestInfo. */ 2488 /* 2489 * We require the GAs to report it's information before we let it have 2490 * access to all the functions. The VMMDevReq_ReportGuestInfo request 2491 * is the one which unlocks the access. Newer additions will first 2492 * issue VMMDevReq_ReportGuestInfo2, older ones doesn't know this one. 2493 * Two exceptions: VMMDevReq_GetHostVersion and VMMDevReq_WriteCoreDump. 2494 */ 2490 2495 if ( pThis->fu32AdditionsOk 2491 2496 || requestHeader.requestType == VMMDevReq_ReportGuestInfo2 2492 2497 || requestHeader.requestType == VMMDevReq_ReportGuestInfo 2493 2498 || requestHeader.requestType == VMMDevReq_WriteCoreDump 2494 || requestHeader.requestType == VMMDevReq_GetHostVersion) /* Always allow the guest to query the host capabilities. */ 2499 || requestHeader.requestType == VMMDevReq_GetHostVersion 2500 ) 2495 2501 { 2496 2502 /* 2497 * Read the entire request packet and feed it to the dispatcher function. 2503 * The request looks fine. Allocate a heap block for it, read the 2504 * entire package from guest memory and feed it to the dispatcher. 2498 2505 */ 2499 2506 pRequestHeader = (VMMDevRequestHeader *)RTMemAlloc(requestHeader.size); … … 2502 2509 PDMDevHlpPhysRead(pDevIns, (RTGCPHYS)u32, pRequestHeader, requestHeader.size); 2503 2510 2511 PDMCritSectEnter(&pThis->CritSect, VERR_IGNORED); 2504 2512 rcRet = vmmdevReqDispatcher(pThis, pRequestHeader, u32, &fDelayedUnlock); 2513 if (!fDelayedUnlock) 2514 PDMCritSectLeave(&pThis->CritSect); 2505 2515 } 2506 2516 else … … 2521 2531 requestHeader.rc = VERR_NOT_SUPPORTED; 2522 2532 } 2523 2524 if (!fDelayedUnlock)2525 PDMCritSectLeave(&pThis->CritSect);2526 2533 } 2527 2534 else
Note:
See TracChangeset
for help on using the changeset viewer.