VirtualBox

Ticket #13820: diff_4.3_smap

File diff_4.3_smap, 1.6 KB (added by Frank Mehnert, 10 years ago)

Disable SMAP when during VirtualBox kernel calls

Line 
1diff -ur a/vboxdrv/linux/SUPDrv-linux.c b/vboxdrv/linux/SUPDrv-linux.c
2--- a/vboxdrv/linux/SUPDrv-linux.c 2015-02-11 11:05:43.000000000 +0100
3+++ b/vboxdrv/linux/SUPDrv-linux.c 2015-02-11 11:06:07.695037978 +0100
4@@ -48,6 +48,12 @@
5 # include <iprt/power.h>
6 # define VBOX_WITH_SUSPEND_NOTIFICATION
7 #endif
8+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
9+# include <asm/smap.h>
10+#else
11+static inline void clac(void) { }
12+static inline void stac(void) { }
13+#endif
14
15 #include <linux/sched.h>
16 #ifdef CONFIG_DEVFS_FS
17@@ -622,6 +628,7 @@
18 #endif
19 {
20 PSUPDRVSESSION pSession = (PSUPDRVSESSION)pFilp->private_data;
21+ int rc;
22
23 /*
24 * Deal with the two high-speed IOCtl that takes it's arguments from
25@@ -632,12 +639,15 @@
26 || uCmd == SUP_IOCTL_FAST_DO_HM_RUN
27 || uCmd == SUP_IOCTL_FAST_DO_NOP)
28 && pSession->fUnrestricted == true))
29- return supdrvIOCtlFast(uCmd, ulArg, &g_DevExt, pSession);
30+ {
31+ stac();
32+ rc = supdrvIOCtlFast(uCmd, ulArg, &g_DevExt, pSession);
33+ clac();
34+ return rc;
35+ }
36 return VBoxDrvLinuxIOCtlSlow(pFilp, uCmd, ulArg, pSession);
37
38 #else /* !HAVE_UNLOCKED_IOCTL */
39-
40- int rc;
41 unlock_kernel();
42 if (RT_LIKELY( ( uCmd == SUP_IOCTL_FAST_DO_RAW_RUN
43 || uCmd == SUP_IOCTL_FAST_DO_HM_RUN
44@@ -715,7 +725,9 @@
45 /*
46 * Process the IOCtl.
47 */
48+ stac();
49 rc = supdrvIOCtl(uCmd, &g_DevExt, pSession, pHdr, cbBuf);
50+ clac();
51
52 /*
53 * Copy ioctl data and output buffer back to user space.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy