rpms/VirtualBox/devel diff_smap_4.patch, NONE, 1.1 VirtualBox.spec, 1.72, 1.73

Sérgio M. Basto sergiomb at rpmfusion.org
Wed May 6 01:00:32 CEST 2015


Author: sergiomb

Update of /cvs/free/rpms/VirtualBox/devel
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv21338

Modified Files:
	VirtualBox.spec 
Added Files:
	diff_smap_4.patch 
Log Message:
* Mon May 04 2015 Sérgio Basto <sergio at serjux.com> - 4.3.26-3
- Added diff_smap_4.patch from https://www.virtualbox.org/ticket/13961 ,
  may fix problems for kernel >= 3.19 , I still need disable 3D to run plasma 5
  ( https://forums.virtualbox.org/viewtopic.php?f=6&t=64452&start=15#p320557 )


diff_smap_4.patch:
 HostDrivers/Support/linux/SUPDrv-linux.c         |    6 ----
 Runtime/r0drv/linux/the-linux-kernel.h           |    7 ++++
 Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c |   33 +++++++++++++++++++++++
 3 files changed, 40 insertions(+), 6 deletions(-)

--- NEW FILE diff_smap_4.patch ---
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
--- ./src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	2015-03-20 15:24:13.000000000 +0100
+++ ./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
--- ./src/VBox/Runtime/r0drv/linux/the-linux-kernel.h	2015-03-20 15:24:13.000000000 +0100
+++ ./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
--- ./src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c	2015-03-20 15:24:13.000000000 +0100
+++ ./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
 }
 
 


Index: VirtualBox.spec
===================================================================
RCS file: /cvs/free/rpms/VirtualBox/devel/VirtualBox.spec,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- VirtualBox.spec	4 May 2015 16:16:25 -0000	1.72
+++ VirtualBox.spec	5 May 2015 23:00:31 -0000	1.73
@@ -27,7 +27,7 @@
 
 Name:       VirtualBox
 Version:    4.3.26
-Release:    2%{?prerel:.%{prerel}}%{?dist}
+Release:    3%{?prerel:.%{prerel}}%{?dist}
 Summary:    A general-purpose full virtualizer for PC hardware
 
 Group:      Development/Tools
@@ -53,6 +53,7 @@
 Patch24:    VirtualBox-4.3.0-VBoxGuestLib.patch
 Patch26:    VirtualBox-4.3.0-no-bundles.patch
 Patch27:    VirtualBox-4.3.26-gcc.patch
+Patch28:    diff_smap_4.patch
 
 BuildRequires:  kBuild >= 0.1.9998
 BuildRequires:  SDL-devel xalan-c-devel
@@ -234,6 +235,7 @@
 %patch24 -p1 -b .guestlib
 %patch26 -p1 -b .nobundles
 %patch27 -p2 -b .gcc
+%patch28 -p1 -b .smap
 
 # CRLF->LF
 sed -i 's/\r//' COPYING
@@ -619,6 +621,11 @@
 
 
 %changelog
+* Mon May 04 2015 Sérgio Basto <sergio at serjux.com> - 4.3.26-3
+- Added diff_smap_4.patch from https://www.virtualbox.org/ticket/13961 ,
+  may fix problems for kernel >= 3.19 , I still need disable 3D to run plasma 5
+  ( https://forums.virtualbox.org/viewtopic.php?f=6&t=64452&start=15#p320557 )
+
 * Mon May 04 2015 Sérgio Basto <sergio at serjux.com> - 4.3.26-2
 - Rebuilt for F22 new xorg ABI
 - Allow build with gcc 5.1


More information about the rpmfusion-commits mailing list