summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Marc Lenoir2019-07-27 13:05:23 +0200
committerJean-Marc Lenoir2019-07-27 13:05:23 +0200
commit6875857c014ede536d55a78cc353495e989e1c0d (patch)
tree0ec141524f0f7a4b4d88cb56168a6808276b5778
parentb1d2d376f3b05ebe0416c891ec5770c6521a5a85 (diff)
downloadaur-6875857c014ede536d55a78cc353495e989e1c0d.tar.gz
Compatibility with Linux 5.3-rc1
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD6
-rw-r--r--vmmon.patch385
-rw-r--r--vmnet.patch146
4 files changed, 235 insertions, 308 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 18bf847087a..8dc59e918d6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = vmware-workstation12
pkgdesc = The industry standard for running multiple operating systems as virtual machines on a single Linux PC.
pkgver = 12.5.9
- pkgrel = 8
+ pkgrel = 9
url = https://www.vmware.com/products/workstation-for-linux.html
install = vmware-workstation.install
arch = x86_64
@@ -85,8 +85,8 @@ pkgbase = vmware-workstation12
sha256sums = d7a9fbf39a0345ae2f14f7f389f30b1110f605d187e0c241e99bbb18993c250d
sha256sums = 05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487
sha256sums = 6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d
- sha256sums = 729866366b4cb51fed53c6bc9e7cdb9a5679c063ed3a1e3d60750adfa51f817c
- sha256sums = 0363bf465990c726f6f238360f984a63ac1a715ee837561e2bc13e0c0f078a00
+ sha256sums = 030c9147ee1c6ab18a5c526e954fd25faade4beb084e692f55251a916cfbb2ac
+ sha256sums = fc2c3623b76da9c7a368509e66d9baef077eab8980537c0d40fd0a019c7ef833
sha256sums = 78aaa6ba65d178d6242ad73b7e2e552ec707798ce5f4925a0adebf30f844dc17
sha256sums = 6327a76c2503f56d8bc67279f289ed4bb53e236d965ad78c0fcf7ee9e2bbb6c6
sha256sums = 29e0b0db9c0296ab81eee543803c4bd430e2c69c76e33492910e17280da1c05c
diff --git a/PKGBUILD b/PKGBUILD
index 84aae217c82..05072800d27 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,7 +16,7 @@ pkgname=vmware-workstation12
pkgver=12.5.9
_buildver=7535481
_pkgver=${pkgver}_${_buildver}
-pkgrel=8
+pkgrel=9
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'
@@ -118,8 +118,8 @@ sha256sums=(
'05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487'
'6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d'
- '729866366b4cb51fed53c6bc9e7cdb9a5679c063ed3a1e3d60750adfa51f817c'
- '0363bf465990c726f6f238360f984a63ac1a715ee837561e2bc13e0c0f078a00'
+ '030c9147ee1c6ab18a5c526e954fd25faade4beb084e692f55251a916cfbb2ac'
+ 'fc2c3623b76da9c7a368509e66d9baef077eab8980537c0d40fd0a019c7ef833'
)
options=(!strip emptydirs)
diff --git a/vmmon.patch b/vmmon.patch
index 778c9b36793..40fd37b85c3 100644
--- a/vmmon.patch
+++ b/vmmon.patch
@@ -1,5 +1,3 @@
-diff --git a/vmmon/Makefile b/vmmon/Makefile
-index de8162e..6124a71 100644
--- a/vmmon/Makefile
+++ b/vmmon/Makefile
@@ -43,7 +43,11 @@ INCLUDE += -I$(SRCROOT)/shared
@@ -14,41 +12,25 @@ index de8162e..6124a71 100644
# Header directory for the running kernel
ifdef LINUXINCLUDE
-From: Michal Kubecek <mkubecek@suse.cz>
-Date: Mon, 26 Mar 2018 13:33:32 +0200
-Subject: [PATCH] vmmon: fix indirect call with retpoline build
-diff --git a/vmmon/common/task.c b/vmmon/common/task.c
-index 98cc74a..400ebfe 100644
---- a/vmmon/common/task.c
-+++ b/vmmon/common/task.c
-@@ -1597,12 +1597,23 @@ TaskSwitchToMonitor(VMCrossPage *crosspage)
- {
- uint64 raxGetsWiped, rcxGetsWiped;
-
-+#ifdef CALL_NOSPEC
-+ __asm__ __volatile__(CALL_NOSPEC
-+ : "=a" (raxGetsWiped),
-+ "=c" (rcxGetsWiped)
-+ : "0" (codePtr),
-+ "1" (crosspage),
-+ THUNK_TARGET(codePtr)
-+ : "rdx", "r8", "r9", "r10", "r11", "cc", "memory");
-+#else
- __asm__ __volatile__("call *%%rax"
- : "=a" (raxGetsWiped),
- "=c" (rcxGetsWiped)
- : "0" (codePtr),
- "1" (crosspage)
- : "rdx", "r8", "r9", "r10", "r11", "cc", "memory");
-+#endif
-+
- }
- #elif defined(_MSC_VER)
- /*
-diff --git a/vmmon/linux/driver.c b/vmmon/linux/driver.c
-index 87cf45b..5390a93 100644
--- a/vmmon/linux/driver.c
+++ b/vmmon/linux/driver.c
+@@ -80,6 +80,16 @@
+
+ struct VMXLinuxState linuxState;
+
++#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
+
+ /*
+ *----------------------------------------------------------------------
@@ -115,7 +115,7 @@
#endif
static int LinuxDriverMmap(struct file *filp, struct vm_area_struct *vma);
@@ -115,8 +97,6 @@ index 87cf45b..5390a93 100644
{
LinuxDriverWakeUp(FALSE);
}
-diff --git a/vmmon/linux/hostif.c b/vmmon/linux/hostif.c
-index fd32013..583d6da 100644
--- a/vmmon/linux/hostif.c
+++ b/vmmon/linux/hostif.c
@@ -1164,16 +1172,7 @@
@@ -137,6 +117,20 @@ index fd32013..583d6da 100644
return retval != numPages;
}
+@@ -1574,9 +1565,13 @@
+ * since at least 2.6.0.
+ */
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
+ extern unsigned long totalram_pages;
+
+ unsigned int totalPhysicalPages = totalram_pages;
++#else
++ unsigned int totalPhysicalPages = totalram_pages();
++#endif
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
+ return MemDefaults_CalcMaxLockedPages(totalPhysicalPages);
@@ -1594,17 +1593,34 @@ HostIF_EstimateLockedPageLimit(const VMDriver* vm, // IN
unsigned int reservedPages = MEMDEFAULTS_MIN_HOST_PAGES;
unsigned int hugePages = (vm == NULL) ? 0 :
@@ -180,7 +174,64 @@ index fd32013..583d6da 100644
if (anonPages > swapPages) {
lockedPages += anonPages - swapPages;
-@@ -1699,9 +1715,6 @@
+@@ -1664,6 +1676,49 @@
+ /*
+ *----------------------------------------------------------------------
+ *
++ * HostIFGetTime --
++ *
++ * Reads the current time in UPTIME_FREQ units.
++ *
++ * Results:
++ * The uptime, in units of UPTIME_FREQ.
++ *
++ * Side effects:
++ * None.
++ *
++ *----------------------------------------------------------------------
++ */
++
++static uint64
++HostIFGetTime(void)
++{
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
++ struct timeval tv;
++
++ do_gettimeofday(&tv);
++ return tv.tv_usec * (UPTIME_FREQ / 1000000) + tv.tv_sec * UPTIME_FREQ;
++#else
++ struct timespec64 now;
++
++ /*
++ * Use raw time used by Posix timers. This time is not affected by
++ * NTP adjustments, so it may drift from real time and monotonic time,
++ * but it will stay in sync with other timers.
++ */
++ ktime_get_raw_ts64(&now);
++ /*
++ * UPTIME_FREQ resolution is lower than tv_nsec,
++ * so we have to do division...
++ */
++ ASSERT_ON_COMPILE(1000000000 % UPTIME_FREQ == 0);
++ return now.tv_nsec / (1000000000 / UPTIME_FREQ) + now.tv_sec * UPTIME_FREQ;
++#endif
++}
++
++
++/*
++ *----------------------------------------------------------------------
++ *
+ * HostIFReadUptimeWork --
+ *
+ * Reads the current uptime. The uptime is based on getimeofday,
+@@ -1692,16 +1747,12 @@
+ static uint64
+ HostIFReadUptimeWork(unsigned long *j) // OUT: current jiffies
+ {
+- struct timeval tv;
+ uint64 monotime, uptime, upBase, monoBase;
+ int64 diff;
+ uint32 version;
unsigned long jifs, jifBase;
unsigned int attempts = 0;
@@ -190,6 +241,21 @@ index fd32013..583d6da 100644
retry:
do {
version = VersionedAtomic_BeginTryRead(&uptimeState.version);
+@@ -1710,13 +1761,12 @@
+ monoBase = uptimeState.monotimeBase;
+ } while (!VersionedAtomic_EndTryRead(&uptimeState.version, version));
+
+- do_gettimeofday(&tv);
++ uptime = HostIFGetTime();
+ upBase = Atomic_Read64(&uptimeState.uptimeBase);
+
+ monotime = (uint64)(jifs - jifBase) * (UPTIME_FREQ / HZ);
+ monotime += monoBase;
+
+- uptime = tv.tv_usec * (UPTIME_FREQ / 1000000) + tv.tv_sec * UPTIME_FREQ;
+ uptime += upBase;
+
+ /*
@@ -1767,7 +1804,7 @@ HostIFReadUptimeWork(unsigned long *j) // OUT: current jiffies
*/
@@ -199,9 +265,20 @@ index fd32013..583d6da 100644
{
unsigned long jifs;
uintptr_t flags;
-@@ -1829,8 +1866,13 @@ HostIF_InitUptime(void)
- -(tv.tv_usec * (UPTIME_FREQ / 1000000) +
- tv.tv_sec * UPTIME_FREQ));
+@@ -1821,16 +1871,19 @@
+ void
+ HostIF_InitUptime(void)
+ {
+- struct timeval tv;
++ uint64 tm;
+
+ uptimeState.jiffiesBase = jiffies;
+- do_gettimeofday(&tv);
+- Atomic_Write64(&uptimeState.uptimeBase,
+- -(tv.tv_usec * (UPTIME_FREQ / 1000000) +
+- tv.tv_sec * UPTIME_FREQ));
++ tm = HostIFGetTime();
++ Atomic_Write64(&uptimeState.uptimeBase, -tm);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) && !defined(timer_setup)
init_timer(&uptimeState.timer);
@@ -214,6 +291,20 @@ index fd32013..583d6da 100644
mod_timer(&uptimeState.timer, jiffies + HZ);
}
+@@ -3572,7 +3625,12 @@
+
+ ASSERT(handle);
+
+- if (!access_ok(VERIFY_WRITE, p, size)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
++ if (!access_ok(VERIFY_WRITE, p, size))
++#else
++ if (!access_ok(p, size))
++#endif
++ {
+ printk(KERN_ERR "%s: Couldn't verify write to uva 0x%p with size %"
+ FMTSZ"u\n", __func__, p, size);
+
From 8ba37a5023f939ba8d2e0d91b916ff442b1c18dd Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Mon, 31 Dec 2018 00:05:42 +0100
@@ -241,165 +332,6 @@ index ccdd295..b4b71fb 100644
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
-@@ -207,6 +207,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
-+}
-+
- /*
- *-----------------------------------------------------------------------------
- *
-@@ -1560,14 +1569,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
-@@ -98,6 +98,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
-@@ -217,6 +217,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
-+
- /*
- *-----------------------------------------------------------------------------
- *
-@@ -3585,7 +3591,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);
-
From 41413a9b6e660a93600a438944d85b6f51eb680c Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Tue, 5 Mar 2019 13:21:35 +0100
@@ -417,7 +349,7 @@ diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
index ef88a22..8ca17de 100644
--- a/vmmon-only/linux/hostif.c
+++ b/vmmon-only/linux/hostif.c
-@@ -2270,7 +2270,7 @@ isVAReadable(VA r) // IN:
+@@ -2304,7 +2304,7 @@ isVAReadable(VA r) // IN:
int ret;
old_fs = get_fs();
@@ -426,7 +358,7 @@ index ef88a22..8ca17de 100644
r = APICR_TO_ADDR(r, APICR_VERSION);
ret = HostIF_CopyFromUser(&dummy, (void*)r, sizeof(dummy));
set_fs(old_fs);
-@@ -2471,7 +2471,7 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
+@@ -2505,7 +2505,7 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
}
old_fs = get_fs();
@@ -435,7 +367,7 @@ index ef88a22..8ca17de 100644
{
struct poll_wqueues table;
-@@ -2600,7 +2600,7 @@ HostIF_SemaphoreSignal(uint64 *args) // IN:
+@@ -2634,7 +2634,7 @@ HostIF_SemaphoreSignal(uint64 *args) // IN:
}
old_fs = get_fs();
@@ -468,17 +400,17 @@ diff --git a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c
index cdc7fc1..fd9fdac 100644
--- a/vmmon-only/linux/driver.c
+++ b/vmmon-only/linux/driver.c
-@@ -81,6 +81,9 @@ static Bool LinuxDriverCheckPadding(void);
-
- struct VMXLinuxState linuxState;
-
+@@ -90,6 +90,9 @@ static Bool LinuxDriverCheckPadding(void);
+ tv->tv_usec = now.tv_nsec / 1000;
+ }
+ #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)
+typedef int vm_fault_t;
+#endif
/*
*----------------------------------------------------------------------
-@@ -106,9 +109,9 @@ long LinuxDriver_Ioctl(struct file *filp, u_int iocmd,
+@@ -115,9 +118,9 @@ long LinuxDriver_Ioctl(struct file *filp, u_int iocmd,
static int LinuxDriver_Close(struct inode *inode, struct file *filp);
static unsigned int LinuxDriverPoll(struct file *file, poll_table *wait);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
@@ -490,7 +422,7 @@ index cdc7fc1..fd9fdac 100644
#else
static struct page *LinuxDriverNoPage(struct vm_area_struct *vma,
unsigned long address,
-@@ -893,11 +896,11 @@ LinuxDriverPollTimeout(compat_timer_arg_t unused) // IN:
+@@ -902,11 +905,11 @@ LinuxDriverPollTimeout(compat_timer_arg_t unused) // IN:
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
@@ -505,3 +437,38 @@ index cdc7fc1..fd9fdac 100644
#else
static struct page *LinuxDriverNoPage(struct vm_area_struct *vma, //IN
unsigned long address, //IN
+From d20641f619bd3766cf5b50b2c750700eab189bd9 Mon Sep 17 00:00:00 2001
+From: Michal Kubecek <mkubecek@suse.cz>
+Date: Tue, 9 Jul 2019 21:07:04 +0200
+Subject: [PATCH] vmmon: fix HostIF_SetFastClockRate() not to use force_sig()
+
+Commit 3cf5d076fb4d ("signal: Remove task parameter from force_sig") in
+v5.3-rc1 drops second argument of force_sig(); before that, all callers
+which passed something else than current task as second argument were
+fixed, mostly to use send_sig() instead.
+
+The situation in HostIF_SetFastClockRate() is the same as e.g. in bpfilter
+call fixed by commit 1dfd1711de29 ("signal/bpfilter: Fix bpfilter_kernl to
+use send_sig not force_sig"): locking in force_sig_info() cannot handle
+task exiting and using force_sig() for SIGKILL is pointless anyway as this
+signal cannot be blocked.
+
+As send_sig() is present with unchanged signature since the pre-git era, we
+can use send_sig() unconditionally, regardless of kernel version.
+---
+ vmmon-only/linux/hostif.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
+index 210f281..4da863b 100644
+--- a/vmmon-only/linux/hostif.c
++++ b/vmmon-only/linux/hostif.c
+@@ -3577,7 +3577,7 @@ HostIF_SetFastClockRate(unsigned int rate) // IN: Frequency in Hz.
+ }
+ } else {
+ if (linuxState.fastClockThread) {
+- force_sig(SIGKILL, linuxState.fastClockThread);
++ send_sig(SIGKILL, linuxState.fastClockThread, 1);
+ kthread_stop(linuxState.fastClockThread);
+ close_rtc(linuxState.fastClockFile, current->files);
+
diff --git a/vmnet.patch b/vmnet.patch
index 5fb47a5dbdb..75b9d57c041 100644
--- a/vmnet.patch
+++ b/vmnet.patch
@@ -1,5 +1,3 @@
-diff --git a/vmnet/Makefile b/vmnet/Makefile
-index 459846e..cd29652 100644
--- a/vmnet/Makefile
+++ b/vmnet/Makefile
@@ -43,7 +43,11 @@ INCLUDE += -I$(SRCROOT)/shared
@@ -14,7 +12,6 @@ index 459846e..cd29652 100644
# Header directory for the running kernel
ifdef LINUXINCLUDE
-diff --git a/vmnet/bridge.c b/vmnet/bridge.c
--- a/vmnet/bridge.c
+++ b/vmnet/bridge.c
@@ -636,7 +636,7 @@
@@ -26,8 +23,6 @@ diff --git a/vmnet/bridge.c b/vmnet/bridge.c
clone->dev = dev;
clone->protocol = eth_type_trans(clone, dev);
-diff --git a/vmnet/userif.c b/vmnet/userif.c
-index 94146f6..5298406 100644
--- a/vmnet/userif.c
+++ b/vmnet/userif.c
@@ -115,16 +115,7 @@
@@ -48,6 +43,59 @@ index 94146f6..5298406 100644
if (retval != 1) {
return NULL;
+@@ -152,16 +143,21 @@
+ */
+
+ static INLINE int
+-VNetUserIfMapPtr(VA uAddr, // IN: pointer to user memory
++VNetUserIfMapPtr(VA64 uAddr, // IN: pointer to user memory
+ size_t size, // IN: size of data
+ struct page **p, // OUT: locked page
+ void **ptr) // OUT: kernel mapped pointer
+ {
+- if (!access_ok(VERIFY_WRITE, (void *)uAddr, size) ||
+- (((uAddr + size - 1) & ~(PAGE_SIZE - 1)) !=
+- (uAddr & ~(PAGE_SIZE - 1)))) {
++ uint8 v;
++
++ /* Check area does not straddle two pages. */
++ if ((uAddr & (PAGE_SIZE - 1)) + size > PAGE_SIZE) {
+ return -EINVAL;
+ }
++ /* Check if it is user's area. UserifLockPage() checks writability. */
++ if (copy_from_user(&v, (void *)(unsigned long)uAddr, sizeof v) != 0) {
++ return -EFAULT;
++ }
+
+ *p = UserifLockPage(uAddr);
+ if (*p == NULL) {
+@@ -173,7 +169,7 @@
+ }
+
+ static INLINE int
+-VNetUserIfMapUint32Ptr(VA uAddr, // IN: pointer to user memory
++VNetUserIfMapUint32Ptr(VA64 uAddr, // IN: pointer to user memory
+ struct page **p, // OUT: locked page
+ uint32 **ptr) // OUT: kernel mapped pointer
+ {
+@@ -218,7 +214,7 @@
+ return -EBUSY;
+ }
+
+- if ((retval = VNetUserIfMapUint32Ptr((VA)vn->pollPtr, &pollPage,
++ if ((retval = VNetUserIfMapUint32Ptr(vn->pollPtr, &pollPage,
+ &pollPtr)) < 0) {
+ return retval;
+ }
+@@ -236,7 +232,7 @@
+ goto error_free;
+ }
+
+- if ((retval = VNetUserIfMapUint32Ptr((VA)vn->recvClusterPtr,
++ if ((retval = VNetUserIfMapUint32Ptr(vn->recvClusterPtr,
+ &recvClusterPage,
+ &recvClusterCount)) < 0) {
+ goto error_free;
From 8ba37a5023f939ba8d2e0d91b916ff442b1c18dd Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Mon, 31 Dec 2018 00:05:42 +0100
@@ -75,91 +123,3 @@ index caab6b9..c2fc51f 100644
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;