VirtualBox

Ignore:
Timestamp:
Aug 31, 2009 2:34:02 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
51666
Message:

disable VT-x on Linux < 2.6.13

Location:
trunk/src/VBox/HostDrivers/Support
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r22236 r22609  
    352352    { "SUPR0GetPagingMode",                     (void *)UNWIND_WRAP(SUPR0GetPagingMode) },
    353353    { "SUPR0EnableVTx",                         (void *)SUPR0EnableVTx },
     354    { "SUPR0QueryVTxSupport",                   (void *)SUPR0QueryVTxSupport },
    354355    { "RTMemAlloc",                             (void *)UNWIND_WRAP(RTMemAlloc) },
    355356    { "RTMemAllocZ",                            (void *)UNWIND_WRAP(RTMemAllocZ) },
     
    47944795
    47954796/**
     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 */
     4801SUPR0DECL(int) SUPR0QueryVTxSupport(void)
     4802{
     4803#ifdef RT_OS_LINUX
     4804    return supdrvOSQueryVTxSupport();
     4805#else
     4806    return VINF_SUCCESS;
     4807#endif
     4808}
     4809
     4810
     4811/**
    47964812 * Creates the GIP.
    47974813 *
  • trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h

    r22150 r22609  
    184184 *
    185185 * Update rules:
    186  *  -# Only update the major number when incompatible changes has been made to
     186 *  -# Only update the major number when incompatible changes have been made to
    187187 *     the IOC interface or the ABI provided via the functions returned by
    188188 *     SUPQUERYFUNCS.
     
    197197 *          - Nothing.
    198198 */
    199 #define SUPDRV_IOC_VERSION                              0x000f0000
     199#define SUPDRV_IOC_VERSION                              0x000f0001
    200200
    201201/** SUP_IOCTL_COOKIE. */
  • trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h

    r22236 r22609  
    632632bool VBOXCALL   supdrvOSGetForcedAsyncTscMode(PSUPDRVDEVEXT pDevExt);
    633633int  VBOXCALL   supdrvOSEnableVTx(bool fEnabled);
     634int  VBOXCALL   supdrvOSQueryVTxSupport(void);
    634635
    635636/*******************************************************************************
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r22150 r22609  
    273273        CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION;
    274274        const uint32_t MinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x000f0000
    275                                   ?  0x000f0000
     275                                  ?  0x000f0001
    276276                                  :  SUPDRV_IOC_VERSION & 0xffff0000;
    277277        CookieReq.u.In.u32MinVersion = MinVersion;
     
    413413        { "SUPR0Printf",                            0xefef000b },
    414414        { "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 },
    471472    };
    472473
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r21955 r22609  
    4444#include <iprt/initterm.h>
    4545#include <iprt/process.h>
    46 #include <iprt/err.h>
     46#include <VBox/err.h>
    4747#include <iprt/mem.h>
    4848#include <VBox/log.h>
     
    10061006
    10071007/**
     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 */
     1015int 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/**
    10081026 * Converts a supdrv error code to an linux error code.
    10091027 *
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette