Upgrade app-emulation/vmware-workstation

Added:
	app-emulation/vmware-workstation-15.0.1.10737736
	app-emulation/vmware-modules-330.0.1
Removed:
	app-emulation/vmware-workstation-14.1.2.8497320-r3
	app-emulation/vmware-modules-329.1.2.ebuild
This commit is contained in:
Sergey Morozov
2018-11-18 15:38:22 +03:00
parent f07b1acaaa
commit e0062f011b
11 changed files with 212 additions and 1166 deletions

View File

@@ -1,14 +1,22 @@
From 3f2a6c720f68860e3482c81eb49737ad9a05606d Mon Sep 17 00:00:00 2001
From 70ed9dd2ec64c09fbd0de27dcb10f9948a2b212a Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sun, 17 Jun 2018 15:54:09 +0200
Subject: [PATCH 4/4] vmmon: compatibility with eventpoll switch to poll_mask()
Date: Mon, 20 Aug 2018 07:46:13 +0200
Subject: [PATCH] vmmon: check presence of file_operations::poll()
Since commit 11c5ad0ec441 ("eventpoll: switch to ->poll_mask") in
v4.18-rc1, eventpoll switched from ->poll() to ->poll_mask(). Rather than
calling the callback directly (which would result in null pointer
dereference), use vfs_poll() wrapper. As this wrapper is only available
since 4.18-rc1 cycle as well, provide a copy to use when building against
older kernels.
Commit 11c5ad0ec441 ("eventpoll: switch to ->poll_mask") in v4.18-rc1, made
eventpoll switch from ->poll() to ->poll_mask(), resulting in a null
pointer dereference as vmmon calls the callback directly without checking
its availability.
Rather than calling the callback directly (which would result in null
pointer dereference), use vfs_poll() wrapper. As this wrapper is only
available since 4.18-rc1 cycle as well, provide a copy to use when building
against older kernels.
Note: even if the commit revealing the problem was reverted in 4.18-rc3
(and is unlikely to go back in the same form) so that vmmon no longer
crashes with 4.18 kernel, calling the callback without a check is a bad
practice so let's keep the patch in place.
---
vmmon-only/include/compat_poll.h | 30 ++++++++++++++++++++++++++++++
vmmon-only/linux/hostif.c | 3 ++-
@@ -52,7 +60,7 @@ index 0000000..562cdb6
+
+#endif /* __COMPAT_POLL_H__ */
diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
index b793539..61d00df 100644
index 21758c2..af4b1d9 100644
--- a/vmmon-only/linux/hostif.c
+++ b/vmmon-only/linux/hostif.c
@@ -74,6 +74,7 @@
@@ -63,7 +71,7 @@ index b793539..61d00df 100644
#if !defined(CONFIG_HIGH_RES_TIMERS)
#error CONFIG_HIGH_RES_TIMERS required for acceptable performance
@@ -2373,7 +2374,7 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
@@ -2570,7 +2571,7 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
poll_initwait(&table);
current->state = TASK_INTERRUPTIBLE;
@@ -73,5 +81,5 @@ index b793539..61d00df 100644
vm->vmhost->vcpuSemaTask[vcpuid] = current;
schedule_timeout(timeoutms * HZ / 1000); // convert to Hz
--
2.18.0
2.19.0

View File

