Changeset 19252 in vbox
- Timestamp:
- Apr 29, 2009 9:56:19 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r18191 r19252 447 447 * @returns error code specific to uFunction. 448 448 * @param pVMR0 Pointer to the Ring-0 (Host Context) mapping of the VM structure. 449 * @param idCpu VMCPU id. 449 450 * @param uOperation Operation to execute. 450 451 * @param pvArg Argument. 451 452 */ 452 SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg);453 SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, unsigned idCpu, unsigned uOperation, void *pvArg); 453 454 454 455 /** … … 459 460 * @param pVMR0 The ring-0 VM handle. 460 461 * @param uOperation The operation; only the SUP_VMMR0_DO_* ones are valid. 461 * @param idC PUVMCPU id.462 */ 463 SUPR3DECL(int) SUPCallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, unsigned idC PU);462 * @param idCpu VMCPU id. 463 */ 464 SUPR3DECL(int) SUPCallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, unsigned idCpu); 464 465 465 466 /** … … 472 473 * @returns error code specific to uFunction. 473 474 * @param pVMR0 Pointer to the Ring-0 (Host Context) mapping of the VM structure. 475 * @param idCpu VMCPU id. 474 476 * @param uOperation Operation to execute. 475 477 * @param u64Arg Constant argument. … … 478 480 * limit on this, just below 4KB. 479 481 */ 480 SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr);482 SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, unsigned idCpu, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr); 481 483 482 484 /** -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r18850 r19252 149 149 150 150 #ifdef RT_WITH_W64_UNWIND_HACK 151 DECLASM(int) supdrvNtWrapVMMR0EntryEx(PFNRT pfnVMMR0EntryEx, PVM pVM, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession);151 DECLASM(int) supdrvNtWrapVMMR0EntryEx(PFNRT pfnVMMR0EntryEx, PVM pVM, unsigned idCpu, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession); 152 152 DECLASM(int) supdrvNtWrapVMMR0EntryFast(PFNRT pfnVMMR0EntryFast, PVM pVM, unsigned idCpu, unsigned uOperation); 153 153 DECLASM(void) supdrvNtWrapObjDestructor(PFNRT pfnDestruction, void *pvObj, void *pvUser1, void *pvUser2); … … 1328 1328 if (RT_LIKELY(pDevExt->pfnVMMR0EntryEx)) 1329 1329 #ifdef RT_WITH_W64_UNWIND_HACK 1330 pReq->Hdr.rc = supdrvNtWrapVMMR0EntryEx((PFNRT)pDevExt->pfnVMMR0EntryEx, pReq->u.In.pVMR0, pReq->u.In. uOperation, NULL, pReq->u.In.u64Arg, pSession);1330 pReq->Hdr.rc = supdrvNtWrapVMMR0EntryEx((PFNRT)pDevExt->pfnVMMR0EntryEx, pReq->u.In.pVMR0, pReq->u.In.idCpu, pReq->u.In.uOperation, NULL, pReq->u.In.u64Arg, pSession); 1331 1331 #else 1332 pReq->Hdr.rc = pDevExt->pfnVMMR0EntryEx(pReq->u.In.pVMR0, pReq->u.In. uOperation, NULL, pReq->u.In.u64Arg, pSession);1332 pReq->Hdr.rc = pDevExt->pfnVMMR0EntryEx(pReq->u.In.pVMR0, pReq->u.In.idCpu, pReq->u.In.uOperation, NULL, pReq->u.In.u64Arg, pSession); 1333 1333 #endif 1334 1334 else … … 1346 1346 if (RT_LIKELY(pDevExt->pfnVMMR0EntryEx)) 1347 1347 #ifdef RT_WITH_W64_UNWIND_HACK 1348 pReq->Hdr.rc = supdrvNtWrapVMMR0EntryEx((PFNRT)pDevExt->pfnVMMR0EntryEx, pReq->u.In.pVMR0, pReq->u.In. uOperation, pVMMReq, pReq->u.In.u64Arg, pSession);1348 pReq->Hdr.rc = supdrvNtWrapVMMR0EntryEx((PFNRT)pDevExt->pfnVMMR0EntryEx, pReq->u.In.pVMR0, pReq->u.In.idCpu, pReq->u.In.uOperation, pVMMReq, pReq->u.In.u64Arg, pSession); 1349 1349 #else 1350 pReq->Hdr.rc = pDevExt->pfnVMMR0EntryEx(pReq->u.In.pVMR0, pReq->u.In. uOperation, pVMMReq, pReq->u.In.u64Arg, pSession);1350 pReq->Hdr.rc = pDevExt->pfnVMMR0EntryEx(pReq->u.In.pVMR0, pReq->u.In.idCpu, pReq->u.In.uOperation, pVMMReq, pReq->u.In.u64Arg, pSession); 1351 1351 #endif 1352 1352 else -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r18191 r19252 188 188 * and renaming the related IOCtls too. 189 189 */ 190 #define SUPDRV_IOC_VERSION 0x000 a0009190 #define SUPDRV_IOC_VERSION 0x000b0000 191 191 192 192 /** SUP_IOCTL_COOKIE. */ … … 527 527 /** The VM handle. */ 528 528 PVMR0 pVMR0; 529 /** VCPU id. */ 530 uint32_t idCpu; 529 531 /** Which operation to execute. */ 530 532 uint32_t uOperation; 531 #if R0_ARCH_BITS == 64532 /** Alignment. */533 uint32_t u32Reserved;534 #endif535 533 /** Argument to use when no request packet is supplied. */ 536 534 uint64_t u64Arg; -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r18479 r19252 570 570 DECLR0CALLBACKMEMBER(void, pfnVMMR0EntryFast, (PVM pVM, unsigned idCpu, unsigned uOperation)); 571 571 /** VMMR0EntryEx() pointer. */ 572 DECLR0CALLBACKMEMBER(int, pfnVMMR0EntryEx, (PVM pVM, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession));572 DECLR0CALLBACKMEMBER(int, pfnVMMR0EntryEx, (PVM pVM, unsigned idCpu, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession)); 573 573 574 574 /** Linked list of loaded code. */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r18761 r19252 582 582 583 583 584 SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr)584 SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, unsigned idCpu, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr) 585 585 { 586 586 /* … … 609 609 Req.Hdr.rc = VERR_INTERNAL_ERROR; 610 610 Req.u.In.pVMR0 = pVMR0; 611 Req.u.In.idCpu = idCpu; 611 612 Req.u.In.uOperation = uOperation; 612 613 Req.u.In.u64Arg = u64Arg; … … 629 630 pReq->Hdr.rc = VERR_INTERNAL_ERROR; 630 631 pReq->u.In.pVMR0 = pVMR0; 632 pReq->u.In.idCpu = idCpu; 631 633 pReq->u.In.uOperation = uOperation; 632 634 pReq->u.In.u64Arg = u64Arg; … … 643 645 644 646 645 SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg)647 SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, unsigned idCpu, unsigned uOperation, void *pvArg) 646 648 { 647 649 /* … … 653 655 ("%#x\n", uOperation), 654 656 VERR_INTERNAL_ERROR); 655 return SUPCallVMMR0Ex(pVMR0, uOperation, (uintptr_t)pvArg, NULL);657 return SUPCallVMMR0Ex(pVMR0, idCpu, uOperation, (uintptr_t)pvArg, NULL); 656 658 } 657 659 -
trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
r14831 r19252 124 124 for (i = cIterations; i > 0; i--) 125 125 { 126 rc = SUPCallVMMR0(pVMR0, VMMR0_DO_SLOW_NOP, NULL);126 rc = SUPCallVMMR0(pVMR0, 0, VMMR0_DO_SLOW_NOP, NULL); 127 127 if (rc != VINF_SUCCESS) 128 128 { … … 174 174 { 175 175 uint64_t OneStartTick = ASMReadTSC(); 176 rc = SUPCallVMMR0Ex(pVMR0, VMMR0_DO_SLOW_NOP, 0, NULL);176 rc = SUPCallVMMR0Ex(pVMR0, 0, VMMR0_DO_SLOW_NOP, 0, NULL); 177 177 uint64_t Ticks = ASMReadTSC() - OneStartTick; 178 178 if (Ticks < MinTicks) -
trunk/src/VBox/HostDrivers/Support/win/SUPDrvA-win.asm
r15838 r19252 170 170 171 171 ;; 172 ; @cproto DECLASM(int) supdrvNtWrapVMMR0EntryEx(PFNRT pfnVMMR0EntryEx, PVM pVM, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession);172 ; @cproto DECLASM(int) supdrvNtWrapVMMR0EntryEx(PFNRT pfnVMMR0EntryEx, PVM pVM, unsigned idCpu, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession); 173 173 ; 174 174 ; @param pfnVMMR0EntryEx rcx 175 175 ; @param pVM rdx 176 ; @param uOperation r8 177 ; @param pReq r9 178 ; @param u64Arg [rsp + 28h] / [rbp + 30h] 179 ; @param pSession [rsp + 30h] / [rbp + 38h] 176 ; @param idCpu r8 177 ; @param uOperation r9 178 ; @param pReq [rsp + 28h] / [rbp + 30h] 179 ; @param u64Arg [rsp + 30h] / [rbp + 38h] 180 ; @param pSession [rsp + 38h] / [rbp + 40h] 180 181 ; 181 182 BEGINPROC supdrvNtWrapVMMR0EntryEx … … 190 191 mov r11, [rbp + 38h] 191 192 mov [rsp + 20h], r11 193 mov r11, [rbp + 40h] 194 mov [rsp + 28h], r11 192 195 call rax 193 196 -
trunk/src/VBox/VMM/HWACCM.cpp
r18941 r19252 459 459 460 460 /* Enable VT-x or AMD-V on all host CPUs. */ 461 rc = SUPCallVMMR0Ex(pVM->pVMR0, VMMR0_DO_HWACC_ENABLE, 0, NULL);461 rc = SUPCallVMMR0Ex(pVM->pVMR0, 0 /* VCPU 0 */, VMMR0_DO_HWACC_ENABLE, 0, NULL); 462 462 if (RT_FAILURE(rc)) 463 463 { … … 828 828 } 829 829 830 rc = SUPCallVMMR0Ex(pVM->pVMR0, VMMR0_DO_HWACC_SETUP_VM, 0, NULL);830 rc = SUPCallVMMR0Ex(pVM->pVMR0, 0 /* VCPU 0 */, VMMR0_DO_HWACC_SETUP_VM, 0, NULL); 831 831 AssertRC(rc); 832 832 if (rc == VINF_SUCCESS) … … 936 936 pVM->hwaccm.s.fNestedPaging = pVM->hwaccm.s.fAllowNestedPaging; 937 937 938 rc = SUPCallVMMR0Ex(pVM->pVMR0, VMMR0_DO_HWACC_SETUP_VM, 0, NULL);938 rc = SUPCallVMMR0Ex(pVM->pVMR0, 0 /* VCPU 0 */, VMMR0_DO_HWACC_SETUP_VM, 0, NULL); 939 939 AssertRC(rc); 940 940 if (rc == VINF_SUCCESS) -
trunk/src/VBox/VMM/PDMDriver.cpp
r18645 r19252 949 949 if ( uOperation >= VMMR0_DO_SRV_START 950 950 && uOperation < VMMR0_DO_SRV_END) 951 rc = SUPCallVMMR0Ex(pDrvIns->Internal.s.pVM->pVMR0, uOperation, 0, (PSUPVMMR0REQHDR)pvArg);951 rc = SUPCallVMMR0Ex(pDrvIns->Internal.s.pVM->pVMR0, 0 /* idCpu not relevant */, uOperation, 0, (PSUPVMMR0REQHDR)pvArg); 952 952 else 953 953 { -
trunk/src/VBox/VMM/VM.cpp
r19238 r19252 511 511 CreateVMReq.pVMR3 = NULL; 512 512 CreateVMReq.cCPUs = cCPUs; 513 rc = SUPCallVMMR0Ex(NIL_RTR0PTR, VMMR0_DO_GVMM_CREATE_VM, 0, &CreateVMReq.Hdr);513 rc = SUPCallVMMR0Ex(NIL_RTR0PTR, 0 /* VCPU 0 */, VMMR0_DO_GVMM_CREATE_VM, 0, &CreateVMReq.Hdr); 514 514 if (RT_SUCCESS(rc)) 515 515 { … … 656 656 657 657 /* Tell GVMM that it can destroy the VM now. */ 658 int rc2 = SUPCallVMMR0Ex(CreateVMReq.pVMR0, VMMR0_DO_GVMM_DESTROY_VM, 0, NULL);658 int rc2 = SUPCallVMMR0Ex(CreateVMReq.pVMR0, 0 /* VCPU 0 */, VMMR0_DO_GVMM_DESTROY_VM, 0, NULL); 659 659 AssertRC(rc2); 660 660 pUVM->pVM = NULL; … … 1748 1748 * Tell GVMM to destroy the VM and free its resources. 1749 1749 */ 1750 int rc = SUPCallVMMR0Ex(pUVM->pVM->pVMR0, VMMR0_DO_GVMM_DESTROY_VM, 0, NULL);1750 int rc = SUPCallVMMR0Ex(pUVM->pVM->pVMR0, 0 /* VCPU 0 */, VMMR0_DO_GVMM_DESTROY_VM, 0, NULL); 1751 1751 AssertRC(rc); 1752 1752 pUVM->pVM = NULL; -
trunk/src/VBox/VMM/VMEmt.cpp
r19229 r19252 732 732 //RTLogRelPrintf("u64NanoTS=%RI64 cLoops=%3d sleep %02dms (%7RU64) ", u64NanoTS, cLoops, cMilliSecs, u64NanoTS); 733 733 STAM_REL_PROFILE_START(&pUVCpu->vm.s.StatHaltBlock, c); 734 rc = SUPCallVMMR0Ex(pVM->pVMR0, VMMR0_DO_GVMM_SCHED_HALT, u64GipTime, NULL);734 rc = SUPCallVMMR0Ex(pVM->pVMR0, pVCpu->idCpu, VMMR0_DO_GVMM_SCHED_HALT, u64GipTime, NULL); 735 735 STAM_REL_PROFILE_STOP(&pUVCpu->vm.s.StatHaltBlock, c); 736 736 if (rc == VERR_INTERRUPTED) … … 752 752 { 753 753 STAM_REL_PROFILE_START(&pUVCpu->vm.s.StatHaltYield, d); 754 rc = SUPCallVMMR0Ex(pVM->pVMR0, VMMR0_DO_GVMM_SCHED_POLL, false /* don't yield */, NULL);754 rc = SUPCallVMMR0Ex(pVM->pVMR0, pVCpu->idCpu, VMMR0_DO_GVMM_SCHED_POLL, false /* don't yield */, NULL); 755 755 STAM_REL_PROFILE_STOP(&pUVCpu->vm.s.StatHaltYield, d); 756 756 } … … 790 790 * anything needs our attention. 791 791 */ 792 rc = SUPCallVMMR0Ex(pVM->pVMR0, VMMR0_DO_GVMM_SCHED_HALT, RTTimeNanoTS() + 1000000000 /* +1s */, NULL);792 rc = SUPCallVMMR0Ex(pVM->pVMR0, pVCpu->idCpu, VMMR0_DO_GVMM_SCHED_HALT, RTTimeNanoTS() + 1000000000 /* +1s */, NULL); 793 793 if (rc == VERR_INTERRUPTED) 794 794 rc = VINF_SUCCESS; … … 819 819 if (pUVCpu->vm.s.fWait) 820 820 { 821 int rc = SUPCallVMMR0Ex(pUVCpu->pVM->pVMR0, VMMR0_DO_GVMM_SCHED_WAKE_UP, 0, NULL);821 int rc = SUPCallVMMR0Ex(pUVCpu->pVM->pVMR0, pUVCpu->idCpu, VMMR0_DO_GVMM_SCHED_WAKE_UP, 0, NULL); 822 822 AssertRC(rc); 823 823 } -
trunk/src/VBox/VMM/VMM.cpp
r19232 r19252 463 463 rc = VINF_SUCCESS; 464 464 #else 465 rc = SUPCallVMMR0Ex(pVM->pVMR0, VMMR0_DO_VMMR0_INIT, VMMGetSvnRev(), NULL);465 rc = SUPCallVMMR0Ex(pVM->pVMR0, 0 /* VCPU 0 */, VMMR0_DO_VMMR0_INIT, VMMGetSvnRev(), NULL); 466 466 #endif 467 467 if ( pVM->vmm.s.pR0LoggerR3 … … 532 532 rc = VINF_SUCCESS; 533 533 #else 534 rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_CALL_HYPERVISOR, NULL);534 rc = SUPCallVMMR0(pVM->pVMR0, 0 /* VCPU 0 */, VMMR0_DO_CALL_HYPERVISOR, NULL); 535 535 #endif 536 536 #ifdef LOG_ENABLED … … 582 582 rc = VINF_SUCCESS; 583 583 #else 584 rc = SUPCallVMMR0Ex(pVM->pVMR0, VMMR0_DO_VMMR0_TERM, 0, NULL);584 rc = SUPCallVMMR0Ex(pVM->pVMR0, 0 /* VCPU 0 */, VMMR0_DO_VMMR0_TERM, 0, NULL); 585 585 #endif 586 586 if ( pVM->vmm.s.pR0LoggerR3 … … 1291 1291 VMMR3DECL(int) VMMR3CallR0(PVM pVM, uint32_t uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr) 1292 1292 { 1293 PVMCPU pVCpu = VMMGetCpu(pVM); 1294 AssertReturn(pVCpu, VERR_VM_THREAD_NOT_EMT); 1295 1293 1296 /* 1294 1297 * Call Ring-0 entry with init code. … … 1300 1303 rc = VERR_GENERAL_FAILURE; 1301 1304 #else 1302 rc = SUPCallVMMR0Ex(pVM->pVMR0, uOperation, u64Arg, pReqHdr);1305 rc = SUPCallVMMR0Ex(pVM->pVMR0, pVCpu->idCpu, uOperation, u64Arg, pReqHdr); 1303 1306 #endif 1304 1307 if ( pVM->vmm.s.pR0LoggerR3 -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r19232 r19252 691 691 * @returns VBox status code. 692 692 * @param pVM The VM to operate on. 693 * @param idCpu VMCPU id. 693 694 * @param enmOperation Which operation to execute. 694 695 * @param pReqHdr This points to a SUPVMMR0REQHDR packet. Optional. … … 698 699 * @remarks Assume called with interrupts _enabled_. 699 700 */ 700 static int vmmR0EntryExWorker(PVM pVM, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReqHdr, uint64_t u64Arg, PSUPDRVSESSION pSession)701 static int vmmR0EntryExWorker(PVM pVM, unsigned idCpu, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReqHdr, uint64_t u64Arg, PSUPDRVSESSION pSession) 701 702 { 702 703 /* … … 992 993 993 994 /** 994 * Argument for vmmR0EntryExWrapper containing the argument s ofr VMMR0EntryEx.995 * Argument for vmmR0EntryExWrapper containing the arguments for VMMR0EntryEx. 995 996 */ 996 997 typedef struct VMMR0ENTRYEXARGS 997 998 { 998 999 PVM pVM; 1000 unsigned idCpu; 999 1001 VMMR0OPERATION enmOperation; 1000 1002 PSUPVMMR0REQHDR pReq; … … 1014 1016 { 1015 1017 return vmmR0EntryExWorker(((PVMMR0ENTRYEXARGS)pvArgs)->pVM, 1018 ((PVMMR0ENTRYEXARGS)pvArgs)->idCpu, 1016 1019 ((PVMMR0ENTRYEXARGS)pvArgs)->enmOperation, 1017 1020 ((PVMMR0ENTRYEXARGS)pvArgs)->pReq, … … 1026 1029 * @returns VBox status code. 1027 1030 * @param pVM The VM to operate on. 1031 * @param idCpu VMCPU id. 1028 1032 * @param enmOperation Which operation to execute. 1029 1033 * @param pReq This points to a SUPVMMR0REQHDR packet. Optional. … … 1032 1036 * @remarks Assume called with interrupts _enabled_. 1033 1037 */ 1034 VMMR0DECL(int) VMMR0EntryEx(PVM pVM, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession)1038 VMMR0DECL(int) VMMR0EntryEx(PVM pVM, unsigned idCpu, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession) 1035 1039 { 1036 1040 /* … … 1060 1064 VMMR0ENTRYEXARGS Args; 1061 1065 Args.pVM = pVM; 1066 Args.idCpu = idCpu; 1062 1067 Args.enmOperation = enmOperation; 1063 1068 Args.pReq = pReq; … … 1071 1076 } 1072 1077 } 1073 return vmmR0EntryExWorker(pVM, enmOperation, pReq, u64Arg, pSession);1078 return vmmR0EntryExWorker(pVM, idCpu, enmOperation, pReq, u64Arg, pSession); 1074 1079 } 1075 1080 -
trunk/src/VBox/VMM/testcase/tstGlobalConfig.cpp
r11822 r19252 107 107 { 108 108 Req.pSession = pSession; 109 rc = SUPCallVMMR0Ex(NIL_RTR0PTR, enmOp, 0, &Req.Hdr);109 rc = SUPCallVMMR0Ex(NIL_RTR0PTR, 0 /* VCPU 0 */, enmOp, 0, &Req.Hdr); 110 110 if (RT_SUCCESS(rc)) 111 111 {
Note:
See TracChangeset
for help on using the changeset viewer.