Changeset 105751 in vbox
- Timestamp:
- Aug 21, 2024 9:51:08 AM (5 weeks ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
include/VBox/VMMDev.h (modified) (2 diffs)
-
src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibHGCMInternal.cpp (modified) (2 diffs)
-
src/VBox/Devices/VMMDev/VMMDev.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VMMDev.h
r100185 r105751 1763 1763 1764 1764 /** 1765 * HGCM cancel request structure, version 2 .1765 * HGCM cancel request structure, version 2/old. 1766 1766 * 1767 1767 * Used by VMMDevReq_HGCMCancel2. … … 1777 1777 /** The physical address of the request to cancel. */ 1778 1778 RTGCPHYS32 physReqToCancel; 1779 } VMMDevHGCMCancel2Old; 1780 AssertCompileSize(VMMDevHGCMCancel2Old, 24+4); 1781 1782 /** 1783 * HGCM cancel request structure, version 2 w/ 64-bit address. 1784 * 1785 * Used by VMMDevReq_HGCMCancel2. 1786 * 1787 * VINF_SUCCESS when cancelled. 1788 * VERR_NOT_FOUND if the specified request cannot be found. 1789 * VERR_INVALID_PARAMETER if the address is invalid valid. 1790 * 1791 * @note For little endian guests, this is backwards compatible with 1792 * VMMDevHGCMCancel2Old since the hosts prior to 7.1 only checked for a 1793 * minimum sizeof(VMMDevHGCMCancel2Old) and would ignore any additional 1794 * bytes in the request. Growing physReqToCancel to 64-bit makes use of 1795 * this, though the host code now require either the exactly old size or 1796 * a minimum size of this amended structure. 1797 * @since VBox 7.1 1798 */ 1799 typedef struct 1800 { 1801 /** Header. */ 1802 VMMDevRequestHeader header; 1803 /** The physical address of the request to cancel. */ 1804 RTGCPHYS physReqToCancel; 1779 1805 } VMMDevHGCMCancel2; 1780 AssertCompileSize(VMMDevHGCMCancel2, 24+ 4);1806 AssertCompileSize(VMMDevHGCMCancel2, 24+8); 1781 1807 1782 1808 #endif /* VBOX_WITH_HGCM */ -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibHGCMInternal.cpp
r98103 r105751 733 733 * 734 734 * This is a bit messy because we're racing request completion. Sorry. 735 * 736 * Note! The VMMDevHGCMCancel2 request size was increased in 7.1 to fully 737 * handle 64-bit addresses. Using the new structure size with older 738 * VBox host versions will work, though, since they check for a 739 * minimum request size and will ignore any extra stuff they don't 740 * understand. Both ARM and x86 guests are little endian, this 741 * naturally wouldn't work for big-endian guests. 742 * 743 * Of course, they won't find requests with addresses above 4GB, but 744 * that's not a real issue since it is used by ARM guests only. 735 745 */ 736 746 /** @todo It would be nice if we could use the waiter callback to do further … … 745 755 VbglR0GRFree(&pCancelReq->header); 746 756 } 747 #if 1 /** @todo ADDVER: Remove this on next minor version change. */748 if (rc2 == VERR_NOT_IMPLEMENTED)749 {750 /* host is too old, or we're out of heap. */751 pHGCMCall->header.fu32Flags |= VBOX_HGCM_REQ_CANCELLED;752 pHGCMCall->header.header.requestType = VMMDevReq_HGCMCancel;753 rc2 = VbglR0GRPerform(&pHGCMCall->header.header);754 if (rc2 == VERR_INVALID_PARAMETER)755 rc2 = VERR_NOT_FOUND;756 else if (RT_SUCCESS(rc))757 RTThreadSleep(1);758 }759 #endif760 757 if (RT_SUCCESS(rc)) rc = VERR_INTERRUPTED; /** @todo weed this out from the WINNT VBoxGuest code. */ 761 758 if (RT_SUCCESS(rc2)) -
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r104065 r105751 2001 2001 static int vmmdevReqHandler_HGCMCancel2(PVMMDEVCC pThisCC, VMMDevRequestHeader *pReqHdr) 2002 2002 { 2003 VMMDevHGCMCancel2 *pReq = (VMMDevHGCMCancel2 *)pReqHdr; 2004 AssertMsgReturn(pReq->header.size >= sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER); /** @todo Not sure why this >= ... */ 2003 /* Note! Using '>=' for the size check because that simplifies amending the 2004 structure (like we did already) */ 2005 RTGCPHYS GCPhysReqToCancel; 2006 if (pReqHdr->size >= sizeof(VMMDevHGCMCancel2)) 2007 GCPhysReqToCancel = ((VMMDevHGCMCancel2 const *)pReqHdr)->physReqToCancel; 2008 else if (pReqHdr->size == sizeof(VMMDevHGCMCancel2Old)) 2009 GCPhysReqToCancel = ((VMMDevHGCMCancel2Old const *)pReqHdr)->physReqToCancel; 2010 else 2011 AssertMsgFailedReturn(("%u\n", pReqHdr->size), VERR_INVALID_PARAMETER); 2012 RT_UNTRUSTED_VALIDATED_FENCE(); 2005 2013 2006 2014 if (pThisCC->pHGCMDrv) 2007 2015 { 2008 Log(("VMMDevReq_HGCMCancel2 \n"));2009 return vmmdevR3HgcmCancel2(pThisCC, pReq->physReqToCancel);2016 Log(("VMMDevReq_HGCMCancel2: %RGp\n", GCPhysReqToCancel)); 2017 return vmmdevR3HgcmCancel2(pThisCC, GCPhysReqToCancel); 2010 2018 } 2011 2019
Note:
See TracChangeset
for help on using the changeset viewer.

