Index: /trunk/include/VBox/err.h
===================================================================
--- /trunk/include/VBox/err.h	(revision 22608)
+++ /trunk/include/VBox/err.h	(revision 22609)
@@ -1237,4 +1237,6 @@
 /** The service module was not found. */
 #define VERR_SUPDRV_SERVICE_NOT_FOUND               (-3702)
+/** The host kernel is too old. */
+#define VERR_SUPDRV_KERNEL_TOO_OLD_FOR_VTX          (-3703)
 /** @} */
 
Index: /trunk/include/VBox/sup.h
===================================================================
--- /trunk/include/VBox/sup.h	(revision 22608)
+++ /trunk/include/VBox/sup.h	(revision 22609)
@@ -995,4 +995,5 @@
 SUPR0DECL(SUPPAGINGMODE) SUPR0GetPagingMode(void);
 SUPR0DECL(int) SUPR0EnableVTx(bool fEnable);
+SUPR0DECL(int) SUPR0QueryVTxSupport(void);
 
 /** @name Absolute symbols
Index: /trunk/src/VBox/HostDrivers/Support/SUPDrv.c
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPDrv.c	(revision 22608)
+++ /trunk/src/VBox/HostDrivers/Support/SUPDrv.c	(revision 22609)
@@ -352,4 +352,5 @@
     { "SUPR0GetPagingMode",                     (void *)UNWIND_WRAP(SUPR0GetPagingMode) },
     { "SUPR0EnableVTx",                         (void *)SUPR0EnableVTx },
+    { "SUPR0QueryVTxSupport",                   (void *)SUPR0QueryVTxSupport },
     { "RTMemAlloc",                             (void *)UNWIND_WRAP(RTMemAlloc) },
     { "RTMemAllocZ",                            (void *)UNWIND_WRAP(RTMemAllocZ) },
@@ -4794,4 +4795,19 @@
 
 /**
+ * Check if the host kernel can run in VMX root mode.
+ *
+ * @returns VINF_SUCCESS if supported, error code indicating why if not.
+ */
+SUPR0DECL(int) SUPR0QueryVTxSupport(void)
+{
+#ifdef RT_OS_LINUX
+    return supdrvOSQueryVTxSupport();
+#else
+    return VINF_SUCCESS;
+#endif
+}
+
+
+/**
  * Creates the GIP.
  *
Index: /trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h	(revision 22608)
+++ /trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h	(revision 22609)
@@ -184,5 +184,5 @@
  *
  * Update rules:
- *  -# Only update the major number when incompatible changes has been made to
+ *  -# Only update the major number when incompatible changes have been made to
  *     the IOC interface or the ABI provided via the functions returned by
  *     SUPQUERYFUNCS.
@@ -197,5 +197,5 @@
  *          - Nothing.
  */
-#define SUPDRV_IOC_VERSION                              0x000f0000
+#define SUPDRV_IOC_VERSION                              0x000f0001
 
 /** SUP_IOCTL_COOKIE. */
Index: /trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h	(revision 22608)
+++ /trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h	(revision 22609)
@@ -632,4 +632,5 @@
 bool VBOXCALL   supdrvOSGetForcedAsyncTscMode(PSUPDRVDEVEXT pDevExt);
 int  VBOXCALL   supdrvOSEnableVTx(bool fEnabled);
