VirtualBox

Ignore:
Timestamp:
Mar 9, 2011 4:41:09 PM (14 years ago)
Author:
vboxsync
Message:

RTCPUSET, SUPDrv: Preparation for supporting 256 CPUs/cores/threads.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r36223 r36232  
    13931393        }
    13941394
     1395        case SUP_CTL_CODE_NO_SIZE(SUP_IOCTL_CALL_VMMR0_BIG):
     1396        {
     1397            /* validate */
     1398            PSUPCALLVMMR0 pReq = (PSUPCALLVMMR0)pReqHdr;
     1399            Log4(("SUP_IOCTL_CALL_VMMR0_BIG: op=%u in=%u arg=%RX64 p/t=%RTproc/%RTthrd\n",
     1400                  pReq->u.In.uOperation, pReq->Hdr.cbIn, pReq->u.In.u64Arg, RTProcSelf(), RTThreadNativeSelf()));
     1401
     1402            PSUPVMMR0REQHDR pVMMReq = (PSUPVMMR0REQHDR)&pReq->abReqPkt[0];
     1403            REQ_CHECK_EXPR_FMT(pReq->Hdr.cbIn >= SUP_IOCTL_CALL_VMMR0_BIG_SIZE(sizeof(SUPVMMR0REQHDR)),
     1404                               ("SUP_IOCTL_CALL_VMMR0_BIG: cbIn=%#x < %#lx\n", pReq->Hdr.cbIn, SUP_IOCTL_CALL_VMMR0_BIG_SIZE(sizeof(SUPVMMR0REQHDR))));
     1405            REQ_CHECK_EXPR(SUP_IOCTL_CALL_VMMR0_BIG, pVMMReq->u32Magic == SUPVMMR0REQHDR_MAGIC);
     1406            REQ_CHECK_SIZES_EX(SUP_IOCTL_CALL_VMMR0_BIG, SUP_IOCTL_CALL_VMMR0_BIG_SIZE_IN(pVMMReq->cbReq), SUP_IOCTL_CALL_VMMR0_BIG_SIZE_OUT(pVMMReq->cbReq));
     1407
     1408            /* execute */
     1409            if (RT_LIKELY(pDevExt->pfnVMMR0EntryEx))
     1410                pReq->Hdr.rc = pDevExt->pfnVMMR0EntryEx(pReq->u.In.pVMR0, pReq->u.In.idCpu, pReq->u.In.uOperation, pVMMReq, pReq->u.In.u64Arg, pSession);
     1411            else
     1412                pReq->Hdr.rc = VERR_WRONG_ORDER;
     1413
     1414            if (    RT_FAILURE(pReq->Hdr.rc)
     1415                &&  pReq->Hdr.rc != VERR_INTERRUPTED
     1416                &&  pReq->Hdr.rc != VERR_TIMEOUT)
     1417                Log(("SUP_IOCTL_CALL_VMMR0_BIG: rc=%Rrc op=%u out=%u arg=%RX64 p/t=%RTproc/%RTthrd\n",
     1418                     pReq->Hdr.rc, pReq->u.In.uOperation, pReq->Hdr.cbOut, pReq->u.In.u64Arg, RTProcSelf(), RTThreadNativeSelf()));
     1419            else
     1420                Log4(("SUP_IOCTL_CALL_VMMR0_BIG: rc=%Rrc op=%u out=%u arg=%RX64 p/t=%RTproc/%RTthrd\n",
     1421                      pReq->Hdr.rc, pReq->u.In.uOperation, pReq->Hdr.cbOut, pReq->u.In.u64Arg, RTProcSelf(), RTThreadNativeSelf()));
     1422            VBOXDRV_SUPDRV_IOCTL_RETURN(pSession, uIOCtl, pReqHdr, VINF_SUCCESS, pReq->Hdr.rc);
     1423            return 0;
     1424        }
     1425
    13951426        case SUP_CTL_CODE_NO_SIZE(SUP_IOCTL_GET_PAGING_MODE):
    13961427        {
  • trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h

    r34972 r36232  
    193193 *          - None.
    194194 */
    195 #define SUPDRV_IOC_VERSION                              0x00160000
     195#define SUPDRV_IOC_VERSION                              0x00160001
    196196
    197197/** SUP_IOCTL_COOKIE. */
     
    484484/** @name SUP_IOCTL_CALL_VMMR0
    485485 * Call the R0 VMM Entry point.
    486  *
    487  * @todo Might have to convert this to a big request...
    488486 * @{
    489487 */
     
    513511    uint8_t                 abReqPkt[1];
    514512} SUPCALLVMMR0, *PSUPCALLVMMR0;
     513/** @} */
     514
     515
     516/** @name SUP_IOCTL_CALL_VMMR0_BIG
     517 * Version of SUP_IOCTL_CALL_VMMR0 for dealing with large requests.
     518 * @{
     519 */
     520#define SUP_IOCTL_CALL_VMMR0_BIG                        SUP_CTL_CODE_BIG(27)
     521#define SUP_IOCTL_CALL_VMMR0_BIG_SIZE(cbReq)            RT_UOFFSETOF(SUPCALLVMMR0, abReqPkt[cbReq])
     522#define SUP_IOCTL_CALL_VMMR0_BIG_SIZE_IN(cbReq)         SUP_IOCTL_CALL_VMMR0_SIZE(cbReq)
     523#define SUP_IOCTL_CALL_VMMR0_BIG_SIZE_OUT(cbReq)        SUP_IOCTL_CALL_VMMR0_SIZE(cbReq)
    515524/** @} */
    516525
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r35346 r36232  
    267267        strcpy(CookieReq.u.In.szMagic, SUPCOOKIE_MAGIC);
    268268        CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION;
    269         const uint32_t uMinVersion = /*(SUPDRV_IOC_VERSION & 0xffff0000) == 0x00160000
    270                                    ?  0x00160000
    271                                    :*/ SUPDRV_IOC_VERSION & 0xffff0000;
     269        const uint32_t uMinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x00160000
     270                                   ? 0x00160001
     271                                   : SUPDRV_IOC_VERSION & 0xffff0000;
    272272        CookieReq.u.In.u32MinVersion = uMinVersion;
    273273        rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_COOKIE, &CookieReq, SUP_IOCTL_COOKIE_SIZE);
     
    656656        memcpy(pReqHdr, &pReq->abReqPkt[0], cbReq);
    657657    }
    658     else /** @todo may have to remove the size limits one this request... */
    659         AssertMsgFailedReturn(("cbReq=%#x\n", pReqHdr->cbReq), VERR_INTERNAL_ERROR);
     658    else if (pReqHdr->cbReq <= _512K)
     659    {
     660        AssertPtrReturn(pReqHdr, VERR_INVALID_POINTER);
     661        AssertReturn(pReqHdr->u32Magic == SUPVMMR0REQHDR_MAGIC, VERR_INVALID_MAGIC);
     662        const size_t cbReq = pReqHdr->cbReq;
     663
     664        PSUPCALLVMMR0 pReq = (PSUPCALLVMMR0)RTMemTmpAlloc(SUP_IOCTL_CALL_VMMR0_BIG_SIZE(cbReq));
     665        pReq->Hdr.u32Cookie         = g_u32Cookie;
     666        pReq->Hdr.u32SessionCookie  = g_u32SessionCookie;
     667        pReq->Hdr.cbIn              = SUP_IOCTL_CALL_VMMR0_BIG_SIZE_IN(cbReq);
     668        pReq->Hdr.cbOut             = SUP_IOCTL_CALL_VMMR0_BIG_SIZE_OUT(cbReq);
     669        pReq->Hdr.fFlags            = SUPREQHDR_FLAGS_DEFAULT;
     670        pReq->Hdr.rc                = VERR_INTERNAL_ERROR;
     671        pReq->u.In.pVMR0            = pVMR0;
     672        pReq->u.In.idCpu            = idCpu;
     673        pReq->u.In.uOperation       = uOperation;
     674        pReq->u.In.u64Arg           = u64Arg;
     675        memcpy(&pReq->abReqPkt[0], pReqHdr, cbReq);
     676        rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_CALL_VMMR0_BIG, pReq, SUP_IOCTL_CALL_VMMR0_BIG_SIZE(cbReq));
     677        if (RT_SUCCESS(rc))
     678            rc = pReq->Hdr.rc;
     679        memcpy(pReqHdr, &pReq->abReqPkt[0], cbReq);
     680        RTMemTmpFree(pReq);
     681    }
     682    else
     683        AssertMsgFailedReturn(("cbReq=%#x\n", pReqHdr->cbReq), VERR_OUT_OF_RANGE);
    660684    return rc;
    661685}
Note: See TracChangeset for help on using the changeset viewer.

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