[arch-commits] Commit in virtualbox/trunk (009-fix-smap-crash.patch PKGBUILD build.sh)
Sébastien Luttringer
seblu at archlinux.org
Sat Mar 21 14:39:14 UTC 2015
Date: Saturday, March 21, 2015 @ 15:39:14
Author: seblu
Revision: 129698
upgpkg: virtualbox 4.3.26-2
- fix FS#44278
Added:
virtualbox/trunk/009-fix-smap-crash.patch
Modified:
virtualbox/trunk/PKGBUILD
virtualbox/trunk/build.sh
--------------------------+
009-fix-smap-crash.patch | 107 +++++++++++++++++++++++++++++++++++++++++++++
PKGBUILD | 8 ++-
build.sh | 2
3 files changed, 113 insertions(+), 4 deletions(-)
Added: 009-fix-smap-crash.patch
===================================================================
--- 009-fix-smap-crash.patch (rev 0)
+++ 009-fix-smap-crash.patch 2015-03-21 14:39:14 UTC (rev 129698)
@@ -0,0 +1,107 @@
+# https://www.virtualbox.org/ticket/13961
+
+--- 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
+--- 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)
+--- 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
+ }
+
+
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2015-03-21 13:43:15 UTC (rev 129697)
+++ PKGBUILD 2015-03-21 14:39:14 UTC (rev 129698)
@@ -11,7 +11,7 @@
'virtualbox-guest-utils-nox'
'virtualbox-ext-vnc')
pkgver=4.3.26
-pkgrel=1
+pkgrel=2
arch=('i686' 'x86_64')
url='http://virtualbox.org'
license=('GPL' 'custom')
@@ -65,7 +65,8 @@
'005-gsoap-build.patch'
'006-rdesktop-vrdp-keymap-path.patch'
'007-python2-path.patch'
- '008-root-window.patch')
+ '008-root-window.patch'
+ '009-fix-smap-crash.patch')
md5sums=('df8fa3b1820773556b33ae0405553120'
'4833c8e0524fd2272b24ba0d94aef006'
'6e2722bfd7013c1b0174382626ac1b8d'
@@ -82,7 +83,8 @@
'ecfd13297d7753ebe7b8763ca5b792d9'
'7ea75b242e19440d622eb42a4d6c62c4'
'188ea65918309f737ce28216c2b07c3b'
- '7495960c8fd0ac5867b6fa9cd87a64bb')
+ '7495960c8fd0ac5867b6fa9cd87a64bb'
+ '1e01ddec15422708a8a795033db20b17')
prepare() {
cd "VirtualBox-$pkgver"
Modified: build.sh
===================================================================
--- build.sh 2015-03-21 13:43:15 UTC (rev 129697)
+++ build.sh 2015-03-21 14:39:14 UTC (rev 129698)
@@ -1,3 +1,3 @@
#!/bin/bash
-multilib-build && extra-i686-build
+multilib-build "$@" && extra-i686-build "$@"
More information about the arch-commits
mailing list