Changeset 22609 in vbox
- Timestamp:
- Aug 31, 2009 2:34:02 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/err.h
r22334 r22609 1237 1237 /** The service module was not found. */ 1238 1238 #define VERR_SUPDRV_SERVICE_NOT_FOUND (-3702) 1239 /** The host kernel is too old. */ 1240 #define VERR_SUPDRV_KERNEL_TOO_OLD_FOR_VTX (-3703) 1239 1241 /** @} */ 1240 1242 -
trunk/include/VBox/sup.h
r22235 r22609 995 995 SUPR0DECL(SUPPAGINGMODE) SUPR0GetPagingMode(void); 996 996 SUPR0DECL(int) SUPR0EnableVTx(bool fEnable); 997 SUPR0DECL(int) SUPR0QueryVTxSupport(void); 997 998 998 999 /** @name Absolute symbols -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r22236 r22609 352 352 { "SUPR0GetPagingMode", (void *)UNWIND_WRAP(SUPR0GetPagingMode) }, 353 353 { "SUPR0EnableVTx", (void *)SUPR0EnableVTx }, 354 { "SUPR0QueryVTxSupport", (void *)SUPR0QueryVTxSupport }, 354 355 { "RTMemAlloc", (void *)UNWIND_WRAP(RTMemAlloc) }, 355 356 { "RTMemAllocZ", (void *)UNWIND_WRAP(RTMemAllocZ) }, … … 4794 4795 4795 4796 /** 4797 * Check if the host kernel can run in VMX root mode. 4798 * 4799 * @returns VINF_SUCCESS if supported, error code indicating why if not. 4800 */ 4801 SUPR0DECL(int) SUPR0QueryVTxSupport(void) 4802 { 4803 #ifdef RT_OS_LINUX 4804 return supdrvOSQueryVTxSupport(); 4805 #else 4806 return VINF_SUCCESS; 4807 #endif 4808 } 4809 4810 4811 /** 4796 4812 * Creates the GIP. 4797 4813 * -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r22150 r22609 184 184 * 185 185 * Update rules: 186 * -# Only update the major number when incompatible changes ha sbeen made to186 * -# Only update the major number when incompatible changes have been made to 187 187 * the IOC interface or the ABI provided via the functions returned by 188 188 * SUPQUERYFUNCS. … … 197 197 * - Nothing. 198 198 */ 199 #define SUPDRV_IOC_VERSION 0x000f000 0199 #define SUPDRV_IOC_VERSION 0x000f0001 200 200 201 201 /** SUP_IOCTL_COOKIE. */ -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r22236 r22609 632 632 bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDEVEXT pDevExt); 633 633 int VBOXCALL supdrvOSEnableVTx(bool fEnabled); 634 int VBOXCALL supdrvOSQueryVTxSupport(void); 634 635 635 636 /******************************************************************************* -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r22150 r22609 273 273 CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION; 274 274 const uint32_t MinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x000f0000 275 ? 0x000f000 0275 ? 0x000f0001 276 276 : SUPDRV_IOC_VERSION & 0xffff0000; 277 277 CookieReq.u.In.u32MinVersion = MinVersion; … … 413 413 { "SUPR0Printf", 0xefef000b }, 414 414 { "SUPR0GetPagingMode", 0xefef000c }, 415 { "SUPR0EnableVTx", 0xefef000c }, 416 { "RTMemAlloc", 0xefef000d }, 417 { "RTMemAllocZ", 0xefef000e }, 418 { "RTMemFree", 0xefef000f }, 419 { "RTR0MemObjAddress", 0xefef0010 }, 420 { "RTR0MemObjAddressR3", 0xefef0011 }, 421 { "RTR0MemObjAllocPage", 0xefef0012 }, 422 { "RTR0MemObjAllocPhysNC", 0xefef0013 }, 423 { "RTR0MemObjAllocLow", 0xefef0014 }, 424 { "RTR0MemObjEnterPhys", 0xefef0014 }, 425 { "RTR0MemObjFree", 0xefef0015 }, 426 { "RTR0MemObjGetPagePhysAddr", 0xefef0016 }, 427 { "RTR0MemObjMapUser", 0xefef0017 }, 428 { "RTR0MemObjMapKernel", 0xefef0017 }, 429 { "RTR0MemObjMapKernelEx", 0xefef0017 }, 430 { "RTProcSelf", 0xefef0038 }, 431 { "RTR0ProcHandleSelf", 0xefef0039 }, 432 { "RTSemEventCreate", 0xefef0018 }, 433 { "RTSemEventSignal", 0xefef0019 }, 434 { "RTSemEventWait", 0xefef001a }, 435 { "RTSemEventWaitNoResume", 0xefef001b }, 436 { "RTSemEventDestroy", 0xefef001c }, 437 { "RTSemEventMultiCreate", 0xefef001d }, 438 { "RTSemEventMultiSignal", 0xefef001e }, 439 { "RTSemEventMultiReset", 0xefef001f }, 440 { "RTSemEventMultiWait", 0xefef0020 }, 441 { "RTSemEventMultiWaitNoResume", 0xefef0021 }, 442 { "RTSemEventMultiDestroy", 0xefef0022 }, 443 { "RTSemFastMutexCreate", 0xefef0023 }, 444 { "RTSemFastMutexDestroy", 0xefef0024 }, 445 { "RTSemFastMutexRequest", 0xefef0025 }, 446 { "RTSemFastMutexRelease", 0xefef0026 }, 447 { "RTSpinlockCreate", 0xefef0027 }, 448 { "RTSpinlockDestroy", 0xefef0028 }, 449 { "RTSpinlockAcquire", 0xefef0029 }, 450 { "RTSpinlockRelease", 0xefef002a }, 451 { "RTSpinlockAcquireNoInts", 0xefef002b }, 452 { "RTSpinlockReleaseNoInts", 0xefef002c }, 453 { "RTTimeNanoTS", 0xefef002d }, 454 { "RTTimeMillieTS", 0xefef002e }, 455 { "RTTimeSystemNanoTS", 0xefef002f }, 456 { "RTTimeSystemMillieTS", 0xefef0030 }, 457 { "RTThreadNativeSelf", 0xefef0031 }, 458 { "RTThreadSleep", 0xefef0032 }, 459 { "RTThreadYield", 0xefef0033 }, 460 { "RTLogDefaultInstance", 0xefef0034 }, 461 { "RTLogRelDefaultInstance", 0xefef0035 }, 462 { "RTLogSetDefaultInstanceThread", 0xefef0036 }, 463 { "RTLogLogger", 0xefef0037 }, 464 { "RTLogLoggerEx", 0xefef0038 }, 465 { "RTLogLoggerExV", 0xefef0039 }, 466 { "AssertMsg1", 0xefef003a }, 467 { "AssertMsg2", 0xefef003b }, 468 { "RTAssertMsg1", 0xefef003c }, 469 { "RTAssertMsg2", 0xefef003d }, 470 { "RTAssertMsg2V", 0xefef003e }, 415 { "SUPR0QueryVTxSupport", 0xefef000d }, 416 { "SUPR0EnableVTx", 0xefef000e }, 417 { "RTMemAlloc", 0xefef000f }, 418 { "RTMemAllocZ", 0xefef0010 }, 419 { "RTMemFree", 0xefef0011 }, 420 { "RTR0MemObjAddress", 0xefef0012 }, 421 { "RTR0MemObjAddressR3", 0xefef0013 }, 422 { "RTR0MemObjAllocPage", 0xefef0014 }, 423 { "RTR0MemObjAllocPhysNC", 0xefef0015 }, 424 { "RTR0MemObjAllocLow", 0xefef0016 }, 425 { "RTR0MemObjEnterPhys", 0xefef0017 }, 426 { "RTR0MemObjFree", 0xefef0018 }, 427 { "RTR0MemObjGetPagePhysAddr", 0xefef0019 }, 428 { "RTR0MemObjMapUser", 0xefef001a }, 429 { "RTR0MemObjMapKernel", 0xefef001b }, 430 { "RTR0MemObjMapKernelEx", 0xefef001c }, 431 { "RTProcSelf", 0xefef001d }, 432 { "RTR0ProcHandleSelf", 0xefef001e }, 433 { "RTSemEventCreate", 0xefef001f }, 434 { "RTSemEventSignal", 0xefef0020 }, 435 { "RTSemEventWait", 0xefef0021 }, 436 { "RTSemEventWaitNoResume", 0xefef0022 }, 437 { "RTSemEventDestroy", 0xefef0023 }, 438 { "RTSemEventMultiCreate", 0xefef0024 }, 439 { "RTSemEventMultiSignal", 0xefef0025 }, 440 { "RTSemEventMultiReset", 0xefef0026 }, 441 { "RTSemEventMultiWait", 0xefef0027 }, 442 { "RTSemEventMultiWaitNoResume", 0xefef0028 }, 443 { "RTSemEventMultiDestroy", 0xefef0029 }, 444 { "RTSemFastMutexCreate", 0xefef002a }, 445 { "RTSemFastMutexDestroy", 0xefef002b }, 446 { "RTSemFastMutexRequest", 0xefef002c }, 447 { "RTSemFastMutexRelease", 0xefef002d }, 448 { "RTSpinlockCreate", 0xefef002e }, 449 { "RTSpinlockDestroy", 0xefef002f }, 450 { "RTSpinlockAcquire", 0xefef0030 }, 451 { "RTSpinlockRelease", 0xefef0031 }, 452 { "RTSpinlockAcquireNoInts", 0xefef0032 }, 453 { "RTSpinlockReleaseNoInts", 0xefef0033 }, 454 { "RTTimeNanoTS", 0xefef0034 }, 455 { "RTTimeMillieTS", 0xefef0035 }, 456 { "RTTimeSystemNanoTS", 0xefef0036 }, 457 { "RTTimeSystemMillieTS", 0xefef0037 }, 458 { "RTThreadNativeSelf", 0xefef0038 }, 459 { "RTThreadSleep", 0xefef0039 }, 460 { "RTThreadYield", 0xefef003a }, 461 { "RTLogDefaultInstance", 0xefef003b }, 462 { "RTLogRelDefaultInstance", 0xefef003c }, 463 { "RTLogSetDefaultInstanceThread", 0xefef003d }, 464 { "RTLogLogger", 0xefef003e }, 465 { "RTLogLoggerEx", 0xefef003f }, 466 { "RTLogLoggerExV", 0xefef0040 }, 467 { "AssertMsg1", 0xefef0041 }, 468 { "AssertMsg2", 0xefef0042 }, 469 { "RTAssertMsg1", 0xefef0043 }, 470 { "RTAssertMsg2", 0xefef0044 }, 471 { "RTAssertMsg2V", 0xefef0045 }, 471 472 }; 472 473 -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r21955 r22609 44 44 #include <iprt/initterm.h> 45 45 #include <iprt/process.h> 46 #include < iprt/err.h>46 #include <VBox/err.h> 47 47 #include <iprt/mem.h> 48 48 #include <VBox/log.h> … … 1006 1006 1007 1007 /** 1008 * Check if the host kernel supports VT-x or not. 1009 * 1010 * Older Linux kernels clear the VMXE bit in the CR4 register (function 1011 * tlb_flush_all()) leading to a host kernel panic. 1012 * 1013 * @returns VBox error code 1014 */ 1015 int VBOXCALL supdrvOSQueryVTxSupport(void) 1016 { 1017 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) 1018 return VINF_SUCCESS; 1019 #else 1020 return VERR_SUPDRV_KERNEL_TOO_OLD_FOR_VTX; 1021 #endif 1022 } 1023 1024 1025 /** 1008 1026 * Converts a supdrv error code to an linux error code. 1009 1027 * -
trunk/src/VBox/Main/HostImpl.cpp
r22211 r22609 235 235 && (u32FeaturesEDX & X86_CPUID_FEATURE_EDX_FXSR) 236 236 ) 237 { 238 #ifdef RT_OS_LINUX 239 /* Linux: VT-x is not supported on Linux < 2.6.13 because older kernels 240 * unconditionally disable the VMXE flag */ 241 char szBuf[64]; 242 int rc = RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, szBuf, sizeof(szBuf)); 243 244 if (RT_SUCCESS(rc)) 245 { 246 char *pszNext; 247 uint32_t uA, uB, uC; 248 249 rc = RTStrToUInt32Ex(szBuf, &pszNext, 10, &uA); 250 if ( RT_SUCCESS(rc) 251 && *pszNext == '.') 252 { 253 rc = RTStrToUInt32Ex(pszNext+1, &pszNext, 10, &uB); 254 if ( RT_SUCCESS(rc) 255 && *pszNext == '.') 256 { 257 rc = RTStrToUInt32Ex(pszNext+1, &pszNext, 10, &uC); 258 if (RT_SUCCESS(rc)) 259 { 260 uint32_t uLinuxVersion = (uA << 16) + (uB << 8) + uC; 261 if (uLinuxVersion >= (2 << 16) + (6 << 8) + 13) 262 fVTxAMDVSupported = true; 263 } 264 } 265 } 266 } 267 #else 237 268 fVTxAMDVSupported = true; 269 #endif 270 } 238 271 } 239 272 else -
trunk/src/VBox/VMM/VM.cpp
r22122 r22609 294 294 break; 295 295 #endif 296 297 case VERR_SUPDRV_KERNEL_TOO_OLD_FOR_VTX: 298 pszError = N_("The host Linux kernel is too old to support hardware acceleration. " 299 "Either upgrade your host kernel to Linux 2.6.13 or later or " 300 "disable hardware acceleration in the VM settings"); 301 break; 296 302 297 303 default: -
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r22429 r22609 603 603 int aRc[RTCPUSET_MAX_CPUS]; 604 604 RTCPUID idCpu = 0; 605 606 rc = SUPR0QueryVTxSupport(); 607 if (RT_FAILURE(rc)) 608 return rc; 605 609 606 610 memset(aRc, 0, sizeof(aRc));
Note:
See TracChangeset
for help on using the changeset viewer.