@@ -1,84 +0,0 @@
--- a/vsock-only/linux/notify.c 2017-10-03 06:52:10.953893050 +0300
+++ b/vsock-only/linux/notify.c 2017-10-03 05:42:48.642701836 +0300
@@ -1193,20 +1193,20 @@ VSockVmciNotifyPktProcessNegotiate(struc
/* Socket control packet based operations. */
-VSockVmciNotifyOps vSockVmciNotifyPktOps = {
- VSockVmciNotifyPktSocketInit,
- VSockVmciNotifyPktSocketDestruct,
- VSockVmciNotifyPktPollIn,
- VSockVmciNotifyPktPollOut,
- VSockVmciNotifyPktHandlePkt,
- VSockVmciNotifyPktRecvInit,
- VSockVmciNotifyPktRecvPreBlock,
- VSockVmciNotifyPktRecvPreDequeue,
- VSockVmciNotifyPktRecvPostDequeue,
- VSockVmciNotifyPktSendInit,
- VSockVmciNotifyPktSendPreBlock,
- VSockVmciNotifyPktSendPreEnqueue,
- VSockVmciNotifyPktSendPostEnqueue,
- VSockVmciNotifyPktProcessRequest,
- VSockVmciNotifyPktProcessNegotiate,
+VSockVmciNotifyOps vSockVmciNotifyPktOps __refdata = {
+ .socketInit = VSockVmciNotifyPktSocketInit,
+ .socketDestruct = VSockVmciNotifyPktSocketDestruct,
+ .pollIn = VSockVmciNotifyPktPollIn,
+ .pollOut = VSockVmciNotifyPktPollOut,
+ .handleNotifyPkt = VSockVmciNotifyPktHandlePkt,
+ .recvInit = VSockVmciNotifyPktRecvInit,
+ .recvPreBlock = VSockVmciNotifyPktRecvPreBlock,
+ .recvPreDequeue = VSockVmciNotifyPktRecvPreDequeue,
+ .recvPostDequeue = VSockVmciNotifyPktRecvPostDequeue,
+ .sendInit = VSockVmciNotifyPktSendInit,
+ .sendPreBlock = VSockVmciNotifyPktSendPreBlock,
+ .sendPreEnqueue = VSockVmciNotifyPktSendPreEnqueue,
+ .sendPostEnqueue = VSockVmciNotifyPktSendPostEnqueue,
+ .processRequest = VSockVmciNotifyPktProcessRequest,
+ .processNegotiate = VSockVmciNotifyPktProcessNegotiate,
};
diff -urp a/vsock-only/linux/notifyQState.c b/vsock-only/linux/notifyQState.c
--- a/vsock-only/linux/notifyQState.c 2017-10-03 06:52:10.952893329 +0300
+++ b/vsock-only/linux/notifyQState.c 2017-10-03 05:43:02.950697125 +0300
@@ -771,21 +770,24 @@ VSockVmciNotifyPktProcessNegotiate(struc
}
-/* Socket always on control packet based operations. */
-VSockVmciNotifyOps vSockVmciNotifyPktQStateOps = {
- VSockVmciNotifyPktSocketInit,
- VSockVmciNotifyPktSocketDestruct,
- VSockVmciNotifyPktPollIn,
- VSockVmciNotifyPktPollOut,
- VSockVmciNotifyPktHandlePkt,
- VSockVmciNotifyPktRecvInit,
- VSockVmciNotifyPktRecvPreBlock,
- NULL, /* recvPreDequeue */
- VSockVmciNotifyPktRecvPostDequeue,
- VSockVmciNotifyPktSendInit,
- NULL, /* sendPreBlock */
- NULL, /* sendPreEnqueue */
- VSockVmciNotifyPktSendPostEnqueue,
- VSockVmciNotifyPktProcessRequest,
- VSockVmciNotifyPktProcessNegotiate,
+
+
+// Socket always on control packet based operations.
+VSockVmciNotifyOps vSockVmciNotifyPktQStateOps __refdata = {
+ .socketInit = VSockVmciNotifyPktSocketInit,
+ .socketDestruct = VSockVmciNotifyPktSocketDestruct,
+ .pollIn = VSockVmciNotifyPktPollIn,
+ .pollOut = VSockVmciNotifyPktPollOut,
+ .handleNotifyPkt = VSockVmciNotifyPktHandlePkt,
+ .recvInit = VSockVmciNotifyPktRecvInit,
+ .recvPreBlock = VSockVmciNotifyPktRecvPreBlock,
+ .recvPreDequeue = NULL,
+ .recvPostDequeue = VSockVmciNotifyPktRecvPostDequeue,
+ .sendInit = VSockVmciNotifyPktSendInit,
+ .sendPreBlock = NULL,
+ .sendPreEnqueue = NULL,
+ .sendPostEnqueue = VSockVmciNotifyPktSendPostEnqueue,
+ .processRequest = VSockVmciNotifyPktProcessRequest,
+ .processNegotiate = VSockVmciNotifyPktProcessNegotiate,
+
};

View File

@@ -1,461 +0,0 @@
diff --git a/vmblock-only/Makefile b/vmblock-only/Makefile
index bbfe225..8ec1a86 100644
--- a/vmblock-only/Makefile
+++ b/vmblock-only/Makefile
@@ -43,7 +43,11 @@ INCLUDE += -I$(SRCROOT)/shared
endif
+ifdef KVERSION
+VM_UNAME = $(KVERSION)
+else
VM_UNAME = $(shell uname -r)
+endif
# Header directory for the running kernel
ifdef LINUXINCLUDE
diff --git a/vmblock-only/Makefile.kernel b/vmblock-only/Makefile.kernel
index ab7a727..e3ec9d2 100644
--- a/vmblock-only/Makefile.kernel
+++ b/vmblock-only/Makefile.kernel
@@ -19,7 +19,7 @@
INCLUDE += -I$(SRCROOT)/include
-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
+EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/cachecreate.c, -DVMW_KMEMCR_HAS_DTOR, )
EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/cachector.c, -DVMW_KMEMCR_CTOR_HAS_3_ARGS, )
diff --git a/vmblock-only/linux/control.c b/vmblock-only/linux/control.c
index 79716bd..5b6acb2 100644
--- a/vmblock-only/linux/control.c
+++ b/vmblock-only/linux/control.c
@@ -29,7 +29,7 @@
#include <linux/stat.h>
#include <linux/fs.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include "vmblockInt.h"
#include "block.h"
@@ -208,9 +208,17 @@ SetupProcDevice(void)
VMBlockSetProcEntryOwner(controlProcMountpoint);
/* Create /proc/fs/vmblock/dev */
+ // create_proc_entry deprecated in 3.10
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+ controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME,
+ VMBLOCK_CONTROL_MODE,
+ controlProcDirEntry,
+ &ControlFileOps);
+#else
controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
VMBLOCK_CONTROL_MODE,
controlProcDirEntry);
+#endif
if (!controlProcEntry) {
Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n");
remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry);
@@ -218,7 +226,9 @@ SetupProcDevice(void)
return -EINVAL;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) //Maybe 3.14? 3.13?
controlProcEntry->proc_fops = &ControlFileOps;
+#endif
return 0;
}
@@ -272,17 +282,50 @@ CleanupProcDevice(void)
*----------------------------------------------------------------------------
*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)
+/* copy-paste from Lustre FS by pavlinux */
+static inline char *ll_getname(const char __user *filename)
+{
+ int ret = 0, len;
+ char *tmp = __getname();
+
+ if (!tmp)
+ return ERR_PTR(-ENOMEM);
+
+ len = strncpy_from_user(tmp, filename, PATH_MAX);
+ if (len == 0)
+ ret = -ENOENT;
+ else if (len > PATH_MAX)
+ ret = -ENAMETOOLONG;
+
+ if (ret) {
+ __putname(tmp);
+ tmp = ERR_PTR(ret);
+ }
+ return tmp;
+};
+#endif
+
static int
ExecuteBlockOp(const char __user *buf, // IN: buffer with name
const os_blocker_id_t blocker, // IN: blocker ID (file)
int (*blockOp)(const char *filename, // IN: block operation
const os_blocker_id_t blocker))
{
- char *name;
+ struct filename *fn = NULL;
+ char *name = (char *)fn->name;
int i;
int retval;
- name = getname(buf);
+ // Not sure what changed in 3.13 to neccessitate this.
+ // Gentoo uses __getname(), though.
+ // https://github.com/gentoo/vmware/blob/master/app-emulation/vmware-modules/files/308-3.10-02-control.patch#L36
+ // ~MK
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
+ name = (char *)getname(buf);
+#else
+ name = (char *)ll_getname(buf);
+#endif
if (IS_ERR(name)) {
return PTR_ERR(name);
}
@@ -293,7 +336,13 @@ ExecuteBlockOp(const char __user *buf, // IN: buffer with name
retval = i < 0 ? -EINVAL : blockOp(name, blocker);
- putname(name);
+ // I'm not sure what this does, but you seem to know what you're doing ~MK
+ if (fn->name != fn->iname) { /* add by pavlinux */
+ __putname(fn->name);
+ kvfree(fn);
+ } else {
+ __putname(fn);
+ }
return retval;
}
diff --git a/vmblock-only/linux/dentry.c b/vmblock-only/linux/dentry.c
index 05ea95a..1245358 100644
--- a/vmblock-only/linux/dentry.c
+++ b/vmblock-only/linux/dentry.c
@@ -32,7 +32,13 @@
#include "block.h"
-static int DentryOpRevalidate(struct dentry *dentry, struct nameidata *nd);
+// From what I can tell, this should've always been an unsigned int?
+static int DentryOpRevalidate(struct dentry *dentry,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) // Maybe 3.14 or 3.13?
+ struct nameidata *nd);
+#else
+ unsigned int flags);
+#endif
struct dentry_operations LinkDentryOps = {
.d_revalidate = DentryOpRevalidate,
@@ -60,7 +66,11 @@ struct dentry_operations LinkDentryOps = {
static int
DentryOpRevalidate(struct dentry *dentry, // IN: dentry revalidating
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
struct nameidata *nd) // IN: lookup flags & intent
+#else
+ unsigned int flags) // IN: lookup flags & intent
+#endif
{
VMBlockInodeInfo *iinfo;
struct nameidata actualNd;
@@ -101,7 +111,11 @@ DentryOpRevalidate(struct dentry *dentry, // IN: dentry revalidating
if (actualDentry &&
actualDentry->d_op &&
actualDentry->d_op->d_revalidate) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+ return actualDentry->d_op->d_revalidate(actualDentry, flags);
+#else
return actualDentry->d_op->d_revalidate(actualDentry, nd);
+#endif
}
if (compat_path_lookup(iinfo->name, 0, &actualNd)) {
diff --git a/vmblock-only/linux/file.c b/vmblock-only/linux/file.c
index d7ac1f6..c5e6604 100644
--- a/vmblock-only/linux/file.c
+++ b/vmblock-only/linux/file.c
@@ -39,6 +39,7 @@ typedef ino_t inode_num_t;
#endif
/* Specifically for our filldir_t callback */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
typedef struct FilldirInfo {
filldir_t filldir;
void *dirent;
@@ -76,6 +77,7 @@ Filldir(void *buf, // IN: Dirent buffer passed from FileOpReaddir
/* Specify DT_LNK regardless */
return info->filldir(info->dirent, name, namelen, offset, ino, DT_LNK);
}
+#endif
/* File operations */
@@ -132,7 +134,12 @@ FileOpOpen(struct inode *inode, // IN
* and that would try to acquire the inode's semaphore; if the two inodes
* are the same we'll deadlock.
*/
+ // f_dentry is defined as f_path.dentry until 3.19
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
if (actualFile->f_dentry && inode == actualFile->f_dentry->d_inode) {
+#else
+ if (actualFile->f_path.dentry && inode == actualFile->f_path.dentry->d_inode) {
+#endif
Warning("FileOpOpen: identical inode encountered, open cannot succeed.\n");
if (filp_close(actualFile, current->files) < 0) {
Warning("FileOpOpen: unable to close opened file.\n");
@@ -164,13 +171,20 @@ FileOpOpen(struct inode *inode, // IN
*----------------------------------------------------------------------------
*/
+// pavlinux's patch completely removes this bit for kernels older than 3.13
static int
FileOpReaddir(struct file *file, // IN
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
void *dirent, // IN
filldir_t filldir) // IN
+#else
+ struct dir_context* ctx) //IN
+#endif
{
int ret;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
FilldirInfo info;
+#endif
struct file *actualFile;
if (!file) {
@@ -184,12 +198,20 @@ FileOpReaddir(struct file *file, // IN
return -EINVAL;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
info.filldir = filldir;
info.dirent = dirent;
actualFile->f_pos = file->f_pos;
ret = vfs_readdir(actualFile, Filldir, &info);
file->f_pos = actualFile->f_pos;
+#else
+ /* Ricky Wong Yung Fei:
+ * Manipulation of pos is now handled internally by iterate_dir().
+ */
+ ret = iterate_dir(actualFile, ctx);
+ file->f_pos = actualFile->f_pos;
+#endif
return ret;
}
@@ -236,8 +258,15 @@ FileOpRelease(struct inode *inode, // IN
}
+// pavlinux's patch drops FileOpReaddr for < 3.13
+// pavlinux's patch sets .owner = THIS_MODULE and .llseek = no_llseek
struct file_operations RootFileOps = {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
.readdir = FileOpReaddir,
+#else
+ .iterate = FileOpReaddir,
+#endif
+ .owner = THIS_MODULE,
.open = FileOpOpen,
.release = FileOpRelease,
};
diff --git a/vmblock-only/linux/inode.c b/vmblock-only/linux/inode.c
index 098c94c..7aed6e7 100644
--- a/vmblock-only/linux/inode.c
+++ b/vmblock-only/linux/inode.c
@@ -28,20 +28,32 @@
#include <linux/fs.h>
#include <linux/time.h>
#include <linux/namei.h>
+#include <linux/cred.h>
#include "vmblockInt.h"
#include "filesystem.h"
#include "block.h"
/* Inode operations */
+// Again, it looks like last arg should've always been unsigned int ~MK
static struct dentry *InodeOpLookup(struct inode *dir,
- struct dentry *dentry, struct nameidata *nd);
-static int InodeOpReadlink(struct dentry *dentry, char __user *buffer, int buflen);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
-static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
+ struct dentry *dentry,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) // Maybe 3.12 or 3.13?
+ struct nameidata *nd);
#else
+ unsigned int flags);
+#endif
+static int InodeOpReadlink(struct dentry *dentry, char __user *buffer, int buflen);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 13)
static int InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 99)
+static const char *InodeOpGetLink(struct dentry *dentry, struct inode *inode,
+ struct delayed_call *done);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 99)
+static const char *InodeOpFollowlink(struct dentry *dentry, void **cookie);
+#else
+static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
#endif
@@ -49,9 +60,13 @@ struct inode_operations RootInodeOps = {
.lookup = InodeOpLookup,
};
-static struct inode_operations LinkInodeOps = {
+struct inode_operations LinkInodeOps = {
.readlink = InodeOpReadlink,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 99)
+ .get_link = InodeOpGetLink,
+#else
.follow_link = InodeOpFollowlink,
+#endif
};
@@ -75,7 +90,11 @@ static struct inode_operations LinkInodeOps = {
static struct dentry *
InodeOpLookup(struct inode *dir, // IN: parent directory's inode
struct dentry *dentry, // IN: dentry to lookup
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
struct nameidata *nd) // IN: lookup intent and information
+#else
+ unsigned int flags) // IN: lookup intent and information
+#endif
{
char *filename;
struct inode *inode;
@@ -135,7 +154,16 @@ InodeOpLookup(struct inode *dir, // IN: parent directory's inode
inode->i_size = INODE_TO_IINFO(inode)->nameLen;
inode->i_version = 1;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+#else
+ inode->i_atime = inode->i_mtime = inode->i_ctime = current_kernel_time();
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
inode->i_uid = inode->i_gid = 0;
+#else
+ inode->i_gid = make_kgid(current_user_ns(), 0);
+ inode->i_uid = make_kuid(current_user_ns(), 0);
+#endif
inode->i_op = &LinkInodeOps;
d_add(dentry, inode);
@@ -176,8 +200,15 @@ InodeOpReadlink(struct dentry *dentry, // IN : dentry of symlink
if (!iinfo) {
return -EINVAL;
}
-
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 99)
return vfs_readlink(dentry, buffer, buflen, iinfo->name);
+#elif LINUX_VERSION_CODE <= KERNEL_VERSION(4, 6, 99)
+ return readlink_copy(buffer, buflen, iinfo->name);
+#elif LINUX_VERSION_CODE <= KERNEL_VERSION(4, 9, 99)
+ return generic_readlink(dentry, buffer, buflen);
+#else
+ return vfs_readlink(dentry, buffer, buflen);
+#endif
}
@@ -198,30 +229,58 @@ InodeOpReadlink(struct dentry *dentry, // IN : dentry of symlink
*----------------------------------------------------------------------------
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
-static void *
+static
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 13)
+int
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 99)
+const char *
#else
-static int
+void *
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 99)
+InodeOpGetLink(struct dentry *dentry, struct inode *inode,
+ struct delayed_call *done)
+#else
InodeOpFollowlink(struct dentry *dentry, // IN : dentry of symlink
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 99)
+ void **cookie)
+#else
struct nameidata *nd) // OUT: stores result
+#endif
+#endif
{
int ret;
VMBlockInodeInfo *iinfo;
if (!dentry) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 99)
+ ret = -ECHILD;
+#else
Warning("InodeOpReadlink: invalid args from kernel\n");
ret = -EINVAL;
+#endif
goto out;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 99)
+ iinfo = INODE_TO_IINFO(inode);
+#else
iinfo = INODE_TO_IINFO(dentry->d_inode);
+#endif
if (!iinfo) {
ret = -EINVAL;
goto out;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)
ret = vfs_follow_link(nd, iinfo->name);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 99)
+ return (char *)(iinfo->name);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 99)
+ return *cookie = (char *)(iinfo->name);
+#else
+ nd_set_link(nd, iinfo->name);
+#endif
out:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
diff --git a/vmblock-only/shared/compat_namei.h b/vmblock-only/shared/compat_namei.h
index f82dd49..426d40b 100644
--- a/vmblock-only/shared/compat_namei.h
+++ b/vmblock-only/shared/compat_namei.h
@@ -45,4 +45,20 @@
#define compat_path_lookup(name, flags, nd) path_lookup(name, flags, nd)
#endif
+/* nameidata struct for 4.2+ */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
+struct nameidata {
+ struct path path;
+ struct qstr last;
+ struct path root;
+ struct inode *inode; /* path.dentry.d_inode */
+ unsigned int flags;
+ unsigned seq, m_seq;
+ int last_type;
+ unsigned depth;
+ struct file *base;
+ char *saved_names[MAX_NESTED_LINKS + 1];
+};
+#endif
+
#endif /* __COMPAT_NAMEI_H__ */

