Changeset 10805
- Timestamp:
- 07/22/08 11:44:31 (3 months ago)
- Files:
-
- trunk/include/VBox/vmm.h (modified) (2 diffs)
- trunk/src/VBox/HostDrivers/Support/SUPDrv.c (modified) (2 diffs)
- trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h (modified) (1 diff)
- trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h (modified) (1 diff)
- trunk/src/VBox/HostDrivers/Support/SUPLib.cpp (modified) (1 diff)
- trunk/src/VBox/VMM/VMMR0/VMMR0.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/include/VBox/vmm.h
r10724 r10805 483 483 * @param enmOperation Which operation to execute. 484 484 * @param pvArg Argument to the operation. 485 * @remarks Assume called with interrupts disabled.485 * @remarks Assume called with interrupts or preemption disabled. 486 486 */ 487 487 VMMR0DECL(int) VMMR0EntryInt(PVM pVM, VMMR0OPERATION enmOperation, void *pvArg); … … 505 505 * @param pReq This points to a SUPVMMR0REQHDR packet. Optional. 506 506 * @param u64Arg Some simple constant argument. 507 * @param pSession The session of the caller. 507 508 * @remarks Assume called with interrupts _enabled_. 508 509 */ 509 VMMR0DECL(int) VMMR0EntryEx(PVM pVM, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg );510 VMMR0DECL(int) VMMR0EntryEx(PVM pVM, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION); 510 511 511 512 /** trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r10724 r10805 1116 1116 /* execute */ 1117 1117 if (RT_LIKELY(pDevExt->pfnVMMR0EntryEx)) 1118 pReq->Hdr.rc = pDevExt->pfnVMMR0EntryEx(pReq->u.In.pVMR0, pReq->u.In.uOperation, NULL, pReq->u.In.u64Arg );1118 pReq->Hdr.rc = pDevExt->pfnVMMR0EntryEx(pReq->u.In.pVMR0, pReq->u.In.uOperation, NULL, pReq->u.In.u64Arg, pSession); 1119 1119 else 1120 1120 pReq->Hdr.rc = VERR_WRONG_ORDER; … … 1130 1130 /* execute */ 1131 1131 if (RT_LIKELY(pDevExt->pfnVMMR0EntryEx)) 1132 pReq->Hdr.rc = pDevExt->pfnVMMR0EntryEx(pReq->u.In.pVMR0, pReq->u.In.uOperation, pVMMReq, pReq->u.In.u64Arg );1132 pReq->Hdr.rc = pDevExt->pfnVMMR0EntryEx(pReq->u.In.pVMR0, pReq->u.In.uOperation, pVMMReq, pReq->u.In.u64Arg, pSession); 1133 1133 else 1134 1134 pReq->Hdr.rc = VERR_WRONG_ORDER; trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r10732 r10805 182 182 * The upper 16-bit is the major version, the the lower the minor version. 183 183 * When incompatible changes are made, the upper major number has to be changed. */ 184 #define SUPDRV_IOC_VERSION 0x000 80001184 #define SUPDRV_IOC_VERSION 0x00090000 185 185 186 186 /** SUP_IOCTL_COOKIE. */ trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r10724 r10805 617 617 DECLR0CALLBACKMEMBER(void, pfnVMMR0EntryFast, (PVM pVM, unsigned uOperation)); 618 618 /** VMMR0EntryEx() pointer. */ 619 DECLR0CALLBACKMEMBER(int, pfnVMMR0EntryEx, (PVM pVM, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg ));619 DECLR0CALLBACKMEMBER(int, pfnVMMR0EntryEx, (PVM pVM, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession)); 620 620 621 621 /** Linked list of loaded code. */ trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r10732 r10805 212 212 strcpy(CookieReq.u.In.szMagic, SUPCOOKIE_MAGIC); 213 213 CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION; 214 const uint32_t MinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x00080000214 const uint32_t MinVersion = /*(SUPDRV_IOC_VERSION & 0xffff0000) == 0x00080000 215 215 ? 0x00080001 216 : SUPDRV_IOC_VERSION & 0xffff0000;216 : */ SUPDRV_IOC_VERSION & 0xffff0000; 217 217 CookieReq.u.In.u32MinVersion = MinVersion; 218 218 rc = suplibOsIOCtl(SUP_IOCTL_COOKIE, &CookieReq, SUP_IOCTL_COOKIE_SIZE); trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r10746 r10805 668 668 * @param pSession The session argument. 669 669 */ 670 DECLINLINE(bool) vmmR0IsValidSession(PVM pVM, PSUPDRVSESSION p Session)670 DECLINLINE(bool) vmmR0IsValidSession(PVM pVM, PSUPDRVSESSION pClaimedSession, PSUPDRVSESSION pSession) 671 671 { 672 672 /* Only one out of the two */ … … 674 674 return false; 675 675 if (pVM) 676 pSession = pVM->pSession; 677 678 /** @todo supdrv should validate it. */ 679 return VALID_PTR(pSession); 676 pClaimedSession = pVM->pSession; 677 return pClaimedSession == pSession; 680 678 } 681 679 … … 691 689 * The support driver validates this if it's present. 692 690 * @param u64Arg Some simple constant argument. 691 * @param pSession The session of the caller. 693 692 * @remarks Assume called with interrupts _enabled_. 694 693 */ 695 static int vmmR0EntryExWorker(PVM pVM, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReqHdr, uint64_t u64Arg )694 static int vmmR0EntryExWorker(PVM pVM, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReqHdr, uint64_t u64Arg, PSUPDRVSESSION pSession) 696 695 { 697 696 /* … … 883 882 { 884 883 PINTNETOPENREQ pReq = (PINTNETOPENREQ)pReqHdr; 885 if (u64Arg || !pReq || !vmmR0IsValidSession(pVM, pReq->pSession ))884 if (u64Arg || !pReq || !vmmR0IsValidSession(pVM, pReq->pSession, pSession)) 886 885 return VERR_INVALID_PARAMETER; 887 886 if (!g_pIntNet) 888 887 return VERR_NOT_SUPPORTED; 889 return INTNETR0OpenReq(g_pIntNet, p VM ? pVM->pSession : pReq->pSession, pReq);888 return INTNETR0OpenReq(g_pIntNet, pSession, pReq); 890 889 } 891 890 892 891 case VMMR0_DO_INTNET_IF_CLOSE: 893 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFCLOSEREQ)pReqHdr)->pSession ))892 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFCLOSEREQ)pReqHdr)->pSession, pSession)) 894 893 return VERR_INVALID_PARAMETER; 895 894 if (!g_pIntNet) … … 898 897 899 898 case VMMR0_DO_INTNET_IF_GET_RING3_BUFFER: 900 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFGETRING3BUFFERREQ)pReqHdr)->pSession ))899 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFGETRING3BUFFERREQ)pReqHdr)->pSession, pSession)) 901 900 return VERR_INVALID_PARAMETER; 902 901 if (!g_pIntNet) … … 905 904 906 905 case VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE: 907 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSETPROMISCUOUSMODEREQ)pReqHdr)->pSession ))906 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSETPROMISCUOUSMODEREQ)pReqHdr)->pSession, pSession)) 908 907 return VERR_INVALID_PARAMETER; 909 908 if (!g_pIntNet) … … 912 911 913 912 case VMMR0_DO_INTNET_IF_SEND: 914 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSENDREQ)pReqHdr)->pSession ))913 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSENDREQ)pReqHdr)->pSession, pSession)) 915 914 return VERR_INVALID_PARAMETER; 916 915 if (!g_pIntNet) … … 919 918 920 919 case VMMR0_DO_INTNET_IF_WAIT: 921 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFWAITREQ)pReqHdr)->pSession ))920 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFWAITREQ)pReqHdr)->pSession, pSession)) 922 921 return VERR_INVALID_PARAMETER; 923 922 if (!g_pIntNet) … … 961 960 PSUPVMMR0REQHDR pReq; 962 961 uint64_t u64Arg; 962 PSUPDRVSESSION pSession; 963 963 } VMMR0ENTRYEXARGS; 964 964 /** Pointer to a vmmR0EntryExWrapper argument package. */ … … 976 976 ((PVMMR0ENTRYEXARGS)pvArgs)->enmOperation, 977 977 ((PVMMR0ENTRYEXARGS)pvArgs)->pReq, 978 ((PVMMR0ENTRYEXARGS)pvArgs)->u64Arg); 978 ((PVMMR0ENTRYEXARGS)pvArgs)->u64Arg, 979 ((PVMMR0ENTRYEXARGS)pvArgs)->pSession); 979 980 } 980 981 … … 988 989 * @param pReq This points to a SUPVMMR0REQHDR packet. Optional. 989 990 * @param u64Arg Some simple constant argument. 991 * @param pSession The session of the caller. 990 992 * @remarks Assume called with interrupts _enabled_. 991 993 */ 992 VMMR0DECL(int) VMMR0EntryEx(PVM pVM, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg )994 VMMR0DECL(int) VMMR0EntryEx(PVM pVM, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession) 993 995 { 994 996 /* … … 1025 1027 } 1026 1028 } 1027 return vmmR0EntryExWorker(pVM, enmOperation, pReq, u64Arg );1029 return vmmR0EntryExWorker(pVM, enmOperation, pReq, u64Arg, pSession); 1028 1030 } 1029 1031

