Changeset 19957 in vbox
- Timestamp:
- May 24, 2009 2:47:43 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 47659
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r19955 r19957 496 496 ## For experimenting with linking libxml2 into VBoxRT. 497 497 #VBOX_WITH_LIBXML2_IN_VBOXRT = 1 498 499 ## For experimenting with disabling preemption instead of interrupts 500 # when working VT-x/AMD-V in VMMR0. 501 ## @todo Move to VMM/Makefile.kmk later. 502 #if1of ($(KBUILD_TARGET), darwin linux) 503 # VBOX_WITH_VMMR0_DISABLE_PREEMPTION=1 504 #endif 498 505 499 506 # -
trunk/src/VBox/HostDrivers/Support/Makefile.kmk
r19892 r19957 164 164 VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER 165 165 VBoxDrv_DEFS.amd64 = RT_WITH_W64_UNWIND_HACK 166 ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 167 VBoxDrv_DEFS += VBOX_WITH_VMMR0_DISABLE_PREEMPTION 168 endif 166 169 VBoxDrv_SDKS = W2K3DDK WINPSDKINCS 167 170 VBoxDrv_INCS := $(PATH_SUB_CURRENT) -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r18478 r19957 322 322 || ulCmd == SUP_IOCTL_FAST_DO_NOP) 323 323 { 324 /* Raise the IRQL to DISPATCH_LEVEl to prevent Windows from rescheduling us to another CPU/core. */ 324 #ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 325 int rc = supdrvIOCtlFast(ulCmd, (unsigned)(uintptr_t)pIrp->UserBuffer /* VMCPU id */, pDevExt, pSession); 326 #else 327 /* Raise the IRQL to DISPATCH_LEVEL to prevent Windows from rescheduling us to another CPU/core. */ 325 328 Assert(KeGetCurrentIrql() <= DISPATCH_LEVEL); 326 329 KIRQL oldIrql; … … 328 331 int rc = supdrvIOCtlFast(ulCmd, (unsigned)(uintptr_t)pIrp->UserBuffer /* VMCPU id */, pDevExt, pSession); 329 332 KeLowerIrql(oldIrql); 333 #endif 330 334 331 335 /* Complete the I/O request. */ -
trunk/src/VBox/VMM/Makefile.kmk
r19757 r19957 406 406 VMMR0_DEFS += VBOX_WITH_R0_LOGGING 407 407 endif 408 ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 409 VMMR0_DEFS += VBOX_WITH_VMMR0_DISABLE_PREEMPTION 410 endif 408 411 VMMR0_DEFS.darwin.x86 = \ 409 412 VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 \ -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r19910 r19957 44 44 #include <iprt/cpuset.h> 45 45 #include <iprt/mp.h> 46 #ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 47 # include <iprt/thread.h> 48 #endif 46 49 #include "HWSVMR0.h" 47 50 … … 915 918 } 916 919 920 #ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 921 /** @todo This must be repeated (or moved down) after we've disabled interrupts 922 * below because a rescheduling request (IPI) might arrive before we get 923 * there and we end up exceeding our timeslice. (Putting it here for 924 * now because I don't want to mess up anything.) */ 925 if (RTThreadPreemptIsPending(NIL_RTTHREAD)) 926 { 927 rc = VINF_EM_RAW_INTERRUPT_HYPER; 928 goto end; 929 } 930 #endif 931 917 932 /* When external interrupts are pending, we should exit the VM when IF is set. */ 918 933 /* Note! *After* VM_FF_INHIBIT_INTERRUPTS check!!! */ … … 989 1004 } 990 1005 991 /* Disable interrupts to make sure a poke will interrupt execution. 1006 /* Disable interrupts to make sure a poke will interrupt execution. 992 1007 * This must be done *before* we check for TLB flushes; TLB shootdowns rely on this. 993 1008 */ -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r19913 r19957 36 36 #include <VBox/iom.h> 37 37 #include <VBox/rem.h> 38 #include <iprt/asm.h> 39 #include <iprt/assert.h> 38 40 #include <iprt/param.h> 39 #include <iprt/assert.h>40 #include <iprt/asm.h>41 41 #include <iprt/string.h> 42 #ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 43 # include <iprt/thread.h> 44 #endif 42 45 #include "HWVMXR0.h" 43 46 … … 2111 2114 } 2112 2115 2116 #ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 2117 /** @todo This must be repeated (or moved down) after we've disabled interrupts 2118 * below because a rescheduling request (IPI) might arrive before we get 2119 * there and we end up exceeding our timeslice. (Putting it here for 2120 * now because I don't want to mess up anything.) */ 2121 if (RTThreadPreemptIsPending(NIL_RTTHREAD)) 2122 { 2123 rc = VINF_EM_RAW_INTERRUPT_HYPER; 2124 goto end; 2125 } 2126 #endif 2127 2113 2128 /* When external interrupts are pending, we should exit the VM when IF is set. */ 2114 2129 /* Note! *After* VM_FF_INHIBIT_INTERRUPTS check!!! */ … … 2196 2211 goto end; 2197 2212 2198 /* Disable interrupts to make sure a poke will interrupt execution. 2213 /* Disable interrupts to make sure a poke will interrupt execution. 2199 2214 * This must be done *before* we check for TLB flushes; TLB shootdowns rely on this. 2200 2215 */ -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r19734 r19957 33 33 #include "VMMInternal.h" 34 34 #include <VBox/vm.h> 35 35 36 #include <VBox/gvmm.h> 36 37 #include <VBox/gmm.h> … … 38 39 #include <VBox/hwaccm.h> 39 40 #include <VBox/param.h> 40 41 41 #include <VBox/err.h> 42 42 #include <VBox/version.h> 43 43 #include <VBox/log.h> 44 44 45 #include <iprt/assert.h> 46 #include <iprt/mp.h> 45 47 #include <iprt/stdarg.h> 46 #include <iprt/mp.h>47 48 #include <iprt/string.h> 49 #ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 50 # include <iprt/thread.h> 51 #endif 48 52 49 53 #if defined(_MSC_VER) && defined(RT_ARCH_AMD64) /** @todo check this with with VC7! */ … … 624 628 STAM_COUNTER_INC(&pVM->vmm.s.StatRunRC); 625 629 626 #if !defined(RT_OS_WINDOWS) /** @todo check other hosts */ 630 #ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 631 RTTHREADPREEMPTSTATE PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER; 632 RTThreadPreemptDisable(&PreemptState); 633 #elif !defined(RT_OS_WINDOWS) 627 634 RTCCUINTREG uFlags = ASMIntDisableFlags(); 628 635 #endif … … 660 667 661 668 ASMAtomicWriteU32(&pVCpu->idHostCpu, NIL_RTCPUID); 662 #if !defined(RT_OS_WINDOWS) /** @todo check other hosts */ 669 #ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 670 RTThreadPreemptRestore(&PreemptState); 671 #else !defined(RT_OS_WINDOWS) 663 672 ASMSetFlags(uFlags); 664 673 #endif
Note:
See TracChangeset
for help on using the changeset viewer.