1
0
forked from pool/virtualbox
virtualbox/fixes_for_4.15.patch
Larry Finger b8eea0822b - File "fixes_for_4.14.patch" deleted - upstream fix.
File "remove_vbox_video_build.patch" added as current versions of Xorg no longer need this component.
Version update to 5.2.4 (released 2017-12-19 by Oracle)
This is a maintenance release. The following items were fixed and/or added:
    User interface: Adjusting desktop file for X11 window managers (bug #17312)
    User interface: various high resolution display adjustments
    Audio: fixed SB16 volume handling (5.2 regression)
    Audio: various fixes
    USB/OHCI: fixed a problem where OHCI emulation might sporadically drop data transfers
    Linux hosts: fixed screen corruption when the host screen changes and a virtual machine window is maximized
    X11 Guest Additions: fixed a hang at the GNOME Shell login screen with 3D enabled (5.2 regression, bugs #17189 and #17190) 
Version bump to 5.2.2 (released 2017-11-24 by Oracle)
This is a maintenance release. The following items were fixed and/or added:
    User interface: various improvements for high resolution screens
    User interface: added functionality to duplicate optical and floppy images
    User interface: various improvements for the virtual media manager
    VMM: fixed emulation so that Plan 9 guests can start once more (5.1.0 regression)
    Storage: fixed regression breaking iSCSI (bug #17196)
    Audio: added HDA support for more exotic guests (e.g. Haiku)
    Serial: fixed hanging I/O when using named pipes on Windows (5.2.0 regression; bug #17227)
    Serial: fixed broken communication with certain devices on Linux hosts
    USB/OHCI: improved behavior so that the controller state after a VM reset is closer to the initial state after VM start
    EFI: fixed HFS+ driver which in rare cases failed to access most files on a volume
    Shared clipboard: fixed hang with OS X host and Linux guest (bug #15782)
    Linux hosts: fixed kernel module compilation and start failures with Linux kernel 4.14 (bug #17267)
    X11 hosts: better handle WM_CLASS setting (bug #12534)
    Linux guests: fixed kernel module compilation and other problems with Linux kernel 4.14 (bug #12534)
    Linux guests: fixed kernel module compilation and other problems with Linux kernel 4.14
    Linux guests: fixed various 5.2.0 regressions (bug #17163)
    Bridged networking: fixed duplicate EtherType in VLAN/priority tags on Linux (5.2.0 regression; bug #17277)

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=393
2017-12-29 19:22:29 +00:00

215 lines
8.4 KiB
Diff

This patch file makes the necessary changes to the VirtualBox 5.1.30 sources
to allow the kernel modules to build with kernel 4.15.
The API changes are of several types:
1. The timer initialization routine init_timer_pinned() no longer exists, and
is replaced by timer_setup().
2. The timer callback routine calling sequence is changed as is the technique
for getting the timer information from the callback parameters.
3. The calling sequence for drm_encoder_find() is changed.
4. The calling sequence for the .get and .set members of the module_param_call()
calls have changed.
This patch is released under the MIT license when appropriate, GPLv2 otherwise.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This patch file makes the necessary changes to the VirtualBox 5.1.30 sources
to allow the kernel modules to build with kernel 4.15.
The API changes are of several types:
1. The timer initialization routine init_timer_pinned() no longer exists, and
is replaced by timer_setup().
2. The timer callback routine calling sequence is changed as is the technique
for getting the timer information from the callback parameters.
3. The calling sequence for drm_encoder_find() is changed.
4. The calling sequence for the .get and .set members of the module_param_call()
calls have changed.
This patch is released under the MIT license when appropriate, GPLv2 otherwise.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Index: VirtualBox-5.2.2/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
===================================================================
--- VirtualBox-5.2.2.orig/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
+++ VirtualBox-5.2.2/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
@@ -715,6 +715,14 @@ static enum hrtimer_restart rtTimerLinux
#endif /* RTTIMER_LINUX_WITH_HRTIMER */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+/**
+ * Timer callback for kernels 4.15 and later
+ */
+static void rtTimerLinuxStdCallback(struct timer_list *t)
+{
+ PRTTIMERLNXSUBTIMER pSubTimer = from_timer(pSubTimer, t, u.Std.LnxTimer);
+#else
/**
* Timer callback function for standard timers.
*
@@ -723,6 +731,7 @@ static enum hrtimer_restart rtTimerLinux
static void rtTimerLinuxStdCallback(unsigned long ulUser)
{
PRTTIMERLNXSUBTIMER pSubTimer = (PRTTIMERLNXSUBTIMER)ulUser;
+#endif
PRTTIMER pTimer = pSubTimer->pParent;
RTTIMERLNX_LOG(("stdcallback %p\n", pTimer));
@@ -1584,13 +1593,17 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *pp
else
#endif
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+ timer_setup(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer,rtTimerLinuxStdCallback, TIMER_PINNED);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
init_timer_pinned(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
#else
init_timer(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
pTimer->aSubTimers[iCpu].u.Std.LnxTimer.data = (unsigned long)&pTimer->aSubTimers[iCpu];
pTimer->aSubTimers[iCpu].u.Std.LnxTimer.function = rtTimerLinuxStdCallback;
+#endif
pTimer->aSubTimers[iCpu].u.Std.LnxTimer.expires = jiffies;
pTimer->aSubTimers[iCpu].u.Std.u64NextTS = 0;
}
Index: VirtualBox-5.2.2/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
===================================================================
--- VirtualBox-5.2.2.orig/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
+++ VirtualBox-5.2.2/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
@@ -1058,7 +1058,11 @@ void VGDrvNativeISRMousePollEvent(PVBOXG
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
/** log and dbg_log parameter setter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogGrpSet(const char *pszValue, const struct kernel_param *pParam)
+#else
static int vgdrvLinuxParamLogGrpSet(const char *pszValue, struct kernel_param *pParam)
+#endif
{
if (g_fLoggerCreated)
{
@@ -1073,7 +1077,11 @@ static int vgdrvLinuxParamLogGrpSet(cons
}
/** log and dbg_log parameter getter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogGrpGet(char *pszBuf, const struct kernel_param *pParam)
+#else
static int vgdrvLinuxParamLogGrpGet(char *pszBuf, struct kernel_param *pParam)
+#endif
{
PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() : RTLogRelGetDefaultInstance();
*pszBuf = '\0';
@@ -1084,7 +1092,11 @@ static int vgdrvLinuxParamLogGrpGet(char
/** log and dbg_log_flags parameter setter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, const struct kernel_param *pParam)
+#else
static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, struct kernel_param *pParam)
+#endif
{
if (g_fLoggerCreated)
{
@@ -1098,7 +1110,11 @@ static int vgdrvLinuxParamLogFlagsSet(co
}
/** log and dbg_log_flags parameter getter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogFlagsGet(char *pszBuf, const struct kernel_param *pParam)
+#else
static int vgdrvLinuxParamLogFlagsGet(char *pszBuf, struct kernel_param *pParam)
+#endif
{
PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() : RTLogRelGetDefaultInstance();
*pszBuf = '\0';
@@ -1109,7 +1125,11 @@ static int vgdrvLinuxParamLogFlagsGet(ch
/** log and dbg_log_dest parameter setter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogDstSet(const char *pszValue, const struct kernel_param *pParam)
+#else
static int vgdrvLinuxParamLogDstSet(const char *pszValue, struct kernel_param *pParam)
+#endif
{
if (g_fLoggerCreated)
{
@@ -1123,7 +1143,11 @@ static int vgdrvLinuxParamLogDstSet(cons
}
/** log and dbg_log_dest parameter getter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogDstGet(char *pszBuf, const struct kernel_param *pParam)
+#else
static int vgdrvLinuxParamLogDstGet(char *pszBuf, struct kernel_param *pParam)
+#endif
{
PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() : RTLogRelGetDefaultInstance();
*pszBuf = '\0';
@@ -1134,7 +1158,11 @@ static int vgdrvLinuxParamLogDstGet(char
/** r3_log_to_host parameter setter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamR3LogToHostSet(const char *pszValue, const struct kernel_param *pParam)
+#else
static int vgdrvLinuxParamR3LogToHostSet(const char *pszValue, struct kernel_param *pParam)
+#endif
{
if ( pszValue == NULL
|| *pszValue == '\0'
@@ -1152,7 +1180,11 @@ static int vgdrvLinuxParamR3LogToHostSet
}
/** r3_log_to_host parameter getter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamR3LogToHostGet(char *pszBuf, const struct kernel_param *pParam)
+#else
static int vgdrvLinuxParamR3LogToHostGet(char *pszBuf, struct kernel_param *pParam)
+#endif
{
strcpy(pszBuf, g_DevExt.fLoggingEnabled ? "enabled" : "disabled");
return strlen(pszBuf);
Index: VirtualBox-5.2.2/src/VBox/Additions/linux/drm/vbox_mode.c
===================================================================
--- VirtualBox-5.2.2.orig/src/VBox/Additions/linux/drm/vbox_mode.c
+++ VirtualBox-5.2.2/src/VBox/Additions/linux/drm/vbox_mode.c
@@ -398,11 +398,15 @@ static struct drm_encoder *vbox_best_sin
*connector)
{
int enc_id = connector->encoder_ids[0];
-
/* pick the encoder ids */
if (enc_id)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+ return drm_encoder_find(connector->dev, NULL, enc_id);
+#else
return drm_encoder_find(connector->dev, enc_id);
+#endif
+ LogFunc(("vboxvideo: %d\n", __LINE__));
return NULL;
}
Index: VirtualBox-5.2.2/configure
===================================================================
--- VirtualBox-5.2.2.orig/configure
+++ VirtualBox-5.2.2/configure
@@ -1538,7 +1538,7 @@ EOF
INCQT5=`strip_I "$FLGQT5"`
LIBDIR5=`pkg-config Qt5Core --variable=libdir`
LIBQT5=`pkg-config Qt5Core --libs`
- LIBQT5="-L$LIBDIR5 $LIBQT5"
+ LIBQT5="-L$LIBDIR5 $LIBQT5 -std=c++11"
TOOLQT5=`pkg-config Qt5Core --variable=prefix`
TOOLQT5BIN=`pkg-config Qt5Core --variable=host_bins`
if test_compile "$LIBQT5 $LIBPTHREAD $FLGQT5" qt5 qt5 nofatal; then