diff options
author | Jean-Marc Lenoir | 2021-10-15 14:50:40 +0200 |
---|---|---|
committer | Jean-Marc Lenoir | 2021-10-15 14:50:40 +0200 |
commit | 4870c1496e39f96ca2ac561ca92e29902050cc30 (patch) | |
tree | 973190556ff0fcc6898cc9866e5315e1891eb0df | |
parent | 4984b963b055f73e9dea16976cdbd147ae51c15a (diff) | |
download | aur-4870c1496e39f96ca2ac561ca92e29902050cc30.tar.gz |
Sync with vmware-workstation 16.2.0
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 19 | ||||
-rw-r--r-- | efi-unlocker-patch-1.0.0.txt | 25 | ||||
-rw-r--r-- | vmmon.patch | 145 |
4 files changed, 59 insertions, 134 deletions
@@ -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 = 4 + pkgrel = 5 url = https://www.vmware.com/products/workstation-for-linux.html install = vmware-workstation.install arch = x86_64 @@ -84,7 +84,7 @@ pkgbase = vmware-workstation15 sha256sums = fe1b1be8297f4170406f97dd1f8b385d911faf45afe19cbc0c26b8092b3ddf8d sha256sums = 10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e sha256sums = 273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac - sha256sums = c6192797745e19e6361e005adb98383f8877f0118e1db5c018c67cc88c7cb6e1 + sha256sums = 5f90e47b151017d9a101c918380ee7175c71fe6c50adf5fdd9a9f050ba4257f6 sha256sums = 361a3abf195098a90cbf2a4ce16dbcfcfc224c78284269b6d980972bc3647796 pkgname = vmware-workstation15 @@ -16,7 +16,7 @@ pkgname=vmware-workstation15 pkgver=15.5.7 _buildver=17171714 _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' @@ -121,7 +121,7 @@ sha256sums=( '10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e' '273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac' - 'c6192797745e19e6361e005adb98383f8877f0118e1db5c018c67cc88c7cb6e1' + '5f90e47b151017d9a101c918380ee7175c71fe6c50adf5fdd9a9f050ba4257f6' '361a3abf195098a90cbf2a4ce16dbcfcfc224c78284269b6d980972bc3647796' ) options=(!strip emptydirs) @@ -141,8 +141,7 @@ if [ -n "$_enable_macOS_guests" ]; then _vmware_fusion_ver=11.5.7_17130923 # List of VMware Fusion versions: https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/ -_unlocker_ver=3.0.3 -_efi_unlocker_ver=1.0.0 +_unlocker_ver=3.0.6 makedepends+=( python @@ -153,12 +152,12 @@ makedepends+=( source+=( "https://download3.vmware.com/software/fusion/file/VMware-Fusion-${_vmware_fusion_ver/_/-}.dmg" - "unlocker-${_unlocker_ver}.py::https://raw.githubusercontent.com/paolo-projects/unlocker/${_unlocker_ver}/unlocker.py" - "efi-unlocker-patch-${_efi_unlocker_ver}.txt" + "unlocker-${_unlocker_ver}.py::https://raw.githubusercontent.com/DrDonk/unlocker/v${_unlocker_ver}/unlocker.py" + "efi-patches-${_unlocker_ver}.txt::https://raw.githubusercontent.com/DrDonk/unlocker/v${_unlocker_ver}/uefipatch/efi-patches.txt" ) sha256sums+=( 'c7d58ca44510de6c1ddffe86129ed19982114e742d71e7d81e4a5882036e06e3' - '1c27547dcf6fb2f436c96ee62ae8c7f5cfd14b40d8bbd35dc385e247c4fb7e0f' + '8a61e03d0edbbf60c1c84a43aa87a6e950f82d2c71b968888f019345c2f684f3' '392c1effcdec516000e9f8ffc97f2586524d8953d3e7d6f2c5f93f2acd809d91' ) @@ -200,7 +199,7 @@ prepare() { --extract "$extracted_dir" if [ -n "$_enable_macOS_guests" ]; then - dmg2img VMware-Fusion-${_vmware_fusion_ver/_/-}.dmg VMware-Fusion-${_vmware_fusion_ver/_/-}.iso > /dev/null + dmg2img -s VMware-Fusion-${_vmware_fusion_ver/_/-}.dmg VMware-Fusion-${_vmware_fusion_ver/_/-}.iso 7z e -y VMware-Fusion-${_vmware_fusion_ver/_/-}.iso VMware\ Fusion/VMware\ Fusion.app/Contents/Library/isoimages/\* -o"fusion-isoimages" > /dev/null 2>&1 || true sed -i -e "s|/usr/lib/vmware/|${pkgdir}/usr/lib/vmware/|" "$srcdir/unlocker-${_unlocker_ver}.py" @@ -454,7 +453,7 @@ fi if [ -n "$_enable_macOS_guests" ]; then msg "Patching VMware to enable macOS guest support" - python "$srcdir/unlocker-${_unlocker_ver}.py" > /dev/null + python3 "$srcdir/unlocker-${_unlocker_ver}.py" > /dev/null for isoimage in ${_fusion_isoimages[@]} do @@ -465,7 +464,7 @@ if [ -n "$_enable_macOS_guests" ]; then _efi_arch=(32 64) for arch in ${_efi_arch[@]} do - uefipatch "$pkgdir/usr/lib/vmware/roms/EFI${arch}.ROM" "$srcdir/efi-unlocker-patch-${_efi_unlocker_ver}.txt" -o "$pkgdir/usr/lib/vmware/roms/EFI${arch}.ROM" > /dev/null + uefipatch "$pkgdir/usr/lib/vmware/roms/EFI${arch}.ROM" "$srcdir/efi-patches-${_unlocker_ver}.txt" -o "$pkgdir/usr/lib/vmware/roms/EFI${arch}.ROM" > /dev/null done fi diff --git a/efi-unlocker-patch-1.0.0.txt b/efi-unlocker-patch-1.0.0.txt deleted file mode 100644 index 6451d1db0315..000000000000 --- a/efi-unlocker-patch-1.0.0.txt +++ /dev/null @@ -1,25 +0,0 @@ -# Patch string format -# FileGuid SectionType PatchType:FindPatternOrOffset:ReplacePattern -# Please ensure that the latest symbol in patch string is space - -# Possible section types: -# PE32 image 10 -# Position-independent code 11 -# TE Image 12 -# DXE Dependency 13 -# Version information 14 -# User interface string 15 -# 16-bit code 16 -# Guided freeform 18 -# Raw data 19 -# PEI Dependency 1B -# SMM Dependency 1C -# Please do not try another section types, it can make the resulting image broken - -# Possible patch types: -# P - pattern-based, first parameter is a pattern to find, second - a pattern to replace -# O - offset-based, first parameter is hexadecimal offset, second - a pattern to replace -# Patterns can have . as "any possible value" symbol - -# VMware remove macOS Server check ServerVersion.plist -> SystemVersion.plist -961578FE-B6B7-44C3-AF35-6BC705CD3B3F 10 P:530065007200760065007200560065007200730069006F006E002E0070006C00690073007400:530079007300740065006D00560065007200730069006F006E002E0070006C00690073007400 diff --git a/vmmon.patch b/vmmon.patch index 19ba25431813..6b496decf875 100644 --- a/vmmon.patch +++ b/vmmon.patch @@ -39,6 +39,29 @@ #include "vmware.h" #include "x86apic.h" +@@ -80,6 +83,13 @@ + #error CONFIG_HIGH_RES_TIMERS required for acceptable performance + #endif + ++/* task's state is read-once rather than volatile from 5.14-rc2. */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) || defined(get_current_state) ++#define get_task_state(task) READ_ONCE((task)->__state) ++#else ++#define get_task_state(task) ((task)->state) ++#endif ++ + /* + * Although this is not really related to kernel-compatibility, I put this + * helper macro here for now for a lack of better place --hpreg +@@ -463,7 +473,7 @@ + ASSERT(vcpuid < vm->numVCPUs); + t = vm->vmhost->vcpuSemaTask[vcpuid]; + VCPUSet_Remove(&req, vcpuid); +- if (t && (t->state & TASK_INTERRUPTIBLE)) { ++ if (t && (get_task_state(t) & TASK_INTERRUPTIBLE)) { + wake_up_process(t); + } + } @@ -614,6 +617,15 @@ MutexUnlock(&fastClockMutex, callerID); } @@ -130,7 +153,7 @@ int res; int waitFD = args[0]; int timeoutms = args[2]; -@@ -2566,9 +2610,6 @@ +@@ -2566,22 +2610,19 @@ return MX_WAITERROR; } @@ -140,6 +163,21 @@ { struct poll_wqueues table; 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); + } + @@ -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). @@ -163,6 +201,15 @@ fput(file); /* +@@ -2658,7 +2705,7 @@ + */ + struct task_struct *t = + (struct task_struct *)xchg(&vm->vmhost->vcpuSemaTask[vcpuid], NULL); +- if (t && (t->state & TASK_INTERRUPTIBLE)) { ++ if (t && (get_task_state(t) & TASK_INTERRUPTIBLE)) { + wake_up_process(t); + } + } ROF_EACH_VCPU_IN_SET_WITH_MAX(); @@ -2688,8 +2730,8 @@ int HostIF_SemaphoreSignal(uint64 *args) // IN: @@ -233,99 +280,3 @@ /* * Do not exit thread until we are told to do so. */ -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 -@@ -79,6 +79,8 @@ - #include "pgtbl.h" - #include "versioned_atomic.h" - -+#include "compat_sched.h" -+ - #if !defined(CONFIG_HIGH_RES_TIMERS) - #error CONFIG_HIGH_RES_TIMERS required for acceptable performance - #endif -@@ -466,7 +468,7 @@ HostIF_WakeUpYielders(VMDriver *vm, // IN: - ASSERT(vcpuid < vm->numVCPUs); - 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); - } - } -@@ -2613,14 +2615,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); - } - -@@ -2698,7 +2700,7 @@ HostIF_SemaphoreForceWakeup(VMDriver *vm, // IN: - */ - struct task_struct *t = - (struct task_struct *)xchg(&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_WITH_MAX(); |