View | Details | Raw Unified | Return to bug 230460 | Differences between
and this patch

Collapse All | Expand All

(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c (-1 / +45 lines)
Lines 1-7 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig	2016-07-18 11:56:20 UTC
1
--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig	2016-07-18 11:56:20 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
2
+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
3
@@ -541,8 +541,7 @@ bool VBOXCALL  supdrvOSGetForcedAsyncTsc
3
@@ -44,6 +44,11 @@
4
 #include <sys/fcntl.h>
5
 #include <sys/conf.h>
6
 #include <sys/uio.h>
7
+#if __FreeBSD_version >= 1200076
8
+#include <machine/cpufunc.h>
9
+#include <machine/md_var.h>
10
+#include <machine/specialreg.h>
11
+#endif
4
 
12
 
13
 #include "../SUPDrvInternal.h"
14
 #include <VBox/version.h>
15
@@ -310,6 +315,12 @@ static int VBoxDrvFreeBSDIOCtl(struct cd
16
 {
17
     PSUPDRVSESSION pSession;
18
     devfs_get_cdevpriv((void **)&pSession);
19
+    int rc;
20
+
21
+#if __FreeBSD_version >= 1200076
22
+    if ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0)
23
+        stac();
24
+#endif
25
 
26
     /*
27
      * Deal with the fast ioctl path first.
28
@@ -318,9 +329,16 @@ static int VBoxDrvFreeBSDIOCtl(struct cd
29
             || ulCmd == SUP_IOCTL_FAST_DO_HM_RUN
30
             || ulCmd == SUP_IOCTL_FAST_DO_NOP)
31
         && pSession->fUnrestricted == true)
32
-        return supdrvIOCtlFast(ulCmd, *(uint32_t *)pvData, &g_VBoxDrvFreeBSDDevExt, pSession);
33
+        rc = supdrvIOCtlFast(ulCmd, *(uint32_t *)pvData, &g_VBoxDrvFreeBSDDevExt, pSession);
34
+    else
35
+        rc = VBoxDrvFreeBSDIOCtlSlow(pSession, ulCmd, pvData, pTd);
36
 
37
-    return VBoxDrvFreeBSDIOCtlSlow(pSession, ulCmd, pvData, pTd);
38
+#if __FreeBSD_version >= 1200076
39
+    if ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0)
40
+        clac();
41
+#endif
42
+
43
+    return rc;
44
 }
45
 
46
 
47
@@ -541,8 +559,7 @@ bool VBOXCALL  supdrvOSGetForcedAsyncTsc
48
 
5
 bool VBOXCALL  supdrvOSAreCpusOfflinedOnSuspend(void)
49
 bool VBOXCALL  supdrvOSAreCpusOfflinedOnSuspend(void)
6
 {
50
 {
7
-    /** @todo verify this. */
51
-    /** @todo verify this. */

Return to bug 230460