diff options
author | Jean-Marc Lenoir | 2019-03-03 20:54:43 +0100 |
---|---|---|
committer | Jean-Marc Lenoir | 2019-03-03 20:54:43 +0100 |
commit | af18c4140fc526fc6ec548679cf86c07981726f9 (patch) | |
tree | 4e34322d9c0aa5bbdda7ee8609bc78c928a2e295 | |
parent | e0bfe4903209b8bba2fef540f9aed263a5c6803c (diff) | |
download | aur-af18c4140fc526fc6ec548679cf86c07981726f9.tar.gz |
Compatibility with Linux 5.0
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | vmmon.patch | 186 | ||||
-rw-r--r-- | vmnet.patch | 115 |
4 files changed, 307 insertions, 6 deletions
@@ -1,7 +1,7 @@ pkgbase = vmware-workstation11 pkgdesc = The industry standard for running multiple operating systems as virtual machines on a single Linux PC. pkgver = 11.1.4 - pkgrel = 4 + pkgrel = 5 url = https://www.vmware.com/products/workstation-for-linux.html install = vmware-workstation.install arch = x86_64 @@ -82,8 +82,8 @@ pkgbase = vmware-workstation11 sha256sums = d7a9fbf39a0345ae2f14f7f389f30b1110f605d187e0c241e99bbb18993c250d sha256sums = 05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487 sha256sums = 6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d - sha256sums = d1aae68a0864d4483039302931b8a571b2c660706d1c7a7572bd9d6fdc099c37 - sha256sums = 7523a9ddd5f6dd00202a8928610a41d135a04497c64ddd2b88fbb155d7a37543 + sha256sums = 3e65bc0c7d8e61ccafa91a02e5c2f63aa8465d1ffb8009885a613c3b79827772 + sha256sums = c255ba20653814158242cb9398a353def0cdb7a4b433b968c1c4e8f573855ad8 sha256sums = 09711e59f708576d2fb09c464ebbb52806cb7f850cb3d5bbeea634fa58fb6c86 sha256sums = 29e0b0db9c0296ab81eee543803c4bd430e2c69c76e33492910e17280da1c05c @@ -16,7 +16,7 @@ pkgname=vmware-workstation11 pkgver=11.1.4 _buildver=3848939 _pkgver=${pkgver}_${_buildver} -pkgrel=4 +pkgrel=5 pkgdesc='The industry standard for running multiple operating systems as virtual machines on a single Linux PC.' arch=(x86_64) url='https://www.vmware.com/products/workstation-for-linux.html' @@ -117,8 +117,8 @@ sha256sums=( '05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487' '6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d' - 'd1aae68a0864d4483039302931b8a571b2c660706d1c7a7572bd9d6fdc099c37' - '7523a9ddd5f6dd00202a8928610a41d135a04497c64ddd2b88fbb155d7a37543' + '3e65bc0c7d8e61ccafa91a02e5c2f63aa8465d1ffb8009885a613c3b79827772' + 'c255ba20653814158242cb9398a353def0cdb7a4b433b968c1c4e8f573855ad8' ) options=(!strip emptydirs) diff --git a/vmmon.patch b/vmmon.patch index 98121825e1f3..3b7fddf79a45 100644 --- a/vmmon.patch +++ b/vmmon.patch @@ -1316,3 +1316,189 @@ index 94aab9e..a6b2c1a 100644 break; } +From 8ba37a5023f939ba8d2e0d91b916ff442b1c18dd Mon Sep 17 00:00:00 2001 +From: Michal Kubecek <mkubecek@suse.cz> +Date: Mon, 31 Dec 2018 00:05:42 +0100 +Subject: [PATCH] modules: replace SUBDIRS with M + +Since commit 0126be38d988 ("kbuild: announce removal of SUBDIRS if used") +in v5.0-rc1, using SUBDIRS when building out of tree modules produces +a deprecation warning. As M used to work since pretty much ever, use it +unconditionally. +--- + vmmon-only/Makefile | 2 +- + vmnet-only/Makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/vmmon-only/Makefile b/vmmon-only/Makefile +index ccdd295..b4b71fb 100644 +--- a/vmmon-only/Makefile ++++ b/vmmon-only/Makefile +@@ -121,7 +121,7 @@ prebuild:: ; + postbuild:: ; + + $(DRIVER_KO): prebuild +- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \ ++ $(MAKE) -C $(BUILD_DIR) M=$$PWD SRCROOT=$$PWD/$(SRCROOT) \ + MODULEBUILDDIR=$(MODULEBUILDDIR) modules + $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \ + MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild +From ca44ce7215b91f82ff500843784b4e86a720fffe Mon Sep 17 00:00:00 2001 +From: Michal Kubecek <mkubecek@suse.cz> +Date: Mon, 31 Dec 2018 00:11:35 +0100 +Subject: [PATCH] vmmon: totalram_pages is a function since 5.0 + +Since commit ca79b0c211af ("mm: convert totalram_pages and totalhigh_pages +variables to atomic") in v5.0-rc1, totalram_pages() is an accessor function +and the actual variable is an atomic. +--- + vmmon-only/linux/hostif.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c +index af4b1d9..d32653c 100644 +--- a/vmmon-only/linux/hostif.c ++++ b/vmmon-only/linux/hostif.c +@@ -211,6 +211,15 @@ static void UnlockEntry(void *clientData, MemTrackEntry *entryPtr); + uint8 monitorIPIVector; + uint8 hvIPIVector; + ++static unsigned long compat_totalram_pages(void) ++{ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) ++ return totalram_pages; ++#else ++ return totalram_pages(); ++#endif ++} ++ + /* + *----------------------------------------------------------------------------- + * +@@ -1601,14 +1610,7 @@ unsigned int + HostIF_EstimateLockedPageLimit(const VMDriver* vm, // IN + unsigned int currentlyLockedPages) // IN + { +- /* +- * This variable is available and exported to modules, +- * since at least 2.6.0. +- */ +- +- extern unsigned long totalram_pages; +- +- unsigned int totalPhysicalPages = totalram_pages; ++ unsigned int totalPhysicalPages = compat_totalram_pages(); + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) + return MemDefaults_CalcMaxLockedPages(totalPhysicalPages); +From c3fb5cda191137afddfdbd2f31bb4b15f9aeb3f2 Mon Sep 17 00:00:00 2001 +From: Michal Kubecek <mkubecek@suse.cz> +Date: Mon, 31 Dec 2018 00:15:11 +0100 +Subject: [PATCH] vmmon: bring back the do_gettimeofday() helper + +The do_gettimeofday() helper was removed by commit e4b92b108c6c +("timekeeping: remove obsolete time accessors") in v5.0-rc1. Bring it back +for users in vmmon-only/linux/hostif.c. + +This feels like a quick and clumsy band aid to allow build with post-4.20 +kernels. On a closer look, the whole gymnastics around uptimeState and +HostIFReadUptimeWork() with jiffies and wall time checking and correcting +each other seems to be a workaround for an absence of high resolution +monotonic time. Considering ktime_get_ts64() is available since 3.17 and +before that, ktime_get_ts() since 2.6.17, perhaps the time has come to +clean all this machinery up. But something like this would be beyond the +scope of this repository. +--- + vmmon-only/include/compat_timekeeping32.h | 15 +++++++++++++++ + vmmon-only/linux/driver.c | 1 + + vmmon-only/linux/hostif.c | 1 + + vmnet-only/bridge.c | 11 +++++++++++ + 4 files changed, 28 insertions(+) + create mode 100644 vmmon-only/include/compat_timekeeping32.h + +diff --git a/vmmon-only/include/compat_timekeeping32.h b/vmmon-only/include/compat_timekeeping32.h +new file mode 100644 +index 0000000..5730dcd +--- /dev/null ++++ b/vmmon-only/include/compat_timekeeping32.h +@@ -0,0 +1,15 @@ ++#ifndef __COMPAT_TIMEKEEPING32_H__ ++#define __COMPAT_TIMEKEEPING32_H__ ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++static inline void do_gettimeofday(struct timeval *tv) ++{ ++ struct timespec64 now; ++ ++ ktime_get_real_ts64(&now); ++ tv->tv_sec = now.tv_sec; ++ tv->tv_usec = now.tv_nsec / 1000; ++} ++#endif ++ ++#endif /* __COMPAT_TIMEKEEPING32_H__ */ +diff --git a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c +index ca4b538..cdc7fc1 100644 +--- a/vmmon-only/linux/driver.c ++++ b/vmmon-only/linux/driver.c +@@ -34,6 +34,7 @@ + #include "compat_version.h" + #include "compat_module.h" + #include "compat_page.h" ++#include "compat_timekeeping32.h" + + #include "usercalldefs.h" + +diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c +index c985aa0..75f4c8a 100644 +--- a/vmmon-only/linux/hostif.c ++++ b/vmmon-only/linux/hostif.c +@@ -102,6 +102,7 @@ + #include "pgtbl.h" + #include "vmmonInt.h" + #include "versioned_atomic.h" ++#include "compat_timekeeping32.h" + + /* + * Determine if we can use high resolution timers. +From 5db3c8a86f435e21f37a2acf386e2e52a1b42aa6 Mon Sep 17 00:00:00 2001 +From: Michal Kubecek <mkubecek@suse.cz> +Date: Sat, 5 Jan 2019 01:54:57 +0100 +Subject: [PATCH] modules: handle access_ok() with two arguments + +Since commit 96d4f267e40f ("Remove 'type' argument from access_ok() +function") in v5.0-rc1, the type argument of access_ok() was dropped. +The same commit also dropped macros VERIFY_READ and VERIFY_WRITE so check +for their existence on pre-5.0 kernels to allow build against kernels with +this change backported. +--- + vmmon-only/linux/hostif.c | 8 +++++++- + vmnet-only/userif.c | 8 +++++++- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c +index 75f4c8a..987932b 100644 +--- a/vmmon-only/linux/hostif.c ++++ b/vmmon-only/linux/hostif.c +@@ -221,6 +221,12 @@ static unsigned long compat_totalram_pages(void) + #endif + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) && defined(VERIFY_WRITE) ++ #define write_access_ok(addr, size) access_ok(VERIFY_WRITE, addr, size) ++#else ++ #define write_access_ok(addr, size) access_ok(addr, size) ++#endif ++ + /* + *----------------------------------------------------------------------------- + * +@@ -3644,7 +3650,7 @@ HostIF_MapUserMem(VA addr, // IN: User memory virtual address + + ASSERT(handle); + +- if (!access_ok(VERIFY_WRITE, p, size)) { ++ if (!write_access_ok(p, size)) { + printk(KERN_ERR "%s: Couldn't verify write to uva 0x%p with size %" + FMTSZ"u\n", __func__, p, size); + diff --git a/vmnet.patch b/vmnet.patch index 2640ec286868..8e99551a5ef2 100644 --- a/vmnet.patch +++ b/vmnet.patch @@ -120,3 +120,118 @@ index 0ee52ec..4e3b923 100644 # define compat_sk_alloc(_bri, _pri) sk_alloc(&init_net, \ PF_NETLINK, _pri, &vmnet_proto, 1) #elif defined(VMW_NETDEV_HAS_NET) +From 8ba37a5023f939ba8d2e0d91b916ff442b1c18dd Mon Sep 17 00:00:00 2001 +From: Michal Kubecek <mkubecek@suse.cz> +Date: Mon, 31 Dec 2018 00:05:42 +0100 +Subject: [PATCH] modules: replace SUBDIRS with M + +Since commit 0126be38d988 ("kbuild: announce removal of SUBDIRS if used") +in v5.0-rc1, using SUBDIRS when building out of tree modules produces +a deprecation warning. As M used to work since pretty much ever, use it +unconditionally. +--- + vmmon-only/Makefile | 2 +- + vmnet-only/Makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/vmnet-only/Makefile b/vmnet-only/Makefile +index caab6b9..c2fc51f 100644 +--- a/vmnet-only/Makefile ++++ b/vmnet-only/Makefile +@@ -121,7 +121,7 @@ prebuild:: ; + postbuild:: ; + + $(DRIVER_KO): prebuild +- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \ ++ $(MAKE) -C $(BUILD_DIR) M=$$PWD SRCROOT=$$PWD/$(SRCROOT) \ + MODULEBUILDDIR=$(MODULEBUILDDIR) modules + $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \ + MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild +From c3fb5cda191137afddfdbd2f31bb4b15f9aeb3f2 Mon Sep 17 00:00:00 2001 +From: Michal Kubecek <mkubecek@suse.cz> +Date: Mon, 31 Dec 2018 00:15:11 +0100 +Subject: [PATCH] vmmon: bring back the do_gettimeofday() helper + +The do_gettimeofday() helper was removed by commit e4b92b108c6c +("timekeeping: remove obsolete time accessors") in v5.0-rc1. Bring it back +for users in vmmon-only/linux/hostif.c. + +This feels like a quick and clumsy band aid to allow build with post-4.20 +kernels. On a closer look, the whole gymnastics around uptimeState and +HostIFReadUptimeWork() with jiffies and wall time checking and correcting +each other seems to be a workaround for an absence of high resolution +monotonic time. Considering ktime_get_ts64() is available since 3.17 and +before that, ktime_get_ts() since 2.6.17, perhaps the time has come to +clean all this machinery up. But something like this would be beyond the +scope of this repository. +--- + vmmon-only/include/compat_timekeeping32.h | 15 +++++++++++++++ + vmmon-only/linux/driver.c | 1 + + vmmon-only/linux/hostif.c | 1 + + vmnet-only/bridge.c | 11 +++++++++++ + 4 files changed, 28 insertions(+) + create mode 100644 vmmon-only/include/compat_timekeeping32.h + +diff --git a/vmnet-only/bridge.c b/vmnet-only/bridge.c +index c569054..6e3249a 100644 +--- a/vmnet-only/bridge.c ++++ b/vmnet-only/bridge.c +@@ -52,6 +52,17 @@ + #include "vnetInt.h" + #include "smac.h" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++static inline void do_gettimeofday(struct timeval *tv) ++{ ++ struct timespec64 now; ++ ++ ktime_get_real_ts64(&now); ++ tv->tv_sec = now.tv_sec; ++ tv->tv_usec = now.tv_nsec / 1000; ++} ++#endif ++ + #define VNET_BRIDGE_HISTORY 48 + + /* +From 5db3c8a86f435e21f37a2acf386e2e52a1b42aa6 Mon Sep 17 00:00:00 2001 +From: Michal Kubecek <mkubecek@suse.cz> +Date: Sat, 5 Jan 2019 01:54:57 +0100 +Subject: [PATCH] modules: handle access_ok() with two arguments + +Since commit 96d4f267e40f ("Remove 'type' argument from access_ok() +function") in v5.0-rc1, the type argument of access_ok() was dropped. +The same commit also dropped macros VERIFY_READ and VERIFY_WRITE so check +for their existence on pre-5.0 kernels to allow build against kernels with +this change backported. +--- + vmmon-only/linux/hostif.c | 8 +++++++- + vmnet-only/userif.c | 8 +++++++- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/vmnet-only/userif.c b/vmnet-only/userif.c +index a7aee04..eecd4f8 100644 +--- a/vmnet-only/userif.c ++++ b/vmnet-only/userif.c +@@ -91,6 +91,12 @@ extern unsigned int vnet_max_qlen; + # define compat_kunmap(page) kunmap((page).p) + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) && defined(VERIFY_WRITE) ++ #define write_access_ok(addr, size) access_ok(VERIFY_WRITE, addr, size) ++#else ++ #define write_access_ok(addr, size) access_ok(addr, size) ++#endif ++ + /* + *----------------------------------------------------------------------------- + * +@@ -148,7 +154,7 @@ VNetUserIfMapPtr(VA uAddr, // IN: pointer to user memory + struct page **p, // OUT: locked page + void **ptr) // OUT: kernel mapped pointer + { +- if (!access_ok(VERIFY_WRITE, (void *)uAddr, size) || ++ if (!write_access_ok((void *)uAddr, size) || + (((uAddr + size - 1) & ~(PAGE_SIZE - 1)) != + (uAddr & ~(PAGE_SIZE - 1)))) { + return -EINVAL; |