VirtualBox

Ticket #13961: diff_smap_3

File diff_smap_3, 3.3 KB (added by Frank Mehnert, 11 years ago)
Line
1 diff -u '--exclude=.svn' '--exclude=CVS' '--exclude=.*.d' '--exclude=.depend' '--exclude=.hdepend' '--exclude=.*.flags' -r d/vboxdrv/linux/SUPDrv-linux.c e/vboxdrv/linux/SUPDrv-linux.c
2 --- d/vboxdrv/linux/SUPDrv-linux.c 2015年03月20日 14:19:12.000000000 +0100
3 +++ e/vboxdrv/linux/SUPDrv-linux.c 2015年03月20日 14:19:30.000000000 +0100
4 @@ -1,4 +1,4 @@
5 -/* $Rev: 98806 $ */
6 +/* $Rev: 99005 $ */
7 /** @file
8 * VBoxDrv - The VirtualBox Support Driver - Linux specifics.
9 */
10 @@ -48,12 +48,6 @@
11 # include <iprt/power.h>
12 # define VBOX_WITH_SUSPEND_NOTIFICATION
13 #endif
14 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
15 -# include <asm/smap.h>
16 -#else
17 -static inline void clac(void) { }
18 -static inline void stac(void) { }
19 -#endif
20
21 #include <linux/sched.h>
22 #ifdef CONFIG_DEVFS_FS
23 diff -u '--exclude=.svn' '--exclude=CVS' '--exclude=.*.d' '--exclude=.depend' '--exclude=.hdepend' '--exclude=.*.flags' -r d/vboxdrv/r0drv/linux/the-linux-kernel.h e/vboxdrv/r0drv/linux/the-linux-kernel.h
24 --- d/vboxdrv/r0drv/linux/the-linux-kernel.h 2015年03月20日 14:19:14.000000000 +0100
25 +++ e/vboxdrv/r0drv/linux/the-linux-kernel.h 2015年03月20日 14:19:30.000000000 +0100
26 @@ -145,6 +145,13 @@
27 # include <asm/tlbflush.h>
28 #endif
29
30 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
31 +# include <asm/smap.h>
32 +#else
33 +static inline void clac(void) { }
34 +static inline void stac(void) { }
35 +#endif
36 +
37 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
38 # ifndef page_to_pfn
39 # define page_to_pfn(page) ((page) - mem_map)
40 diff -u '--exclude=.svn' '--exclude=CVS' '--exclude=.*.d' '--exclude=.depend' '--exclude=.hdepend' '--exclude=.*.flags' -r d/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.c e/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.c
41 --- d/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.c 2015年03月20日 14:19:14.000000000 +0100
42 +++ e/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.c 2015年03月20日 14:19:30.000000000 +0100
43 @@ -36,6 +36,9 @@
44 #include <iprt/thread.h>
45 #include <iprt/err.h>
46 #include <iprt/asm.h>
47 +#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
48 +# include <iprt/asm-amd64-x86.h>
49 +#endif
50 #include "internal/thread.h"
51
52 /*
53 @@ -84,12 +87,22 @@
54 static void rtThreadCtxHooksLnxSchedOut(struct preempt_notifier *pPreemptNotifier, struct task_struct *pNext)
55 {
56 PRTTHREADCTXINT pThis = RT_FROM_MEMBER(pPreemptNotifier, RTTHREADCTXINT, hPreemptNotifier);
57 +#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
58 + RTCCUINTREG fSavedEFlags = ASMGetFlags();
59 + stac();
60 +#endif
61 +
62 AssertPtr(pThis);
63 AssertPtr(pThis->pfnThreadCtxHook);
64 Assert(pThis->fRegistered);
65 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
66
67 pThis->pfnThreadCtxHook(RTTHREADCTXEVENT_PREEMPTING, pThis->pvUser);
68 +
69 +#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
70 + clac();
71 + ASMSetFlags(fSavedEFlags);
72 +#endif
73 }
74
75
76 @@ -105,11 +118,22 @@
77 static void rtThreadCtxHooksLnxSchedIn(struct preempt_notifier *pPreemptNotifier, int iCpu)
78 {
79 PRTTHREADCTXINT pThis = RT_FROM_MEMBER(pPreemptNotifier, RTTHREADCTXINT, hPreemptNotifier);
80 +#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
81 + RTCCUINTREG fSavedEFlags = ASMGetFlags();
82 + stac();
83 +#endif
84 +
85 AssertPtr(pThis);
86 AssertPtr(pThis->pfnThreadCtxHook);
87 Assert(pThis->fRegistered);
88
89 +
90 pThis->pfnThreadCtxHook(RTTHREADCTXEVENT_RESUMED, pThis->pvUser);
91 +
92 +#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
93 + clac();
94 + ASMSetFlags(fSavedEFlags);
95 +#endif
96 }
97
98

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

AltStyle によって変換されたページ (->オリジナル) /