View File

@@ -1,294 +0,0 @@
diff --git a/vmci-only/Makefile b/vmci-only/Makefile
index c630705..18357e5 100644
--- a/vmci-only/Makefile
+++ b/vmci-only/Makefile
@@ -43,7 +43,11 @@ INCLUDE += -I$(SRCROOT)/shared
endif
+ifdef KVERSION
+VM_UNAME = $(KVERSION)
+else
VM_UNAME = $(shell uname -r)
+endif
# Header directory for the running kernel
ifdef LINUXINCLUDE
diff --git a/vmci-only/Makefile.kernel b/vmci-only/Makefile.kernel
index 8e6e7d0..28eb503 100644
--- a/vmci-only/Makefile.kernel
+++ b/vmci-only/Makefile.kernel
@@ -21,7 +21,7 @@ CC_OPTS += -DVMCI
INCLUDE += -I$(SRCROOT)/shared -I$(SRCROOT)/common -I$(SRCROOT)/linux
-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
+EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
obj-m += $(DRIVER).o
diff --git a/vmci-only/linux/driver.c b/vmci-only/linux/driver.c
index f676166..9e42f3f 100644
--- a/vmci-only/linux/driver.c
+++ b/vmci-only/linux/driver.c
@@ -26,6 +26,7 @@
#include <linux/file.h>
#include <linux/fs.h>
+#include <linux/vmalloc.h>
#include <linux/init.h>
#if defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
# include <linux/ioctl32.h>
@@ -1466,12 +1467,19 @@ VMCIUserVALockPage(VA addr) // IN:
int retval;
down_read(&current->mm->mmap_sem);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
- retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
+ retval = get_user_pages(addr,
#else
retval = get_user_pages(current, current->mm, addr,
- 1, 1, 0, &page, NULL);
#endif
+ 1,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
+ 1, 0,
+#else
+ FOLL_WRITE,
+#endif
+ &page, NULL);
+
up_read(&current->mm->mmap_sem);
if (retval != 1) {
@@ -1686,7 +1694,11 @@ vmci_guest_init(void)
/* This should be last to make sure we are done initializing. */
retval = pci_register_driver(&vmci_driver);
if (retval < 0) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
vfree(data_buffer);
+#else
+ kvfree(data_buffer);
+#endif
data_buffer = NULL;
return retval;
}
@@ -1722,12 +1734,25 @@
vmci_dev.msix_entries[i].vector = i;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
result = pci_enable_msix(pdev, vmci_dev.msix_entries, VMCI_MAX_INTRS);
if (!result) {
vmci_dev.exclusive_vectors = TRUE;
} else if (result > 0) {
result = pci_enable_msix(pdev, vmci_dev.msix_entries, 1);
}
+#else
+ result = pci_enable_msix_range(pdev, vmci_dev.msix_entries, VMCI_MAX_INTRS,
+ VMCI_MAX_INTRS);
+ if (result > 0) {
+ vmci_dev.exclusive_vectors = TRUE;
+ } else if (result == -ENOSPC) {
+ result = pci_enable_msix_range(pdev, vmci_dev.msix_entries, 1, 1);
+ }
+
+ if (result > 0)
+ result = 0;
+#endif
return result;
}
@@ -2480,7 +2505,11 @@ vmci_exit(void)
if (guestDeviceInit) {
pci_unregister_driver(&vmci_driver);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
vfree(data_buffer);
+#else
+ kvfree(data_buffer);
+#endif
data_buffer = NULL;
guestDeviceInit = FALSE;
}
@@ -2490,7 +2519,7 @@ vmci_exit(void)
VMCI_HostCleanup();
- retval = misc_deregister(&linuxState.misc);
+ retval = compat_misc_deregister(&linuxState.misc);
if (retval) {
Warning(LGPFX "Module %s: error unregistering\n", VMCI_MODULE_NAME);
} else {
diff --git a/vmci-only/linux/vmciKernelIf.c b/vmci-only/linux/vmciKernelIf.c
index 3fba8b6..1836442 100644
--- a/vmci-only/linux/vmciKernelIf.c
+++ b/vmci-only/linux/vmciKernelIf.c
@@ -40,6 +40,10 @@
#include <linux/socket.h> /* For memcpy_{to,from}iovec(). */
#include <linux/vmalloc.h>
#include <linux/wait.h>
+#include <linux/skbuff.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 99)
+#include <linux/sched/signal.h>
+#endif
#include "compat_highmem.h"
#include "compat_interrupt.h"
@@ -1198,16 +1199,29 @@ __VMCIMemcpyToQueue(VMCIQueue *queue, // OUT:
}
if (isIovec) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
struct iovec *iov = (struct iovec *)src;
+#else
+ struct msghdr *msg = (struct msghdr *)src;
+#endif
int err;
/* The iovec will track bytesCopied internally. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
err = memcpy_fromiovec((uint8 *)va + pageOffset, iov, toCopy);
+#else
+ err = memcpy_from_msg((uint8 *)va + pageOffset, msg, toCopy);
+#endif
if (err != 0) {
if (kernelIf->host) {
kunmap(kernelIf->u.h.page[pageIndex]);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
}
return VMCI_ERROR_INVALID_ARGS;
+#else
+ return VMCI_ERROR_INVALID_ARGS;
+ }
+#endif
}
} else {
memcpy((uint8 *)va + pageOffset, (uint8 *)src + bytesCopied, toCopy);
@@ -1273,11 +1287,19 @@ __VMCIMemcpyFromQueue(void *dest, // OUT:
}
if (isIovec) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
struct iovec *iov = (struct iovec *)dest;
+#else
+ struct msghdr *msg = (struct msghdr *)dest;
+#endif
int err;
/* The iovec will track bytesCopied internally. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
err = memcpy_toiovec(iov, (uint8 *)va + pageOffset, toCopy);
+#else
+ err = memcpy_to_msg(msg, (uint8 *)va + pageOffset, toCopy);
+#endif
if (err != 0) {
if (kernelIf->host) {
kunmap(kernelIf->u.h.page[pageIndex]);
@@ -1834,7 +1856,11 @@ VMCIReleasePages(struct page **pages, // IN
if (dirty) {
set_page_dirty(pages[i]);
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
+ put_page(pages[i]);
+#else
page_cache_release(pages[i]);
+#endif
pages[i] = NULL;
}
}
@@ -2048,21 +2074,22 @@ VMCIHost_GetUserMemory(VA64 produceUVA, // IN
int err = VMCI_SUCCESS;
down_write(&current->mm->mmap_sem);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
retval = get_user_pages((VA)produceUVA,
- produceQ->kernelIf->numPages,
- 1, 0,
- produceQ->kernelIf->u.h.headerPage,
- NULL);
#else
retval = get_user_pages(current,
current->mm,
(VA)produceUVA,
+#endif
produceQ->kernelIf->numPages,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
1, 0,
+#else
+ FOLL_WRITE,
+#endif
produceQ->kernelIf->u.h.headerPage,
NULL);
-#endif
+
if (retval < produceQ->kernelIf->numPages) {
Log("get_user_pages(produce) failed (retval=%d)\n", retval);
VMCIReleasePages(produceQ->kernelIf->u.h.headerPage, retval, FALSE);
@@ -2070,11 +2097,19 @@ VMCIHost_GetUserMemory(VA64 produceUVA, // IN
goto out;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
+ retval = get_user_pages((VA)consumeUVA,
+#else
retval = get_user_pages(current,
current->mm,
(VA)consumeUVA,
+#endif
consumeQ->kernelIf->numPages,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
1, 0,
+#else
+ FOLL_WRITE,
+#endif
consumeQ->kernelIf->u.h.headerPage,
NULL);
if (retval < consumeQ->kernelIf->numPages) {
diff --git a/vmci-only/shared/compat_module.h b/vmci-only/shared/compat_module.h
index 2af7372..729aedc 100644
--- a/vmci-only/shared/compat_module.h
+++ b/vmci-only/shared/compat_module.h
@@ -80,4 +80,13 @@ static const char __module_cat(tag, __LINE__)[] \
typedef int compat_mod_param_bool;
#endif
+/*
+ * Linux kernel >= 4.2.99 does not return anything from misc_deregister
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 99)
+#define compat_misc_deregister(misc) misc_deregister(misc)
+#else
+#define compat_misc_deregister(misc) ({misc_deregister(misc);0;})
+#endif
+
#endif /* __COMPAT_MODULE_H__ */
diff --git a/vmci-only/shared/vm_device_version.h b/vmci-only/shared/vm_device_version.h
index e2cb477..3dd7097 100644
--- a/vmci-only/shared/vm_device_version.h
+++ b/vmci-only/shared/vm_device_version.h
@@ -53,7 +53,9 @@
* VMware HD Audio codec
* VMware HD Audio controller
*/
+#ifndef PCI_VENDOR_ID_VMWARE
#define PCI_VENDOR_ID_VMWARE 0x15AD
+#endif
#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405
#define PCI_DEVICE_ID_VMWARE_SVGA 0x0710
#define PCI_DEVICE_ID_VMWARE_VGA 0x0711
diff --git a/vmci-only/shared/vmci_kernel_if.h b/vmci-only/shared/vmci_kernel_if.h
index 9def671..082fe59 100644
--- a/vmci-only/shared/vmci_kernel_if.h
+++ b/vmci-only/shared/vmci_kernel_if.h
@@ -100,7 +100,7 @@
typedef Semaphore VMCIEvent;
typedef Semaphore VMCIMutex;
typedef World_ID VMCIHostVmID;
- typedef uint32 VMCIHostUser;
+ typedef uint32_t VMCIHostUser;
typedef PPN *VMCIQPGuestMem;
#elif defined(__linux__)
typedef spinlock_t VMCILock;

View File

@@ -1,266 +0,0 @@
diff --git a/vsock-only/Makefile b/vsock-only/Makefile
index 5d92e9b..7d315e8 100644
--- a/vsock-only/Makefile
+++ b/vsock-only/Makefile
@@ -42,8 +42,11 @@ AUTOCONF_DIR := $(SRCROOT)/shared/autoconf
INCLUDE += -I$(SRCROOT)/shared
endif
-
+ifdef KVERSION
+VM_UNAME = $(KVERSION)
+else
VM_UNAME = $(shell uname -r)
+endif
# Header directory for the running kernel
ifdef LINUXINCLUDE
diff --git a/vsock-only/Makefile.kernel b/vsock-only/Makefile.kernel
index 5218df2..374cc1f 100644
--- a/vsock-only/Makefile.kernel
+++ b/vsock-only/Makefile.kernel
@@ -25,7 +25,7 @@ INCLUDE += -I$(SRCROOT)/include
INCLUDE += -I$(SRCROOT)/linux
INCLUDE += -I$(SRCROOT)/common
-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
+EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/netcreate_num_params.c, -DVMW_NETCREATE_KERNARG, )
diff --git a/vsock-only/linux/af_vsock.c b/vsock-only/linux/af_vsock.c
index bde1497..9f8f843 100644
--- a/vsock-only/linux/af_vsock.c
+++ b/vsock-only/linux/af_vsock.c
@@ -113,6 +113,9 @@
asmlinkage __attribute__((weak)) long
sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 99)
+#include <linux/sched/signal.h>
+#endif
#include "compat_cred.h"
#include "compat_module.h"
@@ -213,7 +216,11 @@
struct sockaddr *addr, int addrLen, int flags);
static int VSockVmciStreamConnect(struct socket *sock,
struct sockaddr *addr, int addrLen, int flags);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
static int VSockVmciAccept(struct socket *sock, struct socket *newsock, int flags);
+#else
+static int VSockVmciAccept(struct socket *sock, struct socket *newsock, int flags, bool kern);
+#endif
static int VSockVmciGetname(struct socket *sock,
struct sockaddr *addr, int *addrLen, int peer);
static unsigned int VSockVmciPoll(struct file *file,
@@ -233,13 +240,29 @@ static int VSockVmciStreamSetsockopt(struct socket *sock, int level, int optname
static int VSockVmciStreamGetsockopt(struct socket *sock, int level, int optname,
char __user *optval, int __user * optlen);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 99)
static int VSockVmciDgramSendmsg(struct kiocb *kiocb,
+#else
+static int VSockVmciDgramSendmsg(
+#endif
struct socket *sock, struct msghdr *msg, size_t len);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 99)
static int VSockVmciDgramRecvmsg(struct kiocb *kiocb, struct socket *sock,
+#else
+static int VSockVmciDgramRecvmsg(struct socket *sock,
+#endif
struct msghdr *msg, size_t len, int flags);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 99)
static int VSockVmciStreamSendmsg(struct kiocb *kiocb,
+#else
+static int VSockVmciStreamSendmsg(
+#endif
struct socket *sock, struct msghdr *msg, size_t len);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 99)
static int VSockVmciStreamRecvmsg(struct kiocb *kiocb, struct socket *sock,
+#else
+static int VSockVmciStreamRecvmsg(struct socket *sock,
+#endif
struct msghdr *msg, size_t len, int flags);
static int VSockVmciCreate(
@@ -2872,11 +2895,18 @@ __VSockVmciCreate(struct net *net, // IN: Network namespace
* From 2.6.9 to until 2.6.12 sk_alloc() used a cache in
* the protocol structure, but you still had to specify the size and cache
* yourself.
- * Most recently (in 2.6.24), sk_alloc() was changed to expect the
+ * In 2.6.24, sk_alloc() was changed to expect the
* network namespace, and the option to zero the sock was dropped.
*
+ * In 4.2, another parameter was added to sk_alloc() allowing you to specify
+ * whether or not the socket is to be a kernel socket. Previously, we passed
+ * 1 to this new parameter, but following Gentoo's lead
+ * ( https://github.com/gentoo/vmware/blob/master/app-emulation/vmware-modules/files/308-4.02-01-sk_alloc.patch#L19 )
+ * we have switched to passing 0.
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 99)
+ sk = sk_alloc(net, vsockVmciFamilyOps.family, priority, &vsockVmciProto, 0);
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
sk = sk_alloc(vsockVmciFamilyOps.family, priority,
vsockVmciProto.slab_obj_size, vsockVmciProto.slab);
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
@@ -3825,7 +3855,12 @@
static int
VSockVmciAccept(struct socket *sock, // IN
struct socket *newsock, // IN/OUT
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
int flags) // IN
+#else
+ int flags, // IN
+ bool kern)
+#endif
{
struct sock *listener;
int err;
@@ -4260,7 +4295,11 @@ VSockVmciShutdown(struct socket *sock, // IN
*/
static int
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 99)
VSockVmciDgramSendmsg(struct kiocb *kiocb, // UNUSED
+#else
+VSockVmciDgramSendmsg(
+#endif
struct socket *sock, // IN: socket to send on
struct msghdr *msg, // IN: message to send
size_t len) // IN: length of message
@@ -4352,7 +4391,11 @@ VSockVmciDgramSendmsg(struct kiocb *kiocb, // UNUSED
goto out;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
memcpy_fromiovec(VMCI_DG_PAYLOAD(dg), msg->msg_iov, len);
+#else
+ memcpy_from_msg(VMCI_DG_PAYLOAD(dg), msg, len);
+#endif
dg->dst = VMCI_MAKE_HANDLE(remoteAddr->svm_cid, remoteAddr->svm_port);
dg->src = VMCI_MAKE_HANDLE(vsk->localAddr.svm_cid, vsk->localAddr.svm_port);
@@ -4590,7 +4633,11 @@ VSockVmciStreamGetsockopt(struct socket *sock, // IN
*/
static int
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 99)
VSockVmciStreamSendmsg(struct kiocb *kiocb, // UNUSED
+#else
+VSockVmciStreamSendmsg(
+#endif
struct socket *sock, // IN: socket to send on
struct msghdr *msg, // IN: message to send
size_t len) // IN: length of message
@@ -4712,7 +4759,11 @@ VSockVmciStreamSendmsg(struct kiocb *kiocb, // UNUSED
* able to send.
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
written = vmci_qpair_enquev(vsk->qpair, msg->msg_iov,
+#else
+ written = vmci_qpair_enquev(vsk->qpair, &msg->msg_iter.iov,
+#endif
len - totalWritten, 0);
if (written < 0) {
err = -ENOMEM;
@@ -4759,7 +4810,11 @@ out:
*/
static int
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 99)
VSockVmciDgramRecvmsg(struct kiocb *kiocb, // UNUSED
+#else
+VSockVmciDgramRecvmsg(
+#endif
struct socket *sock, // IN: socket to receive from
struct msghdr *msg, // IN/OUT: message to receive into
size_t len, // IN: length of receive buffer
@@ -4809,7 +4864,11 @@ VSockVmciDgramRecvmsg(struct kiocb *kiocb, // UNUSED
}
/* Place the datagram payload in the user's iovec. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
err = skb_copy_datagram_iovec(skb, sizeof *dg, msg->msg_iov, payloadLen);
+#else
+ err = skb_copy_datagram_iter(skb, sizeof *dg, &msg->msg_iter, payloadLen);
+#endif
if (err) {
goto out;
}
@@ -4850,7 +4909,11 @@ out:
*/
static int
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 99)
VSockVmciStreamRecvmsg(struct kiocb *kiocb, // UNUSED
+#else
+VSockVmciStreamRecvmsg(
+#endif
struct socket *sock, // IN: socket to receive from
struct msghdr *msg, // IN/OUT: message to receive into
size_t len, // IN: length of receive buffer
@@ -4955,9 +5018,17 @@ VSockVmciStreamRecvmsg(struct kiocb *kiocb, // UNUSED
}
if (flags & MSG_PEEK) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
read = vmci_qpair_peekv(vsk->qpair, msg->msg_iov, len - copied, 0);
+#else
+ read = vmci_qpair_peekv(vsk->qpair, &msg->msg_iter.iov, len - copied, 0);
+#endif
} else {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
read = vmci_qpair_dequev(vsk->qpair, msg->msg_iov, len - copied, 0);
+#else
+ read = vmci_qpair_dequev(vsk->qpair, &msg->msg_iter.iov, len - copied, 0);
+#endif
}
if (read < 0) {
diff --git a/vsock-only/linux/notify.c b/vsock-only/linux/notify.c
index 5b1e134..82d8738 100644
--- a/vsock-only/linux/notify.c
+++ b/vsock-only/linux/notify.c
@@ -516,7 +516,11 @@ VSockVmciHandleWrote(struct sock *sk, // IN
PKT_FIELD(vsk, sentWaitingRead) = FALSE;
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
sk->sk_data_ready(sk, 0);
+#else
+ sk->sk_data_ready(sk);
+#endif
}
diff --git a/vsock-only/linux/notifyQState.c b/vsock-only/linux/notifyQState.c
index 464454b..7933be7 100644
--- a/vsock-only/linux/notifyQState.c
+++ b/vsock-only/linux/notifyQState.c
@@ -164,7 +164,11 @@ VSockVmciHandleWrote(struct sock *sk, // IN
struct sockaddr_vm *dst, // IN: unused
struct sockaddr_vm *src) // IN: unused
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
sk->sk_data_ready(sk, 0);
+#else
+ sk->sk_data_ready(sk);
+#endif
}
@@ -566,7 +570,11 @@ VSockVmciNotifyPktRecvPostDequeue(struct sock *sk, // IN
}
/* See the comment in VSockVmciNotifyPktSendPostEnqueue */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
sk->sk_data_ready(sk, 0);
+#else
+ sk->sk_data_ready(sk);
+#endif
}
return err;