1
0
forked from pool/virtualbox
virtualbox/fixes_for_4.17.patch
Larry Finger 423b46b14c - Version bump to 5.2.12 (released May 09 2018 by Oracle)
This is a maintenance release. The following items were fixed and/or added:
    Serial: fixed possible data corruption when sending data under certain circumstances
    Video recording: fixed starting / stopping recording under certain circumstances
    Linux hosts: support Linux 4.17 changes. Thank you Larry Finger
    Linux guests: support Linux 4.16 and EL 7.5 kernels (bugs #17676 and #17678)
    Linux guests: 3D fixes for recent guests (bug #17623)
    File "fixes_for_4.16.patch" is removed - fixed upstream.

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=425
2018-05-11 14:28:09 +00:00

57 lines
1.9 KiB
Diff

In kernel 4.17, pci_get_bus_and_slot() has been removed in favor of
pci_get_domain_bus_and_slot(). It appears that VirtualBox only uses
domain number 0, thus pci_get_domain_bus_and_slot(0, bus, devfn)
is a suitable replacement for pci_get_bus_and_slot(bus, devfn).
The resulting code compiles; however, I do not use PCI passthru, which
I think means that I have not actually tested the code.
This patch released under a combined MIT/GPLv2 license.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Index: VirtualBox-5.2.12/src/VBox/Additions/linux/drm/vbox_ttm.c
===================================================================
--- VirtualBox-5.2.12.orig/src/VBox/Additions/linux/drm/vbox_ttm.c
+++ VirtualBox-5.2.12/src/VBox/Additions/linux/drm/vbox_ttm.c
@@ -208,10 +208,15 @@ static struct ttm_backend_func vbox_tt_b
.destroy = &vbox_ttm_backend_destroy,
};
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
+static struct ttm_tt *vbox_ttm_tt_create(struct ttm_buffer_object *bo,
+ u32 page_flags)
+#else
static struct ttm_tt *vbox_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size,
u32 page_flags,
struct page *dummy_read_page)
+#endif
{
struct ttm_tt *tt;
@@ -220,7 +225,11 @@ static struct ttm_tt *vbox_ttm_tt_create
return NULL;
tt->func = &vbox_tt_backend_func;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
+ if (ttm_tt_init(tt, bo, page_flags)) {
+#else
if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) {
+#endif
kfree(tt);
return NULL;
}
@@ -401,7 +410,11 @@ int vbox_bo_create(struct drm_device *de
ret = ttm_bo_init(&vbox->ttm.bdev, &vboxbo->bo, size,
ttm_bo_type_device, &vboxbo->placement,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
+ align >> PAGE_SHIFT, false, acc_size,
+#else
align >> PAGE_SHIFT, false, NULL, acc_size,
+#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_73)
NULL,
#endif