summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Marc Lenoir2021-08-01 10:26:26 +0200
committerJean-Marc Lenoir2021-08-01 10:26:26 +0200
commitd099bcd6851aa0581d926ccca62ac277e57abef6 (patch)
treed2207a8689315a662536dc56372de77f7f1284ff
parent018ff9e944d36dfb84d7573f1978df47619863fa (diff)
downloadaur-d099bcd6851aa0581d926ccca62ac277e57abef6.tar.gz
Compatibility with Linux 5.14-rc1
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD4
-rw-r--r--vmmon.patch96
3 files changed, 100 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 11212cc4e0a6..31eeea2d8075 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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 = 15
+ pkgrel = 16
url = https://www.vmware.com/products/workstation-for-linux.html
install = vmware-workstation.install
arch = x86_64
@@ -79,8 +79,7 @@ pkgbase = vmware-workstation11
sha256sums = d7a9fbf39a0345ae2f14f7f389f30b1110f605d187e0c241e99bbb18993c250d
sha256sums = 10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e
sha256sums = 273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac
- sha256sums = eb7b115b3d018cb660ddc985e6388dde1b15c6d41bd0a82d0d4e641fe0515f42
+ sha256sums = c4a4447cd7f3faebb3642bfd28f47955a12d25469bae4d4568bd7c05a3a2215c
sha256sums = 7167b7014109c444d77e5dc8f8e9f30a1911853595f8311745adc5fb078dc39a
pkgname = vmware-workstation11
-
diff --git a/PKGBUILD b/PKGBUILD
index ead8cb0a09b0..b0d70b07aca6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,7 +16,7 @@ pkgname=vmware-workstation11
pkgver=11.1.4
_buildver=3848939
_pkgver=${pkgver}_${_buildver}
-pkgrel=15
+pkgrel=16
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'
@@ -116,7 +116,7 @@ sha256sums=(
'10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e'
'273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac'
- 'eb7b115b3d018cb660ddc985e6388dde1b15c6d41bd0a82d0d4e641fe0515f42'
+ 'c4a4447cd7f3faebb3642bfd28f47955a12d25469bae4d4568bd7c05a3a2215c'
'7167b7014109c444d77e5dc8f8e9f30a1911853595f8311745adc5fb078dc39a'
)
options=(!strip emptydirs)
diff --git a/vmmon.patch b/vmmon.patch
index e8d125817f25..ccd999656f3e 100644
--- a/vmmon.patch
+++ b/vmmon.patch
@@ -1812,3 +1812,99 @@
break;
}
+From 9fda02bce13527ce94a95df1a98fb6188dea22b8 Mon Sep 17 00:00:00 2001
+From: Michal Kubecek <mkubecek@suse.cz>
+Date: Wed, 30 Jun 2021 11:05:16 +0200
+Subject: [PATCH] vmmon: fix task_struct::state access patterns
+
+Mainline commit 2f064a59a11f ("sched: Change task_struct::state") in
+5.14-rc1 finishes a series fixing racy access patterns to task state and
+renames task_struct::state to __state so that code old code acessing it
+directly fails to build.
+
+Two of these in HostIF_SemaphoreWait() can be rewritten into calls to
+set_current_state() unconditionally (second one may do with
+__set_current_state() but I don't feel confident enough about that).
+There are also two places where vmmon code reads task_struct::state;
+provide a compat accessor using READ_ONCE() and use it instead of
+a direct read. To avoid kernel version check, check presence of
+get_current_state() macro introduced in the same commit as state member
+rename.
+---
+ vmmon-only/include/compat_sched.h | 15 +++++++++++++++
+ vmmon-only/linux/hostif.c | 10 ++++++----
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/vmmon-only/include/compat_sched.h b/vmmon-only/include/compat_sched.h
+index 3f3304b..72078e0 100644
+--- a/vmmon-only/include/compat_sched.h
++++ b/vmmon-only/include/compat_sched.h
+@@ -289,5 +289,20 @@ typedef struct pid * compat_pid;
+ #define compat_kill_pid(pid, sig, flag) kill_pid(pid, sig, flag)
+ #endif
+
++/*
++ * Since v5.14-rc1, task_struct::state hase been renamed to __state and is
++ * is longer supposed to be accessed without READ_ONCE/WRITE_ONCE.
++ */
++#ifdef get_current_state
++static inline int compat_get_task_state(const struct task_struct *t)
++{
++ return READ_ONCE(t->__state);
++}
++#else
++static inline int compat_get_task_state(const struct task_struct *t)
++{
++ return READ_ONCE(t->state);
++}
++#endif
+
+ #endif /* __COMPAT_SCHED_H__ */
+diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
+index 137062c..6910f69 100644
+--- a/vmmon-only/linux/hostif.c
++++ b/vmmon-only/linux/hostif.c
+@@ -102,6 +102,8 @@
+ #include "vmmonInt.h"
+ #include "versioned_atomic.h"
+
++#include "compat_sched.h"
++
+ /*
+ * Determine if we can use high resolution timers.
+ */
+@@ -480,7 +482,7 @@ HostIF_WakeUpYielders(VMDriver *vm, // IN:
+ while ((vcpuid = VCPUSet_FindFirst(&req)) != VCPUID_INVALID) {
+ struct task_struct *t = vm->vmhost->vcpuSemaTask[vcpuid];
+ VCPUSet_Remove(&req, vcpuid);
+- if (t && (t->state & TASK_INTERRUPTIBLE)) {
++ if (t && (compat_get_task_state(t) & TASK_INTERRUPTIBLE)) {
+ wake_up_process(t);
+ }
+ }
+@@ -2587,14 +2589,14 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
+ unsigned int mask;
+
+ poll_initwait(&table);
+- current->state = TASK_INTERRUPTIBLE;
++ set_current_state(TASK_INTERRUPTIBLE);
+ mask = file->f_op->poll(file, &table.pt);
+ if (!(mask & (POLLIN | POLLERR | POLLHUP))) {
+ vm->vmhost->vcpuSemaTask[vcpuid] = current;
+ schedule_timeout(timeoutms * HZ / 1000); // convert to Hz
+ vm->vmhost->vcpuSemaTask[vcpuid] = NULL;
+ }
+- current->state = TASK_RUNNING;
++ set_current_state(TASK_RUNNING);
+ poll_freewait(&table);
+ }
+
+@@ -2668,7 +2670,7 @@ HostIF_SemaphoreForceWakeup(VMDriver *vm, // IN:
+ FOR_EACH_VCPU_IN_SET(vcs, vcpuid) {
+ struct task_struct *t = vm->vmhost->vcpuSemaTask[vcpuid];
+ vm->vmhost->vcpuSemaTask[vcpuid] = NULL;
+- if (t && (t->state & TASK_INTERRUPTIBLE)) {
++ if (t && (compat_get_task_state(t) & TASK_INTERRUPTIBLE)) {
+ wake_up_process(t);
+ }
+ } ROF_EACH_VCPU_IN_SET();