+int  VBOXCALL   supdrvOSQueryVTxSupport(void);
 
 /*******************************************************************************
Index: /trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPLib.cpp	(revision 22608)
+++ /trunk/src/VBox/HostDrivers/Support/SUPLib.cpp	(revision 22609)
@@ -273,5 +273,5 @@
         CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION;
         const uint32_t MinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x000f0000
-                                  ?  0x000f0000
+                                  ?  0x000f0001
                                   :  SUPDRV_IOC_VERSION & 0xffff0000;
         CookieReq.u.In.u32MinVersion = MinVersion;
@@ -413,60 +413,61 @@
         { "SUPR0Printf",                            0xefef000b },
         { "SUPR0GetPagingMode",                     0xefef000c },
-        { "SUPR0EnableVTx",                         0xefef000c },
-        { "RTMemAlloc",                             0xefef000d },
-        { "RTMemAllocZ",                            0xefef000e },
-        { "RTMemFree",                              0xefef000f },
-        { "RTR0MemObjAddress",                      0xefef0010 },
-        { "RTR0MemObjAddressR3",                    0xefef0011 },
-        { "RTR0MemObjAllocPage",                    0xefef0012 },
-        { "RTR0MemObjAllocPhysNC",                  0xefef0013 },
-        { "RTR0MemObjAllocLow",                     0xefef0014 },
-        { "RTR0MemObjEnterPhys",                    0xefef0014 },
-        { "RTR0MemObjFree",                         0xefef0015 },
-        { "RTR0MemObjGetPagePhysAddr",              0xefef0016 },
-        { "RTR0MemObjMapUser",                      0xefef0017 },
-        { "RTR0MemObjMapKernel",                    0xefef0017 },
-        { "RTR0MemObjMapKernelEx",                  0xefef0017 },
-        { "RTProcSelf",                             0xefef0038 },
-        { "RTR0ProcHandleSelf",                     0xefef0039 },
-        { "RTSemEventCreate",                       0xefef0018 },
-        { "RTSemEventSignal",                       0xefef0019 },
-        { "RTSemEventWait",                         0xefef001a },
-        { "RTSemEventWaitNoResume",                 0xefef001b },
-        { "RTSemEventDestroy",                      0xefef001c },
-        { "RTSemEventMultiCreate",                  0xefef001d },
-        { "RTSemEventMultiSignal",                  0xefef001e },
-        { "RTSemEventMultiReset",                   0xefef001f },
-        { "RTSemEventMultiWait",                    0xefef0020 },
-        { "RTSemEventMultiWaitNoResume",            0xefef0021 },
-        { "RTSemEventMultiDestroy",                 0xefef0022 },
-        { "RTSemFastMutexCreate",                   0xefef0023 },
-        { "RTSemFastMutexDestroy",                  0xefef0024 },
-        { "RTSemFastMutexRequest",                  0xefef0025 },
-        { "RTSemFastMutexRelease",                  0xefef0026 },
-        { "RTSpinlockCreate",                       0xefef0027 },
-        { "RTSpinlockDestroy",                      0xefef0028 },
-        { "RTSpinlockAcquire",                      0xefef0029 },
-        { "RTSpinlockRelease",                      0xefef002a },
-        { "RTSpinlockAcquireNoInts",                0xefef002b },
-        { "RTSpinlockReleaseNoInts",                0xefef002c },
-        { "RTTimeNanoTS",                           0xefef002d },
-        { "RTTimeMillieTS",                         0xefef002e },
-        { "RTTimeSystemNanoTS",                     0xefef002f },
-        { "RTTimeSystemMillieTS",                   0xefef0030 },
-        { "RTThreadNativeSelf",                     0xefef0031 },
-        { "RTThreadSleep",                          0xefef0032 },
-        { "RTThreadYield",                          0xefef0033 },
-        { "RTLogDefaultInstance",                   0xefef0034 },
-        { "RTLogRelDefaultInstance",                0xefef0035 },
-        { "RTLogSetDefaultInstanceThread",          0xefef0036 },
-        { "RTLogLogger",                            0xefef0037 },
-        { "RTLogLoggerEx",                          0xefef0038 },
-        { "RTLogLoggerExV",                         0xefef0039 },
-        { "AssertMsg1",                             0xefef003a },
-        { "AssertMsg2",                             0xefef003b },
-        { "RTAssertMsg1",                           0xefef003c },
-        { "RTAssertMsg2",                           0xefef003d },
-        { "RTAssertMsg2V",                          0xefef003e },
+        { "SUPR0QueryVTxSupport",                   0xefef000d },
+        { "SUPR0EnableVTx",                         0xefef000e },
+        { "RTMemAlloc",                             0xefef000f },
+        { "RTMemAllocZ",                            0xefef0010 },
+        { "RTMemFree",                              0xefef0011 },
+        { "RTR0MemObjAddress",                      0xefef0012 },
+        { "RTR0MemObjAddressR3",                    0xefef0013 },
+        { "RTR0MemObjAllocPage",                    0xefef0014 },
+        { "RTR0MemObjAllocPhysNC",                  0xefef0015 },
+        { "RTR0MemObjAllocLow",                     0xefef0016 },
+        { "RTR0MemObjEnterPhys",                    0xefef0017 },
+        { "RTR0MemObjFree",                         0xefef0018 },
+        { "RTR0MemObjGetPagePhysAddr",              0xefef0019 },
+        { "RTR0MemObjMapUser",                      0xefef001a },
+        { "RTR0MemObjMapKernel",                    0xefef001b },
+        { "RTR0MemObjMapKernelEx",                  0xefef001c },
+        { "RTProcSelf",                             0xefef001d },
+        { "RTR0ProcHandleSelf",                     0xefef001e },
+        { "RTSemEventCreate",                       0xefef001f },
+        { "RTSemEventSignal",                       0xefef0020 },
+        { "RTSemEventWait",                         0xefef0021 },
+        { "RTSemEventWaitNoResume",                 0xefef0022 },
+        { "RTSemEventDestroy",                      0xefef0023 },
+        { "RTSemEventMultiCreate",                  0xefef0024 },
+        { "RTSemEventMultiSignal",                  0xefef0025 },
+        { "RTSemEventMultiReset",                   0xefef0026 },
+        { "RTSemEventMultiWait",                    0xefef0027 },
+        { "RTSemEventMultiWaitNoResume",            0xefef0028 },
+        { "RTSemEventMultiDestroy",                 0xefef0029 },
+        { "RTSemFastMutexCreate",                   0xefef002a },
+        { "RTSemFastMutexDestroy",                  0xefef002b },
+        { "RTSemFastMutexRequest",                  0xefef002c },
+        { "RTSemFastMutexRelease",                  0xefef002d },
+        { "RTSpinlockCreate",                       0xefef002e },
+        { "RTSpinlockDestroy",                      0xefef002f },
+        { "RTSpinlockAcquire",                      0xefef0030 },
+        { "RTSpinlockRelease",                      0xefef0031 },
+        { "RTSpinlockAcquireNoInts",                0xefef0032 },
+        { "RTSpinlockReleaseNoInts",                0xefef0033 },
+        { "RTTimeNanoTS",                           0xefef0034 },
+        { "RTTimeMillieTS",                         0xefef0035 },
+        { "RTTimeSystemNanoTS",                     0xefef0036 },
+        { "RTTimeSystemMillieTS",                   0xefef0037 },
+        { "RTThreadNativeSelf",                     0xefef0038 },
+        { "RTThreadSleep",                          0xefef0039 },
+        { "RTThreadYield",                          0xefef003a },
+        { "RTLogDefaultInstance",                   0xefef003b },
+        { "RTLogRelDefaultInstance",                0xefef003c },
+        { "RTLogSetDefaultInstanceThread",          0xefef003d },
+        { "RTLogLogger",                            0xefef003e },
+        { "RTLogLoggerEx",                          0xefef003f },
+        { "RTLogLoggerExV",                         0xefef0040 },
+        { "AssertMsg1",                             0xefef0041 },
+        { "AssertMsg2",                             0xefef0042 },
+        { "RTAssertMsg1",                           0xefef0043 },
+        { "RTAssertMsg2",                           0xefef0044 },
+        { "RTAssertMsg2V",                          0xefef0045 },
     };
 
Index: /trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	(revision 22608)
+++ /trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	(revision 22609)
@@ -44,5 +44,5 @@
 #include <iprt/initterm.h>
 #include <iprt/process.h>
-#include <iprt/err.h>
+#include <VBox/err.h>
 #include <iprt/mem.h>
 #include <VBox/log.h>
@@ -1006,4 +1006,22 @@
 
 /**
+ * Check if the host kernel supports VT-x or not.
+ *
+ * Older Linux kernels clear the VMXE bit in the CR4 register (function
+ * tlb_flush_all()) leading to a host kernel panic.
+ *
+ * @returns VBox error code
+ */
+int VBOXCALL supdrvOSQueryVTxSupport(void)
+{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+    return VINF_SUCCESS;
+#else
+    return VERR_SUPDRV_KERNEL_TOO_OLD_FOR_VTX;
+#endif
+}
+
+
+/**
  * Converts a supdrv error code to an linux error code.
  *
Index: /trunk/src/VBox/Main/HostImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/HostImpl.cpp	(revision 22608)
+++ /trunk/src/VBox/Main/HostImpl.cpp	(revision 22609)
@@ -235,5 +235,38 @@
                  && (u32FeaturesEDX & X86_CPUID_FEATURE_EDX_FXSR)
                )
+            {
+#ifdef RT_OS_LINUX
+                /* Linux: VT-x is not supported on Linux < 2.6.13 because older kernels
+                 * unconditionally disable the VMXE flag */
+                char szBuf[64];
+                int rc = RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, szBuf, sizeof(szBuf));
+
+                if (RT_SUCCESS(rc))
+                {
+                    char *pszNext;
+                    uint32_t uA, uB, uC;
+
+                    rc = RTStrToUInt32Ex(szBuf, &pszNext, 10, &uA);
+                    if (   RT_SUCCESS(rc)
+                        && *pszNext == '.')
+                    {
+                        rc = RTStrToUInt32Ex(pszNext+1, &pszNext, 10, &uB);
+                        if (   RT_SUCCESS(rc)
+                            && *pszNext == '.')
+                        {
+                            rc = RTStrToUInt32Ex(pszNext+1, &pszNext, 10, &uC);
+                            if (RT_SUCCESS(rc))
+                            {
+                                uint32_t uLinuxVersion = (uA << 16) + (uB << 8) + uC;
+                                if (uLinuxVersion >= (2 << 16) + (6 << 8) + 13)
+                                    fVTxAMDVSupported = true;
+                            }
+                        }
+                    }
+                }
+#else
                 fVTxAMDVSupported = true;
+#endif
+            }
         }
         else
Index: /trunk/src/VBox/VMM/VM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VM.cpp	(revision 22608)
+++ /trunk/src/VBox/VMM/VM.cpp	(revision 22609)
@@ -294,4 +294,10 @@
                     break;
 #endif
+
+                case VERR_SUPDRV_KERNEL_TOO_OLD_FOR_VTX:
+                    pszError = N_("The host Linux kernel is too old to support hardware acceleration. "
+                                  "Either upgrade your host kernel to Linux 2.6.13 or later or "
+                                  "disable hardware acceleration in the VM settings");
+                    break;
 
                 default:
Index: /trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp	(revision 22608)
+++ /trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp	(revision 22609)
@@ -603,4 +603,8 @@
             int     aRc[RTCPUSET_MAX_CPUS];
             RTCPUID idCpu = 0;
+
+            rc = SUPR0QueryVTxSupport();
+            if (RT_FAILURE(rc))
+                return rc;
 
             memset(aRc, 0, sizeof(aRc));
