summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Marc Lenoir2020-12-12 23:00:49 +0100
committerJean-Marc Lenoir2020-12-12 23:00:49 +0100
commitb1d96a61ced1128c6236d06bffb600e6be42d98d (patch)
tree125b692fa89cd2144434b1a0feecc9481aa51178
parent3c535cd981d73cdd69eafe69ad5fbb74cf2d8246 (diff)
downloadaur-b1d96a61ced1128c6236d06bffb600e6be42d98d.tar.gz
Compatibility with Linux 5.10
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD8
-rw-r--r--vmmon.patch162
-rw-r--r--vmnet.patch34
4 files changed, 188 insertions, 22 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 300c40e29ef2..c556e868df5b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = vmware-workstation15
pkgdesc = The industry standard for running multiple operating systems as virtual machines on a single Linux PC.
pkgver = 15.5.7
- pkgrel = 1
+ pkgrel = 2
url = https://www.vmware.com/products/workstation-for-linux.html
install = vmware-workstation.install
arch = x86_64
@@ -80,8 +80,8 @@ pkgbase = vmware-workstation15
sha256sums = d7a9fbf39a0345ae2f14f7f389f30b1110f605d187e0c241e99bbb18993c250d
sha256sums = 10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e
sha256sums = 273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac
- sha256sums = 3a3470f565c9697ea83ebe6170c43240727535aafcb7c828e1c034c3cdbe3882
- sha256sums = b0673f47bd1da097b92c3f73e4ad1e01f12b7506103abac532c0b4e0ca0a0fd7
+ sha256sums = 904518b48c039611c26bf97a15784f87fcff252ce0858b6af88bbf102f9fe5be
+ sha256sums = 361a3abf195098a90cbf2a4ce16dbcfcfc224c78284269b6d980972bc3647796
pkgname = vmware-workstation15
diff --git a/PKGBUILD b/PKGBUILD
index d56d2f9578c9..67ebb7b8b2da 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,7 +16,7 @@ pkgname=vmware-workstation15
pkgver=15.5.7
_buildver=17171714
_pkgver=${pkgver}_${_buildver}
-pkgrel=1
+pkgrel=2
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=(
'10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e'
'273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac'
- '3a3470f565c9697ea83ebe6170c43240727535aafcb7c828e1c034c3cdbe3882'
- 'b0673f47bd1da097b92c3f73e4ad1e01f12b7506103abac532c0b4e0ca0a0fd7'
+ '904518b48c039611c26bf97a15784f87fcff252ce0858b6af88bbf102f9fe5be'
+ '361a3abf195098a90cbf2a4ce16dbcfcfc224c78284269b6d980972bc3647796'
)
options=(!strip emptydirs)
@@ -438,7 +438,7 @@ fi
-e "s/@PKGVER@/$_pkgver/g" \
-i "$dkms_dir/dkms.conf"
- for module in vmmon vmnet; do # vmblock vmci vsock
+ for module in vmmon vmnet; do
tar -xf "vmware-vmx/lib/modules/source/$module.tar" -C "$dkms_dir"
msg "Patching $module module for DKMS"
patch -p2 --read-only=ignore --directory="$dkms_dir/$module-only" < "$srcdir/$module.patch"
diff --git a/vmmon.patch b/vmmon.patch
index eb8ce8ed830c..b8793376c863 100644
--- a/vmmon.patch
+++ b/vmmon.patch
@@ -1,6 +1,6 @@
--- a/vmmon/Makefile
+++ b/vmmon/Makefile
-@@ -43,7 +43,11 @@ INCLUDE += -I$(SRCROOT)/shared
+@@ -43,7 +43,11 @@
endif
@@ -12,7 +12,7 @@
# Header directory for the running kernel
ifdef LINUXINCLUDE
-@@ -137,7 +137,6 @@
+@@ -137,7 +141,6 @@
endif
# Add Spectre options when available
@@ -31,32 +31,61 @@
#include <asm/uaccess.h>
#include <linux/capability.h>
#include <linux/kthread.h>
-@@ -634,7 +635,24 @@ HostIF_FastClockUnlock(int callerID) // IN
+@@ -54,6 +56,7 @@
+ #include <linux/hrtimer.h>
+ #include <linux/signal.h>
+ #include <linux/taskstats_kern.h> // For linux/sched/signal.h without version check
++#include <linux/eventfd.h>
+
+ #include "vmware.h"
+ #include "x86apic.h"
+@@ -614,6 +617,15 @@
+ MutexUnlock(&fastClockMutex, callerID);
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
++static int crosspage_set_exec(pte_t *pte, unsigned long addr, void *data)
++{
++ struct page *p = data;
++
++ set_pte(pte, mk_pte(p, VM_PAGE_KERNEL_EXEC));
++ return 0;
++}
++#endif
+
+ /*
+ *----------------------------------------------------------------------
+@@ -634,7 +646,29 @@
static void *
MapCrossPage(struct page *p) // IN:
{
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
++#if COMPAT_LINUX_VERSION_CHECK_LT(5, 8, 0)
return vmap(&p, 1, VM_MAP, VM_PAGE_KERNEL_EXEC);
+#else
++ void *addr;
++
++ addr = vmap(&p, 1, VM_MAP, VM_PAGE_KERNEL_EXEC);
++ if (!addr)
++ return NULL;
++
+ /* Starting with 5.8, vmap() always sets the NX bit, but the cross
+ * page needs to be executable. */
-+ pte_t *ptes[1];
-+ struct vm_struct *area = alloc_vm_area(1UL << PAGE_SHIFT, ptes);
-+ if (area == NULL)
++ if (apply_to_page_range(current->mm, (unsigned long)addr, PAGE_SIZE,
++ crosspage_set_exec, p)) {
++ vunmap(addr);
+ return NULL;
-+
-+ set_pte(ptes[0], mk_pte(p, VM_PAGE_KERNEL_EXEC));
++ }
+
+ preempt_disable();
+ __flush_tlb_all();
+ preempt_enable();
+
-+ return area->addr;
++ return addr;
+#endif
}
-@@ -1739,7 +1758,10 @@ HostIF_EstimateLockedPageLimit(const VMDriver* vm, // IN
+@@ -1739,7 +1773,10 @@
lockedPages += global_page_state(NR_PAGETABLE);
#endif
/* NR_SLAB_* moved from zone to node in 4.13. */
@@ -68,7 +97,50 @@
lockedPages += global_node_page_state(NR_SLAB_UNRECLAIMABLE);
#else
lockedPages += global_page_state(NR_SLAB_UNRECLAIMABLE);
-@@ -2590,9 +2612,11 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
+@@ -2389,16 +2426,22 @@
+ static Bool
+ isVAReadable(VA r) // IN:
+ {
+- mm_segment_t old_fs;
+ uint32 dummy;
+ int ret;
+
++#ifdef HAVE_GET_KERNEL_NOFAULT
++ ret = get_kernel_nofault(dummy, (void *)r);
++#else
++ {
++ mm_segment_t old_fs;
++
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);
+ r = APICR_TO_ADDR(r, APICR_VERSION);
+ ret = HostIF_CopyFromUser(&dummy, r, sizeof dummy);
+ set_fs(old_fs);
+-
++ }
++#endif
+ return ret == 0;
+ }
+ #endif
+@@ -2553,7 +2596,6 @@
+ uint64 *args) // IN:
+ {
+ struct file *file;
+- mm_segment_t old_fs;
+ int res;
+ int waitFD = args[0];
+ int timeoutms = args[2];
+@@ -2566,9 +2610,6 @@
+ return MX_WAITERROR;
+ }
+
+- old_fs = get_fs();
+- set_fs(KERNEL_DS);
+-
+ {
+ struct poll_wqueues table;
+ unsigned int mask;
+@@ -2590,9 +2631,11 @@
* the code to happily deal with a pipe or an eventfd. We only care about
* reading no bytes (EAGAIN - non blocking fd) or sizeof(uint64).
*/
@@ -83,7 +155,43 @@
if (res == sizeof value) {
res = MX_WAITNORMAL;
} else {
-@@ -2707,8 +2731,11 @@ HostIF_SemaphoreSignal(uint64 *args) // IN:
+@@ -2601,7 +2644,6 @@
+ }
+ }
+
+- set_fs(old_fs);
+ fput(file);
+
+ /*
+@@ -2688,8 +2730,8 @@
+ int
+ HostIF_SemaphoreSignal(uint64 *args) // IN:
+ {
++ struct eventfd_ctx *eventfd;
+ struct file *file;
+- mm_segment_t old_fs;
+ int res;
+ int signalFD = args[1];
+ uint64 value = 1; // make an eventfd happy should it be there
+@@ -2699,22 +2741,32 @@
+ return MX_WAITERROR;
+ }
+
+- old_fs = get_fs();
+- set_fs(KERNEL_DS);
++ /*
++ * If it's eventfd, use specific eventfd interface as kernel writes
++ * to eventfd may not be allowed in kernel 5.10 and later.
++ */
++ eventfd = eventfd_ctx_fileget(file);
++ if (!IS_ERR(eventfd)) {
++ eventfd_signal(eventfd, 1);
++ fput(file);
++ return MX_WAITNORMAL;
++ }
+
+ /*
+ * Always write sizeof(uint64) bytes. This works fine for eventfd and
* pipes. The data written is formatted to make an eventfd happy should
* it be present.
*/
@@ -97,3 +205,31 @@
if (res == sizeof value) {
res = MX_WAITNORMAL;
+ }
+
+- set_fs(old_fs);
+ fput(file);
+
+ /*
+@@ -3261,12 +3313,9 @@
+ HostIFFastClockThread(void *unused) // IN:
+ {
+ int res;
+- mm_segment_t oldFS;
+ unsigned int rate = 0;
+ unsigned int prevRate = 0;
+
+- oldFS = get_fs();
+- set_fs(KERNEL_DS);
+ allow_signal(SIGKILL);
+
+ while ((rate = linuxState.fastClockRate) > MIN_RATE) {
+@@ -3289,8 +3338,6 @@
+ }
+
+ out:
+- set_fs(oldFS);
+-
+ /*
+ * Do not exit thread until we are told to do so.
+ */
diff --git a/vmnet.patch b/vmnet.patch
index b5a50b53fb2c..daa16401676f 100644
--- a/vmnet.patch
+++ b/vmnet.patch
@@ -1,6 +1,6 @@
--- a/vmnet/Makefile
+++ b/vmnet/Makefile
-@@ -43,7 +43,11 @@ INCLUDE += -I$(SRCROOT)/shared
+@@ -43,7 +43,11 @@
endif
@@ -12,7 +12,7 @@
# Header directory for the running kernel
ifdef LINUXINCLUDE
-@@ -137,7 +137,6 @@
+@@ -137,7 +141,6 @@
endif
# Add Spectre options when available
@@ -20,3 +20,33 @@
include $(SRCROOT)/Makefile.kernel
+--- a/vmnet/userif.c
++++ b/vmnet/userif.c
+@@ -559,7 +559,12 @@
+ return -EINVAL;
+ }
+
++#if COMPAT_LINUX_VERSION_CHECK_LT(5, 10, 0)
+ csum = csum_and_copy_to_user(skb->data + offset, curr, len, 0, &err);
++#else
++ csum = csum_and_copy_to_user(skb->data + offset, curr, len);
++ err = (csum == 0) ? -EFAULT : 0;
++#endif
+ if (err) {
+ return err;
+ }
+@@ -573,8 +578,14 @@
+ const void *vaddr;
+
+ vaddr = kmap(skb_frag_page(frag));
++#if COMPAT_LINUX_VERSION_CHECK_LT(5, 10, 0)
+ tmpCsum = csum_and_copy_to_user(vaddr + skb_frag_off(frag),
+ curr, skb_frag_size(frag), 0, &err);
++#else
++ tmpCsum = csum_and_copy_to_user(vaddr + skb_frag_off(frag),
++ curr, skb_frag_size(frag));
++ err = (tmpCsum == 0) ? -EFAULT : 0;
++#endif
+ kunmap(skb_frag_page(frag));
+
+ if (err) {