Advertisement
Guest User

Vmware Workstation 10.0.1 patch for Linux 3.14.0

a guest
Apr 9th, 2014
2,496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 15.61 KB | None | 0 0
  1. diff -ru a/vmblock-only/linux/control.c b/vmblock-only/linux/control.c
  2. --- a/vmblock-only/linux/control.c  2013-08-27 21:53:57.000000000 +0400
  3. +++ b/vmblock-only/linux/control.c  2013-10-28 03:25:37.000000000 +0400
  4. @@ -208,9 +208,11 @@
  5.     VMBlockSetProcEntryOwner(controlProcMountpoint);
  6.  
  7.     /* Create /proc/fs/vmblock/dev */
  8. -   controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
  9. -                                        VMBLOCK_CONTROL_MODE,
  10. -                                        controlProcDirEntry);
  11. +   controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME,
  12. +                 VMBLOCK_CONTROL_MODE,
  13. +                                  controlProcDirEntry,
  14. +                 &ControlFileOps);
  15. +
  16.     if (!controlProcEntry) {
  17.        Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n");
  18.        remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry);
  19. @@ -218,7 +220,6 @@
  20.        return -EINVAL;
  21.     }
  22.  
  23. -   controlProcEntry->proc_fops = &ControlFileOps;
  24.     return 0;
  25.  }
  26.  
  27. @@ -282,7 +283,7 @@
  28.     int i;
  29.     int retval;
  30.  
  31. -   name = getname(buf);
  32. +   name = (char *)getname(buf)->name;
  33.     if (IS_ERR(name)) {
  34.        return PTR_ERR(name);
  35.     }
  36. diff -ru a/vmblock-only/linux/dentry.c b/vmblock-only/linux/dentry.c
  37. --- a/vmblock-only/linux/dentry.c   2013-08-27 21:53:57.000000000 +0400
  38. +++ b/vmblock-only/linux/dentry.c   2013-10-28 03:27:48.000000000 +0400
  39. @@ -32,7 +32,7 @@
  40.  #include "block.h"
  41.  
  42.  
  43. -static int DentryOpRevalidate(struct dentry *dentry, struct nameidata *nd);
  44. +static int DentryOpRevalidate(struct dentry *dentry, unsigned int);
  45.  
  46.  struct dentry_operations LinkDentryOps = {
  47.     .d_revalidate = DentryOpRevalidate,
  48. @@ -60,7 +60,7 @@
  49.  
  50.  static int
  51.  DentryOpRevalidate(struct dentry *dentry,  // IN: dentry revalidating
  52. -                   struct nameidata *nd)   // IN: lookup flags & intent
  53. +                   unsigned int flags)   // IN: lookup flags & intent
  54.  {
  55.     VMBlockInodeInfo *iinfo;
  56.     struct nameidata actualNd;
  57. @@ -101,7 +101,7 @@
  58.     if (actualDentry &&
  59.         actualDentry->d_op &&
  60.         actualDentry->d_op->d_revalidate) {
  61. -      return actualDentry->d_op->d_revalidate(actualDentry, nd);
  62. +      return actualDentry->d_op->d_revalidate(actualDentry, flags);
  63.     }
  64.  
  65.     if (compat_path_lookup(iinfo->name, 0, &actualNd)) {
  66. diff -ru a/vmblock-only/linux/file.c b/vmblock-only/linux/file.c
  67. --- a/vmblock-only/linux/file.c 2013-08-27 21:53:57.000000000 +0400
  68. +++ b/vmblock-only/linux/file.c 2013-10-28 02:35:14.000000000 +0400
  69. @@ -237,7 +237,9 @@
  70.  
  71.  
  72.  struct file_operations RootFileOps = {
  73. -   .readdir = FileOpReaddir,
  74. +/*   .readdir = FileOpReaddir, */
  75. +   .owner = THIS_MODULE,
  76. +   .llseek = no_llseek,
  77.     .open    = FileOpOpen,
  78.     .release = FileOpRelease,
  79.  };
  80. diff -ru a/vmblock-only/linux/inode.c b/vmblock-only/linux/inode.c
  81. --- a/vmblock-only/linux/inode.c    2013-08-27 21:53:57.000000000 +0400
  82. +++ b/vmblock-only/linux/inode.c    2013-10-28 03:28:57.000000000 +0400
  83. @@ -35,13 +35,13 @@
  84.  
  85.  
  86.  /* Inode operations */
  87. -static struct dentry *InodeOpLookup(struct inode *dir,
  88. -                                    struct dentry *dentry, struct nameidata *nd);
  89. -static int InodeOpReadlink(struct dentry *dentry, char __user *buffer, int buflen);
  90. +static struct dentry *InodeOpLookup(struct inode *, struct dentry *, unsigned int);
  91. +static int InodeOpReadlink(struct dentry *, char __user *, int);
  92. +
  93.  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
  94. -static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
  95. +   static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
  96.  #else
  97. -static int InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
  98. +   static int InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
  99.  #endif
  100.  
  101.  
  102. @@ -49,7 +49,7 @@
  103.     .lookup = InodeOpLookup,
  104.  };
  105.  
  106. -static struct inode_operations LinkInodeOps = {
  107. +struct inode_operations LinkInodeOps = {
  108.     .readlink    = InodeOpReadlink,
  109.     .follow_link = InodeOpFollowlink,
  110.  };
  111. @@ -75,7 +75,7 @@
  112.  static struct dentry *
  113.  InodeOpLookup(struct inode *dir,      // IN: parent directory's inode
  114.                struct dentry *dentry,  // IN: dentry to lookup
  115. -              struct nameidata *nd)   // IN: lookup intent and information
  116. +              unsigned int flags)   // IN: lookup intent and information
  117.  {
  118.     char *filename;
  119.     struct inode *inode;
  120. @@ -135,7 +135,8 @@
  121.     inode->i_size = INODE_TO_IINFO(inode)->nameLen;
  122.     inode->i_version = 1;
  123.     inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
  124. -   inode->i_uid = inode->i_gid = 0;
  125. +   inode->i_gid = make_kgid(current_user_ns(), 0);
  126. +   inode->i_uid = make_kuid(current_user_ns(), 0);
  127.     inode->i_op = &LinkInodeOps;
  128.  
  129.     d_add(dentry, inode);
  130. @@ -221,7 +222,7 @@
  131.        goto out;
  132.     }
  133.  
  134. -   ret = vfs_follow_link(nd, iinfo->name);
  135. +   nd_set_link(nd, iinfo->name);
  136.  
  137.  out:
  138.  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
  139. @@ -230,3 +231,4 @@
  140.     return ret;
  141.  #endif
  142.  }
  143. +
  144. Только в b/vmblock-only/shared/autoconf: file_operations_flush.c
  145. diff -ru a/vmblock-only/shared/compat_dcache.h b/vmblock-only/shared/compat_dcache.h
  146. --- a/vmblock-only/shared/compat_dcache.h   2013-08-27 21:53:57.000000000 +0400
  147. +++ b/vmblock-only/shared/compat_dcache.h   2013-10-18 21:56:11.000000000 +0400
  148. @@ -1,5 +1,5 @@
  149.  /*********************************************************
  150. - * Copyright (C) 2006 VMware, Inc. All rights reserved.
  151. + * Copyright (C) 2013 VMware, Inc. All rights reserved.
  152.   *
  153.   * This program is free software; you can redistribute it and/or modify it
  154.   * under the terms of the GNU General Public License as published by the
  155. @@ -25,7 +25,7 @@
  156.   * per-dentry locking was born in 2.5.62.
  157.   */
  158.  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 62)
  159. -#define compat_lock_dentry(dentry) spin_lock(&dentry->d_lock)
  160. +#define compat_lock_dentry(dentry) spin_lock(&dentry->d_lock)
  161.  #define compat_unlock_dentry(dentry) spin_unlock(&dentry->d_lock)
  162.  #else
  163.  #define compat_lock_dentry(dentry) do {} while (0)
  164. @@ -48,4 +48,15 @@
  165.  })
  166.  #endif
  167.  
  168. +/*
  169. + * d_count field was removed in 3.11.0.
  170. + */
  171. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
  172. +#define compat_d_count(dentry) d_count(dentry)
  173. +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
  174. +#define compat_d_count(dentry) dentry->d_count
  175. +#else
  176. +#define compat_d_count(dentry) atomic_read(&dentry->d_count);
  177. +#endif
  178. +
  179.  #endif /* __COMPAT_DCACHE_H__ */
  180. diff -ru a/vmblock-only/shared/vm_assert.h b/vmblock-only/shared/vm_assert.h
  181. --- a/vmblock-only/shared/vm_assert.h   2013-08-27 21:53:57.000000000 +0400
  182. +++ b/vmblock-only/shared/vm_assert.h   2014-03-24 13:59:49.000000000 +0400
  183. @@ -256,7 +256,8 @@
  184.                                         __FILE__, __LINE__, __FUNCTION__, \
  185.                                         _fix))
  186.  #else
  187. -   #define DEPRECATED(_fix) do {} while (0)
  188. +    #undef DEPRECATED /* in <linux/printk.h> since 3.14.0 */
  189. +    #define DEPRECATED(_fix) do {} while (0)
  190.  #endif
  191.  
  192.  
  193. diff -ru a/vmci-only/linux/driver.c b/vmci-only/linux/driver.c
  194. --- a/vmci-only/linux/driver.c  2013-08-27 21:53:57.000000000 +0400
  195. +++ b/vmci-only/linux/driver.c  2013-10-28 02:33:39.000000000 +0400
  196. @@ -737,7 +737,7 @@
  197.           goto init_release;
  198.        }
  199.  
  200. -      user = current_uid();
  201. +      user = from_kuid(&init_user_ns, current_uid());
  202.        retval = VMCIContext_InitContext(initBlock.cid, initBlock.flags,
  203.                                         0 /* Unused */, vmciLinux->userVersion,
  204.                                         &user, &vmciLinux->context);
  205. Только в b/vmci-only/shared/autoconf: file_operations_flush.c
  206. diff -ru a/vmci-only/shared/compat_dcache.h b/vmci-only/shared/compat_dcache.h
  207. --- a/vmci-only/shared/compat_dcache.h  2013-08-27 21:53:57.000000000 +0400
  208. +++ b/vmci-only/shared/compat_dcache.h  2013-10-18 21:56:11.000000000 +0400
  209. @@ -1,5 +1,5 @@
  210.  /*********************************************************
  211. - * Copyright (C) 2006 VMware, Inc. All rights reserved.
  212. + * Copyright (C) 2013 VMware, Inc. All rights reserved.
  213.   *
  214.   * This program is free software; you can redistribute it and/or modify it
  215.   * under the terms of the GNU General Public License as published by the
  216. @@ -25,7 +25,7 @@
  217.   * per-dentry locking was born in 2.5.62.
  218.   */
  219.  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 62)
  220. -#define compat_lock_dentry(dentry) spin_lock(&dentry->d_lock)
  221. +#define compat_lock_dentry(dentry) spin_lock(&dentry->d_lock)
  222.  #define compat_unlock_dentry(dentry) spin_unlock(&dentry->d_lock)
  223.  #else
  224.  #define compat_lock_dentry(dentry) do {} while (0)
  225. @@ -48,4 +48,15 @@
  226.  })
  227.  #endif
  228.  
  229. +/*
  230. + * d_count field was removed in 3.11.0.
  231. + */
  232. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
  233. +#define compat_d_count(dentry) d_count(dentry)
  234. +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
  235. +#define compat_d_count(dentry) dentry->d_count
  236. +#else
  237. +#define compat_d_count(dentry) atomic_read(&dentry->d_count);
  238. +#endif
  239. +
  240.  #endif /* __COMPAT_DCACHE_H__ */
  241. diff -ru a/vmci-only/shared/vm_assert.h b/vmci-only/shared/vm_assert.h
  242. --- a/vmci-only/shared/vm_assert.h  2013-08-27 21:53:57.000000000 +0400
  243. +++ b/vmci-only/shared/vm_assert.h  2014-03-24 13:59:14.000000000 +0400
  244. @@ -256,7 +256,8 @@
  245.                                         __FILE__, __LINE__, __FUNCTION__, \
  246.                                         _fix))
  247.  #else
  248. -   #define DEPRECATED(_fix) do {} while (0)
  249. +    #undef DEPRECATED /* in <linux/printk.h> since 3.14.0 */
  250. +    #define DEPRECATED(_fix) do {} while (0)
  251.  #endif
  252.  
  253.  
  254. diff -ru a/vmmon-only/include/vm_assert.h b/vmmon-only/include/vm_assert.h
  255. --- a/vmmon-only/include/vm_assert.h    2013-08-27 23:29:03.000000000 +0400
  256. +++ b/vmmon-only/include/vm_assert.h    2014-03-24 14:00:03.000000000 +0400
  257. @@ -256,7 +256,8 @@
  258.                                         __FILE__, __LINE__, __FUNCTION__, \
  259.                                         _fix))
  260.  #else
  261. -   #define DEPRECATED(_fix) do {} while (0)
  262. +    #undef DEPRECATED /* in <linux/printk.h> since 3.14.0 */
  263. +    #define DEPRECATED(_fix) do {} while (0)
  264.  #endif
  265.  
  266.  
  267. diff -ru a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c
  268. --- a/vmmon-only/linux/driver.c 2013-08-27 23:29:04.000000000 +0400
  269. +++ b/vmmon-only/linux/driver.c 2014-03-24 13:48:23.000000000 +0400
  270. @@ -1338,7 +1338,9 @@
  271.   *-----------------------------------------------------------------------------
  272.   */
  273.  
  274. -__attribute__((always_inline)) static Bool
  275. +#include <linux/compiler-gcc.h>
  276. +
  277. +__always_inline static Bool
  278.  LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
  279.  {
  280.     TSCDelta tscDelta;
  281. @@ -1348,7 +1350,7 @@
  282.     /* Take the global lock to block concurrent calls. */
  283.     HostIF_GlobalLock(14);
  284.  
  285. -   /* Loop to warm up the cache. */
  286. +   /* Loop to warm up the cache. */
  287.     for (i = 0; i < 3; i++) {
  288.        Atomic_Write64(&tscDelta.min, ~CONST64U(0));
  289.        Atomic_Write64(&tscDelta.max, CONST64U(0));
  290. diff -ru a/vmmon-only/linux/vmmonInt.h b/vmmon-only/linux/vmmonInt.h
  291. --- a/vmmon-only/linux/vmmonInt.h   2013-08-27 23:29:04.000000000 +0400
  292. +++ b/vmmon-only/linux/vmmonInt.h   2013-10-28 02:32:10.000000000 +0400
  293. @@ -31,7 +31,7 @@
  294.  #ifdef VMW_HAVE_SMP_CALL_3ARG
  295.  #define compat_smp_call_function(fn, info, wait) smp_call_function(fn, info, wait)
  296.  #else
  297. -#define compat_smp_call_function(fn, info, wait) smp_call_function(fn, info, 1, wait)
  298. +#define compat_smp_call_function(fn, info, wait) smp_call_function(fn, info, wait)
  299.  #endif
  300.  
  301.  /*
  302. diff -ru a/vmnet-only/filter.c b/vmnet-only/filter.c
  303. --- a/vmnet-only/filter.c   2013-08-27 23:29:04.000000000 +0400
  304. +++ b/vmnet-only/filter.c   2013-12-04 01:15:21.000000000 +0400
  305. @@ -27,6 +27,7 @@
  306.  #include "compat_module.h"
  307.  #include <linux/mutex.h>
  308.  #include <linux/netdevice.h>
  309. +#include <linux/version.h>
  310.  #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)
  311.  #   include <linux/module.h>
  312.  #else
  313. @@ -203,7 +204,11 @@
  314.  #endif
  315.  
  316.  static unsigned int
  317. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
  318.  VNetFilterHookFn(unsigned int hooknum,                 // IN:
  319. +#else
  320. +VNetFilterHookFn(const struct nf_hook_ops *ops,        // IN:
  321. +#endif
  322.  #ifdef VMW_NFHOOK_USES_SKB
  323.                   struct sk_buff *skb,                  // IN:
  324.  #else
  325. @@ -252,7 +257,12 @@
  326.  
  327.     /* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. */
  328.     /* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. */
  329. -   transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
  330. +
  331. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
  332. +    transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
  333. +#else
  334. +    transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING);
  335. +#endif
  336.  
  337.     packetHeader = compat_skb_network_header(skb);
  338.     ip = (struct iphdr*)packetHeader;
  339. diff -ru a/vmnet-only/vm_assert.h b/vmnet-only/vm_assert.h
  340. --- a/vmnet-only/vm_assert.h    2013-08-27 23:29:04.000000000 +0400
  341. +++ b/vmnet-only/vm_assert.h    2014-03-24 14:00:31.000000000 +0400
  342. @@ -256,7 +256,8 @@
  343.                                         __FILE__, __LINE__, __FUNCTION__, \
  344.                                         _fix))
  345.  #else
  346. -   #define DEPRECATED(_fix) do {} while (0)
  347. +    #undef DEPRECATED /* in <linux/printk.h> since 3.14.0 */
  348. +    #define DEPRECATED(_fix) do {} while (0)
  349.  #endif
  350.  
  351.  
  352. diff -ru a/vsock-only/linux/af_vsock.c b/vsock-only/linux/af_vsock.c
  353. --- a/vsock-only/linux/af_vsock.c   2013-08-27 21:53:57.000000000 +0400
  354. +++ b/vsock-only/linux/af_vsock.c   2013-10-28 02:29:33.000000000 +0400
  355. @@ -2869,7 +2869,7 @@
  356.        vsk->connectTimeout = psk->connectTimeout;
  357.     } else {
  358.        vsk->trusted = capable(CAP_NET_ADMIN);
  359. -      vsk->owner = current_uid();
  360. +      vsk->owner = from_kuid(&init_user_ns, current_uid()),
  361.        vsk->queuePairSize = VSOCK_DEFAULT_QP_SIZE;
  362.        vsk->queuePairMinSize = VSOCK_DEFAULT_QP_SIZE_MIN;
  363.        vsk->queuePairMaxSize = VSOCK_DEFAULT_QP_SIZE_MAX;
  364. Только в b/vsock-only/shared/autoconf: file_operations_flush.c
  365. diff -ru a/vsock-only/shared/compat_dcache.h b/vsock-only/shared/compat_dcache.h
  366. --- a/vsock-only/shared/compat_dcache.h 2013-08-27 21:53:57.000000000 +0400
  367. +++ b/vsock-only/shared/compat_dcache.h 2013-10-18 21:56:11.000000000 +0400
  368. @@ -1,5 +1,5 @@
  369.  /*********************************************************
  370. - * Copyright (C) 2006 VMware, Inc. All rights reserved.
  371. + * Copyright (C) 2013 VMware, Inc. All rights reserved.
  372.   *
  373.   * This program is free software; you can redistribute it and/or modify it
  374.   * under the terms of the GNU General Public License as published by the
  375. @@ -25,7 +25,7 @@
  376.   * per-dentry locking was born in 2.5.62.
  377.   */
  378.  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 62)
  379. -#define compat_lock_dentry(dentry) spin_lock(&dentry->d_lock)
  380. +#define compat_lock_dentry(dentry) spin_lock(&dentry->d_lock)
  381.  #define compat_unlock_dentry(dentry) spin_unlock(&dentry->d_lock)
  382.  #else
  383.  #define compat_lock_dentry(dentry) do {} while (0)
  384. @@ -48,4 +48,15 @@
  385.  })
  386.  #endif
  387.  
  388. +/*
  389. + * d_count field was removed in 3.11.0.
  390. + */
  391. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
  392. +#define compat_d_count(dentry) d_count(dentry)
  393. +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
  394. +#define compat_d_count(dentry) dentry->d_count
  395. +#else
  396. +#define compat_d_count(dentry) atomic_read(&dentry->d_count);
  397. +#endif
  398. +
  399.  #endif /* __COMPAT_DCACHE_H__ */
  400. diff -ru a/vsock-only/shared/vm_assert.h b/vsock-only/shared/vm_assert.h
  401. --- a/vsock-only/shared/vm_assert.h 2013-08-27 21:53:57.000000000 +0400
  402. +++ b/vsock-only/shared/vm_assert.h 2014-03-24 14:00:58.000000000 +0400
  403. @@ -256,7 +256,8 @@
  404.                                         __FILE__, __LINE__, __FUNCTION__, \
  405.                                         _fix))
  406.  #else
  407. -   #define DEPRECATED(_fix) do {} while (0)
  408. +    #undef DEPRECATED /* in <linux/printk.h> since 3.14.0 */
  409. +    #define DEPRECATED(_fix) do {} while (0)
  410.  #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement