Changeset 105352 in vbox for trunk/src/VBox/VMM/VMMR3/VMReq.cpp
- Timestamp:
- Jul 16, 2024 11:21:19 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/VMReq.cpp
r98103 r105352 71 71 * @param pfnFunction Pointer to the function to call. 72 72 * @param cArgs Number of arguments following in the ellipsis. 73 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 74 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 75 * is ORed in. 73 76 * @param ... Function arguments. 74 77 * … … 108 111 * @param pfnFunction Pointer to the function to call. 109 112 * @param cArgs Number of arguments following in the ellipsis. 113 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 114 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 115 * is ORed in. 110 116 * @param ... Function arguments. 111 117 * … … 142 148 * @param pfnFunction Pointer to the function to call. 143 149 * @param cArgs Number of arguments following in the ellipsis. 150 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 151 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 152 * is ORed in. 144 153 * @param ... Function arguments. 145 154 * … … 172 181 * @param pfnFunction Pointer to the function to call. 173 182 * @param cArgs Number of arguments following in the ellipsis. 183 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 184 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 185 * is ORed in. 174 186 * @param ... Function arguments. 175 187 * … … 201 213 * @param pfnFunction Pointer to the function to call. 202 214 * @param cArgs Number of arguments following in the ellipsis. 215 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 216 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 217 * is ORed in. 203 218 * @param ... Function arguments. 204 219 * … … 233 248 * @param pfnFunction Pointer to the function to call. 234 249 * @param cArgs Number of arguments following in the ellipsis. 250 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 251 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 252 * is ORed in. 235 253 * @param ... Function arguments. 236 254 * … … 264 282 * @param pfnFunction Pointer to the function to call. 265 283 * @param cArgs Number of arguments following in the ellipsis. 284 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 285 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 286 * is ORed in. 266 287 * @param ... Function arguments. 267 288 * … … 300 321 * @param pfnFunction Pointer to the function to call. 301 322 * @param cArgs Number of arguments following in the ellipsis. 323 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 324 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 325 * is ORed in. 302 326 * @param ... Function arguments. 303 327 * … … 338 362 * @param pfnFunction Pointer to the function to call. 339 363 * @param cArgs Number of arguments following in the ellipsis. 364 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 365 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 366 * is ORed in. 340 367 * @param ... Function arguments. 341 368 * … … 372 399 * @param pfnFunction Pointer to the function to call. 373 400 * @param cArgs Number of arguments following in the ellipsis. 401 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 402 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 403 * is ORed in. 374 404 * @param ... Function arguments. 375 405 * … … 414 444 * @param pfnFunction Pointer to the function to call. 415 445 * @param cArgs Number of arguments following in the ellipsis. 446 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 447 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 448 * is ORed in. 416 449 * @param ... Function arguments. 417 450 * … … 454 487 * @param fFlags A combination of the VMREQFLAGS values. 455 488 * @param cArgs Number of arguments following in the ellipsis. 489 * The max is VMREQ_MAX_ARGS (9) (ARM64/darwin 490 * peculiarities), unless VMREQ_F_EXTRA_ARGS_ALL_PTRS 491 * is ORed in. 456 492 * Stuff which differs in size from uintptr_t is gonna make trouble, so don't try! 457 493 * @param Args Argument vector. … … 465 501 * hosts because 'int' is 32-bit. 466 502 * Use (void *)NULL or (uintptr_t)0 instead of NULL. 503 * - The max number of arguments is currently limited to 9, because 504 * on macOS/arm64 arguments passed on the stack that are 32-bit 505 * or smaller will not get a full 64-bit stack slot. So, 506 * we cannot pretend @a pfnFunction takes a list of @a cArgs 507 * uintptr_t parameters, unless all parameters above 9 actually 508 * are more than 32 bits wide. (This would've kind of worked 509 * iff the variadict functions didn't use different size round up 510 * and alignment rules.) See @bugref{10725}. 467 511 */ 468 512 VMMR3DECL(int) VMR3ReqCallVU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, 469 513 PFNRT pfnFunction, unsigned cArgs, va_list Args) 470 514 { 471 LogFlow(("VMR3ReqCallV: idDstCpu=%u cMillies=%d fFlags=%#x pfnFunction=%p cArgs=% d\n", idDstCpu, cMillies, fFlags, pfnFunction, cArgs));515 LogFlow(("VMR3ReqCallV: idDstCpu=%u cMillies=%d fFlags=%#x pfnFunction=%p cArgs=%#x\n", idDstCpu, cMillies, fFlags, pfnFunction, cArgs)); 472 516 473 517 /* … … 482 526 *ppReq = NULL; 483 527 } 528 AssertMsgReturn( cArgs <= VMREQ_MAX_ARGS 529 || ( (cArgs & VMREQ_F_EXTRA_ARGS_ALL_PTRS) 530 && (cArgs & ~(unsigned)VMREQ_F_EXTRA_ARGS_ALL_PTRS) <= VMREQ_MAX_ARGS_EXTENDED), 531 ("cArgs=%#x\n", cArgs), 532 VERR_TOO_MUCH_DATA); 533 cArgs &= ~(unsigned)VMREQ_F_EXTRA_ARGS_ALL_PTRS; 534 535 /* 536 * Allocate request 537 */ 484 538 PVMREQ pReq = NULL; 485 AssertMsgReturn(cArgs * sizeof(uintptr_t) <= sizeof(pReq->u.Internal.aArgs), 486 ("cArg=%d\n", cArgs), 487 VERR_TOO_MUCH_DATA); 488 489 /* 490 * Allocate request 491 */ 539 AssertCompile(VMREQ_MAX_ARGS_EXTENDED * sizeof(uintptr_t) <= sizeof(pReq->u.Internal.aArgs)); 492 540 int rc = VMR3ReqAlloc(pUVM, &pReq, VMREQTYPE_INTERNAL, idDstCpu); 493 541 if (RT_FAILURE(rc)) … … 497 545 * Initialize the request data. 498 546 */ 499 pReq->fFlags = fFlags;500 pReq->u.Internal.pfn = pfnFunction;501 pReq->u.Internal.cArgs = cArgs;547 pReq->fFlags = fFlags; 548 pReq->u.Internal.pfn = pfnFunction; 549 pReq->u.Internal.cArgs = cArgs; 502 550 for (unsigned iArg = 0; iArg < cArgs; iArg++) 503 551 pReq->u.Internal.aArgs[iArg] = va_arg(Args, uintptr_t);
Note:
See TracChangeset
for help on using the changeset viewer.