- Timestamp:
- Jul 17, 2008 1:08:56 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm.h
r10450 r10724 370 370 /** Official NOP that we use for profiling. */ 371 371 VMMR0_DO_NOP = SUP_VMMR0_DO_NOP, 372 /** Official slow iocl NOP that we use for profiling. */ 373 VMMR0_DO_SLOW_NOP, 372 374 373 375 /** Ask the GVMM to create a new VM. */ … … 493 495 * @remarks Assume called with interrupts _enabled_. 494 496 */ 495 VMMR0DECL( int) VMMR0EntryFast(PVM pVM, VMMR0OPERATION enmOperation);497 VMMR0DECL(void) VMMR0EntryFast(PVM pVM, VMMR0OPERATION enmOperation); 496 498 497 499 /** -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r10697 r10724 717 717 int VBOXCALL supdrvIOCtlFast(uintptr_t uIOCtl, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession) 718 718 { 719 int rc;720 721 719 /* 722 720 * We check the two prereqs after doing this only to allow the compiler to optimize things better. … … 727 725 { 728 726 case SUP_IOCTL_FAST_DO_RAW_RUN: 729 rc =pDevExt->pfnVMMR0EntryFast(pSession->pVM, SUP_VMMR0_DO_RAW_RUN);727 pDevExt->pfnVMMR0EntryFast(pSession->pVM, SUP_VMMR0_DO_RAW_RUN); 730 728 break; 731 729 case SUP_IOCTL_FAST_DO_HWACC_RUN: 732 rc =pDevExt->pfnVMMR0EntryFast(pSession->pVM, SUP_VMMR0_DO_HWACC_RUN);730 pDevExt->pfnVMMR0EntryFast(pSession->pVM, SUP_VMMR0_DO_HWACC_RUN); 733 731 break; 734 732 case SUP_IOCTL_FAST_DO_NOP: 735 rc =pDevExt->pfnVMMR0EntryFast(pSession->pVM, SUP_VMMR0_DO_NOP);733 pDevExt->pfnVMMR0EntryFast(pSession->pVM, SUP_VMMR0_DO_NOP); 736 734 break; 737 735 default: 738 rc = VERR_INTERNAL_ERROR; 739 break; 740 } 741 } 742 else 743 rc = VERR_INTERNAL_ERROR; 744 745 return rc; 736 return VERR_INTERNAL_ERROR; 737 } 738 return VINF_SUCCESS; 739 } 740 return VERR_INTERNAL_ERROR; 746 741 } 747 742 -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r10680 r10724 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 70005184 #define SUPDRV_IOC_VERSION 0x00080000 185 185 186 186 /** SUP_IOCTL_COOKIE. */ -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r10377 r10724 615 615 DECLR0CALLBACKMEMBER(int, pfnVMMR0EntryInt, (PVM pVM, unsigned uOperation, void *pvArg)); 616 616 /** VMMR0EntryFast() pointer. */ 617 DECLR0CALLBACKMEMBER( int, pfnVMMR0EntryFast, (PVM pVM, unsigned uOperation));617 DECLR0CALLBACKMEMBER(void, pfnVMMR0EntryFast, (PVM pVM, unsigned uOperation)); 618 618 /** VMMR0EntryEx() pointer. */ 619 619 DECLR0CALLBACKMEMBER(int, pfnVMMR0EntryEx, (PVM pVM, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg)); -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r10720 r10724 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) == 0x00070000215 ? 0x000 70005 /* need new exports */216 : SUPDRV_IOC_VERSION & 0xffff0000;214 const uint32_t MinVersion = /*(SUPDRV_IOC_VERSION & 0xffff0000) == 0x000y0000 215 ? 0x000y000x 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/HostDrivers/Support/testcase/tstInt.cpp
r8155 r10724 111 111 pVM->paVMPagesR3 = paPages; 112 112 pVM->pSession = pSession; 113 pVM->enmVMState = VMSTATE_CREATED; 113 114 114 115 rc = SUPSetVMForFastIOCtl(pVMR0); … … 121 122 for (i = cIterations; i > 0; i--) 122 123 { 123 rc = SUPCallVMMR0(pVMR0, VMMR0_DO_ NOP, NULL);124 rc = SUPCallVMMR0(pVMR0, VMMR0_DO_SLOW_NOP, NULL); 124 125 if (rc != VINF_SUCCESS) 125 126 { … … 132 133 133 134 /* 134 * Profile it.135 * The fast path. 135 136 */ 136 if ( !rc)137 if (rc == VINF_SUCCESS) 137 138 { 138 139 RTTimeNanoTS(); … … 143 144 { 144 145 uint64_t OneStartTick = ASMReadTSC(); 145 rc = SUPCallVMMR0 (pVMR0, VMMR0_DO_NOP, NULL);146 rc = SUPCallVMMR0Fast(pVMR0, VMMR0_DO_NOP); 146 147 uint64_t Ticks = ASMReadTSC() - OneStartTick; 147 148 if (Ticks < MinTicks) … … 150 151 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 151 152 { 152 RTPrintf("tstInt: SUPCallVMMR0 -> rc=%Vrc i=%d Expected VINF_SUCCESS!\n", rc, i);153 RTPrintf("tstInt: SUPCallVMMR0Fast -> rc=%Vrc i=%d Expected VINF_SUCCESS!\n", rc, i); 153 154 rcRet++; 154 155 break; … … 158 159 uint64_t NanoSecs = RTTimeNanoTS() - StartTS; 159 160 160 RTPrintf("tstInt: SUPCallVMMR0 161 RTPrintf("tstInt: SUPCallVMMR0Fast - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n", 161 162 i, NanoSecs, Ticks, NanoSecs / i, Ticks / i, MinTicks); 162 163 … … 172 173 { 173 174 uint64_t OneStartTick = ASMReadTSC(); 174 rc = SUPCallVMMR0 Fast(pVMR0, VMMR0_DO_NOP);175 rc = SUPCallVMMR0(pVMR0, VMMR0_DO_NOP, NULL); 175 176 uint64_t Ticks = ASMReadTSC() - OneStartTick; 176 177 if (Ticks < MinTicks) … … 179 180 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 180 181 { 181 RTPrintf("tstInt: SUPCallVMMR0 -> rc=%Vrc i=%d Expected VINF_SUCCESS!\n", rc, i);182 RTPrintf("tstInt: SUPCallVMMR0/idt -> rc=%Vrc i=%d Expected VINF_SUCCESS!\n", rc, i); 182 183 rcRet++; 183 184 break; … … 187 188 NanoSecs = RTTimeNanoTS() - StartTS; 188 189 189 RTPrintf("tstInt: SUPCallVMMR0 Fast - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n",190 RTPrintf("tstInt: SUPCallVMMR0/idt - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n", 190 191 i, NanoSecs, Ticks, NanoSecs / i, Ticks / i, MinTicks); 191 192 #endif /* VBOX_WITH_IDT_PATCHING */ … … 201 202 { 202 203 uint64_t OneStartTick = ASMReadTSC(); 203 rc = SUPCallVMMR0Ex(pVMR0, VMMR0_DO_ NOP, 0, NULL);204 rc = SUPCallVMMR0Ex(pVMR0, VMMR0_DO_SLOW_NOP, 0, NULL); 204 205 uint64_t Ticks = ASMReadTSC() - OneStartTick; 205 206 if (Ticks < MinTicks) … … 208 209 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 209 210 { 210 RTPrintf("tstInt: SUPCallVMMR0 -> rc=%Vrc i=%d Expected VINF_SUCCESS!\n", rc, i);211 RTPrintf("tstInt: SUPCallVMMR0Ex -> rc=%Vrc i=%d Expected VINF_SUCCESS!\n", rc, i); 211 212 rcRet++; 212 213 break; -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r10720 r10724 287 287 * Deal with the two high-speed IOCtl that takes it's arguments from 288 288 * the session and iCmd, and only returns a VBox status code. 289 * 290 * Note: The previous method of returning the rc prior to IDC version 291 * 7.4 has been abandond, we're no longer compatible with that 292 * interface. 289 293 */ 290 294 ULONG ulCmd = pStack->Parameters.DeviceIoControl.IoControlCode; … … 293 297 || ulCmd == SUP_IOCTL_FAST_DO_NOP) 294 298 { 295 KIRQL oldIrql;296 int rc;297 298 /* We're here with METHOD_NEITHER, which means no parameter validation has been performed. Do not use input299 * or write to output parameters!300 */301 302 299 /* Raise the IRQL to DISPATCH_LEVEl to prevent Windows from rescheduling us to another CPU/core. */ 303 300 Assert(KeGetCurrentIrql() <= DISPATCH_LEVEL); 301 KIRQL oldIrql; 304 302 KeRaiseIrql(DISPATCH_LEVEL, &oldIrql); 305 rc = supdrvIOCtlFast(ulCmd, pDevExt, pSession);303 int rc = supdrvIOCtlFast(ulCmd, pDevExt, pSession); 306 304 KeLowerIrql(oldIrql); 307 305 308 306 /* Complete the I/O request. */ 309 NTSTATUS rcNt = pIrp->IoStatus.Status = STATUS_SUCCESS;307 NTSTATUS rcNt = pIrp->IoStatus.Status = RT_SUCCESS(rc) ? STATUS_SUCCESS : STATUS_INVALID_PARAMETER; 310 308 IoCompleteRequest(pIrp, IO_NO_INCREMENT); 311 309 return rcNt; -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r10721 r10724 568 568 * The Ring 0 entry point, called by the fast-ioctl path. 569 569 * 570 * @returns VBox status code.571 570 * @param pVM The VM to operate on. 571 * The return code is stored in pVM->vmm.s.iLastGCRc. 572 572 * @param enmOperation Which operation to execute. 573 573 * @remarks Assume called with interrupts _enabled_. 574 574 */ 575 VMMR0DECL( int) VMMR0EntryFast(PVM pVM, VMMR0OPERATION enmOperation)575 VMMR0DECL(void) VMMR0EntryFast(PVM pVM, VMMR0OPERATION enmOperation) 576 576 { 577 577 switch (enmOperation) … … 601 601 vmmR0RecordRC(pVM, rc); 602 602 #endif 603 return rc;604 603 } 605 606 Assert(!pVM->vmm.s.fSwitcherDisabled); 607 pVM->vmm.s.iLastGCRc = VERR_NOT_SUPPORTED; 608 break; 609 } 604 else 605 { 606 Assert(!pVM->vmm.s.fSwitcherDisabled); 607 pVM->vmm.s.iLastGCRc = VERR_NOT_SUPPORTED; 608 } 609 break; 610 } 610 611 611 612 /* … … 639 640 #endif 640 641 /* No special action required for external interrupts, just return. */ 641 return rc;642 break; 642 643 } 643 644 … … 647 648 case VMMR0_DO_NOP: 648 649 pVM->vmm.s.iLastGCRc = VINF_SUCCESS; 649 return VINF_SUCCESS;650 break; 650 651 651 652 /* … … 657 658 break; 658 659 } 659 /* Error case, but the error was written to pVM->vmm.s.iLastGCRc */660 return VINF_SUCCESS;661 660 } 662 661 … … 910 909 */ 911 910 case VMMR0_DO_NOP: 911 case VMMR0_DO_SLOW_NOP: 912 912 return VINF_SUCCESS; 913 913
Note:
See TracChangeset
for help on using the changeset viewer.