commit 0d2973dcb6776085238044694866a229061d1ef3
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Thu Apr 26 00:38:10 2018 +0100
Add fix for kernel 4.17
VirtualBox-kmod.spec | 5 ++++-
fixes_for_4.17.patch | 29 +++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
---
diff --git a/VirtualBox-kmod.spec b/VirtualBox-kmod.spec
index 1ed13c8..7f0b698 100644
--- a/VirtualBox-kmod.spec
+++ b/VirtualBox-kmod.spec
@@ -36,7 +36,7 @@
Name: VirtualBox-kmod
Version: 5.2.10
#Release: 1%%{?prerel:.%%{prerel}}%%{?dist}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Kernel module for VirtualBox
Group: System Environment/Kernel
@@ -122,6 +122,9 @@ DIRS=$(ls %{name}-%{version} |wc -l)
%changelog
+* Wed Apr 25 2018 Sérgio Basto <sergio(a)serjux.com> - 5.2.10-2
+- Add fix for kernel 4.17
+
* Tue Apr 24 2018 Sérgio Basto <sergio(a)serjux.com> - 5.2.10-1
- Update to 5.2.10
diff --git a/fixes_for_4.17.patch b/fixes_for_4.17.patch
new file mode 100644
index 0000000..89cecf9
--- /dev/null
+++ b/fixes_for_4.17.patch
@@ -0,0 +1,29 @@
+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(a)lwfinger.net>
+
+--- VirtualBox-kmod-5.2.10/vboxpci/linux/VBoxPci-linux.c.orig 2018-04-26
00:28:06.691593982 +0100
++++ VirtualBox-kmod-5.2.10/vboxpci/linux/VBoxPci-linux.c 2018-04-26 00:28:32.171875664
+0100
+@@ -89,7 +89,14 @@ MODULE_VERSION(VBOX_VERSION_STRING " r"
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
+ # define PCI_DEV_GET(v,d,p) pci_get_device(v,d,p)
+ # define PCI_DEV_PUT(x) pci_dev_put(x)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
++/* assume the domain number to be zero - exactly the same assumption of
++ * pci_get_bus_and_slot()
++ */
++# define PCI_DEV_GET_SLOT(bus, devfn) pci_get_domain_bus_and_slot(0, bus, devfn)
++#else
+ # define PCI_DEV_GET_SLOT(bus, devfn) pci_get_bus_and_slot(bus, devfn)
++#endif
+ #else
+ # define PCI_DEV_GET(v,d,p) pci_find_device(v,d,p)
+ # define PCI_DEV_PUT(x) do { } while (0)
Show replies by date