[Pkg-virtualbox-commits] [virtualbox] 01/01: Update packaging with a patch to fix a kernel issue LP: #1437845
Gianfranco Costamagna
locutusofborg-guest at moszumanska.debian.org
Thu Apr 9 09:49:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
locutusofborg-guest pushed a commit to branch master
in repository virtualbox.
commit 8345a3bfb01591402639a7ddab22e52a0d8ce471
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date: Thu Apr 9 11:48:55 2015 +0200
Update packaging with a patch to fix a kernel issue LP: #1437845
---
debian/changelog | 2 +
debian/patches/37-diff_smap_4.patch | 108 ++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 111 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 88daed9..fbfed5c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ virtualbox (4.3.26-dfsg-2) UNRELEASED; urgency=medium
[ Gianfranco Costamagna ]
* remove obsolete lintian overrides.
+ * d/p/37-diff_smap_4.patch, cherry-pick upstream patch to fix a kernel
+ paging issue (LP: #1437845).
[ Ritesh Raj Sarraf ]
* Remove Michael Meskes from uploaders.
diff --git a/debian/patches/37-diff_smap_4.patch b/debian/patches/37-diff_smap_4.patch
new file mode 100644
index 0000000..cd964d1
--- /dev/null
+++ b/debian/patches/37-diff_smap_4.patch
@@ -0,0 +1,108 @@
+diff -u '--exclude=.svn' '--exclude=CVS' '--exclude=.*.d' '--exclude=.depend' '--exclude=.hdepend' '--exclude=.*.flags' -r e/vboxdrv/linux/SUPDrv-linux.c f/vboxdrv/linux/SUPDrv-linux.c
+--- a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c 2015-03-20 15:24:13.000000000 +0100
++++ b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c 2015-03-20 15:23:51.000000000 +0100
+@@ -48,12 +48,6 @@
+ # include <iprt/power.h>
+ # define VBOX_WITH_SUSPEND_NOTIFICATION
+ #endif
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
+-# include <asm/smap.h>
+-#else
+-static inline void clac(void) { }
+-static inline void stac(void) { }
+-#endif
+
+ #include <linux/sched.h>
+ #ifdef CONFIG_DEVFS_FS
+diff -u '--exclude=.svn' '--exclude=CVS' '--exclude=.*.d' '--exclude=.depend' '--exclude=.hdepend' '--exclude=.*.flags' -r e/vboxdrv/r0drv/linux/the-linux-kernel.h f/vboxdrv/r0drv/linux/the-linux-kernel.h
+--- a/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h 2015-03-20 15:24:13.000000000 +0100
++++ b/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h 2015-03-20 15:23:52.000000000 +0100
+@@ -145,6 +145,13 @@
+ # include <asm/tlbflush.h>
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
++# include <asm/smap.h>
++#else
++static inline void clac(void) { }
++static inline void stac(void) { }
++#endif
++
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+ # ifndef page_to_pfn
+ # define page_to_pfn(page) ((page) - mem_map)
+diff -u '--exclude=.svn' '--exclude=CVS' '--exclude=.*.d' '--exclude=.depend' '--exclude=.hdepend' '--exclude=.*.flags' -r e/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.c f/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.c
+--- a/src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c 2015-03-20 15:24:13.000000000 +0100
++++ b/src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c 2015-03-20 15:23:52.000000000 +0100
+@@ -36,6 +36,9 @@
+ #include <iprt/thread.h>
+ #include <iprt/err.h>
+ #include <iprt/asm.h>
++#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
++# include <iprt/asm-amd64-x86.h>
++#endif
+ #include "internal/thread.h"
+
+ /*
+@@ -68,6 +71,11 @@
+ struct preempt_ops hPreemptOps;
+ /** The reference count for this object. */
+ uint32_t volatile cRefs;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 19) && defined(RT_ARCH_AMD64)
++ /** Starting with 3.1.19, the linux kernel doesn't restore kernel RFLAGS during
++ * task switch, so we have to do that ourselves. (x86 code is not affected.) */
++ RTCCUINTREG fSavedRFlags;
++#endif
+ } RTTHREADCTXINT, *PRTTHREADCTXINT;
+
+
+@@ -84,12 +92,24 @@
+ static void rtThreadCtxHooksLnxSchedOut(struct preempt_notifier *pPreemptNotifier, struct task_struct *pNext)
+ {
+ PRTTHREADCTXINT pThis = RT_FROM_MEMBER(pPreemptNotifier, RTTHREADCTXINT, hPreemptNotifier);
++#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
++ RTCCUINTREG fSavedEFlags = ASMGetFlags();
++ stac();
++#endif
++
+ AssertPtr(pThis);
+ AssertPtr(pThis->pfnThreadCtxHook);
+ Assert(pThis->fRegistered);
+ Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
+
+ pThis->pfnThreadCtxHook(RTTHREADCTXEVENT_PREEMPTING, pThis->pvUser);
++
++#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
++ ASMSetFlags(fSavedEFlags);
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 19) && defined(RT_ARCH_AMD64)
++ pThis->fSavedRFlags = fSavedEFlags;
++# endif
++#endif
+ }
+
+
+@@ -105,11 +125,24 @@
+ static void rtThreadCtxHooksLnxSchedIn(struct preempt_notifier *pPreemptNotifier, int iCpu)
+ {
+ PRTTHREADCTXINT pThis = RT_FROM_MEMBER(pPreemptNotifier, RTTHREADCTXINT, hPreemptNotifier);
++#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
++ RTCCUINTREG fSavedEFlags = ASMGetFlags();
++ stac();
++#endif
++
+ AssertPtr(pThis);
+ AssertPtr(pThis->pfnThreadCtxHook);
+ Assert(pThis->fRegistered);
+
+ pThis->pfnThreadCtxHook(RTTHREADCTXEVENT_RESUMED, pThis->pvUser);
++
++#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 19) && defined(RT_ARCH_AMD64)
++ fSavedEFlags &= ~RT_BIT_64(18) /*X86_EFL_AC*/;
++ fSavedEFlags |= pThis->fSavedRFlags & RT_BIT_64(18) /*X86_EFL_AC*/;
++# endif
++ ASMSetFlags(fSavedEFlags);
++#endif
+ }
+
+
diff --git a/debian/patches/series b/debian/patches/series
index 5b32c83..a06f623 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,3 +14,4 @@
32-disable-guest-version-check.patch
35-libvdeplug-soname.patch
36-fix-vnc-version-string.patch
+37-diff_smap_4.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-virtualbox/virtualbox.git
More information about the Pkg-virtualbox-commits
mailing list