Browse code

linux-esx: Added AMD PCnet32 device driver

Fixed vmw_balloon driver
Minor fixes in pv_ops patchset

Change-Id: I6a63d62466fc5c6ad7bd6945c7132d3f39eca16b
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1499
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Sharath George

Alexey Makhalov authored on 2016/10/07 15:14:34
Showing 6 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 From 6021a95a6b7ffb8df8823337d4ca05807c2eb6e5 Mon Sep 17 00:00:00 2001
2 2
 From: Alexey Makhalov <amakhalov@vmware.com>
3 3
 Date: Wed, 30 Sep 2015 23:00:00 +0000
4
-Subject: [PATCH 01/13] Measure correct boot time.
4
+Subject: [PATCH 01/14] Measure correct boot time.
5 5
 
6 6
 ---
7 7
  arch/x86/Kconfig          |  8 ++++++++
... ...
@@ -98,7 +98,7 @@ index 9e64d70..ccc9a22 100644
98 98
 From 1dc2e9f9a9d8d8065fa096b5551ca646086a72ed Mon Sep 17 00:00:00 2001
99 99
 From: Alexey Makhalov <amakhalov@vmware.com>
100 100
 Date: Fri, 2 Oct 2015 20:00:06 +0000
101
-Subject: [PATCH 02/13] PV io_delay for VMware guest.
101
+Subject: [PATCH 02/14] PV io_delay for VMware guest.
102 102
 
103 103
 ---
104 104
  arch/x86/kernel/cpu/vmware.c | 13 +++++++++++++
... ...
@@ -149,7 +149,7 @@ index 628a059..8fdd031 100644
149 149
 From faf39d20732abb865f003b46a567ea42d0841e92 Mon Sep 17 00:00:00 2001
150 150
 From: Alexey Makhalov <amakhalov@vmware.com>
151 151
 Date: Wed, 7 Oct 2015 22:53:18 +0000
152
-Subject: [PATCH 03/13] Improved tsc based sched_clock & clocksource.
152
+Subject: [PATCH 03/14] Improved tsc based sched_clock & clocksource.
153 153
 
154 154
 ---
155 155
  arch/x86/Kconfig             |  1 +
... ...
@@ -327,7 +327,7 @@ index caf4041..86d8a78 100644
327 327
 From 543bcc0aa46846859c92be5effde0d900a456c2a Mon Sep 17 00:00:00 2001
328 328
 From: Alexey Makhalov <amakhalov@vmware.com>
329 329
 Date: Mon, 12 Oct 2015 22:43:38 +0000
330
-Subject: [PATCH 04/13] Move read_boot_clock64 into pv_time_ops.
330
+Subject: [PATCH 04/14] Move read_boot_clock64 into pv_time_ops.
331 331
 
332 332
 ---
333 333
  arch/x86/Kconfig                      | 14 ++++++--
... ...
@@ -635,7 +635,7 @@ index 86d8a78..377ab5a 100644
635 635
 From f832fc949c5e97799fc977a317025a721d87bb68 Mon Sep 17 00:00:00 2001
636 636
 From: Alexey Makhalov <amakhalov@vmware.com>
637 637
 Date: Thu, 5 Nov 2015 21:02:52 +0000
638
-Subject: [PATCH 05/13] Fix clocksource_vmware issue in VM version <= 10
638
+Subject: [PATCH 05/14] Fix clocksource_vmware issue in VM version <= 10
639 639
 
640 640
 ---
641 641
  arch/x86/kernel/cpu/vmware.c | 48 +++++++++++++++++++++++++++++++++++++++++---
... ...
@@ -733,7 +733,7 @@ index 1bf1fe3..0b89bb9 100644
733 733
 From 15e6d2cc5239e58ab805f882650ad7de9b163228 Mon Sep 17 00:00:00 2001
734 734
 From: Alexey Makhalov <amakhalov@vmware.com>
735 735
 Date: Tue, 10 Nov 2015 11:46:57 +0000
736
-Subject: [PATCH 06/13] Get lapic timer frequency from HV, skip calibration
736
+Subject: [PATCH 06/14] Get lapic timer frequency from HV, skip calibration
737 737
 
738 738
 ---
739 739
  arch/x86/kernel/cpu/vmware.c | 48 +++++---------------------------------------
... ...
@@ -823,7 +823,7 @@ index 0b89bb9..b16618b 100644
823 823
 From 10ebf94df7ed241429a04b2cc3c2d590dd97d7dd Mon Sep 17 00:00:00 2001
824 824
 From: Alexey Makhalov <amakhalov@vmware.com>
825 825
 Date: Tue, 15 Dec 2015 21:31:18 +0000
826
-Subject: [PATCH 07/13] Skip rdrand reseed
826
+Subject: [PATCH 07/14] Skip rdrand reseed
827 827
 
828 828
 ---
829 829
  arch/x86/kernel/cpu/common.c | 2 ++
... ...
@@ -868,7 +868,7 @@ index 136ac74..0685891 100644
868 868
 From 237e42455bd98cf6e0e0725d35bba1b6d0d04822 Mon Sep 17 00:00:00 2001
869 869
 From: Alexey Makhalov <amakhalov@vmware.com>
870 870
 Date: Thu, 3 Dec 2015 00:46:46 +0000
871
-Subject: [PATCH 08/13] STA implementation. first version.
871
+Subject: [PATCH 08/14] STA implementation. first version.
872 872
 
873 873
 ---
874 874
  arch/x86/kernel/cpu/vmware.c | 163 +++++++++++++++++++++++++++++++++++++++++++
... ...
@@ -1093,7 +1093,7 @@ index b16618b..cf1fb64 100644
1093 1093
 From 21249118757b7232948c8401ba5d0b039cd0fa35 Mon Sep 17 00:00:00 2001
1094 1094
 From: Alexey Makhalov <amakhalov@vmware.com>
1095 1095
 Date: Wed, 13 Jan 2016 22:54:04 +0000
1096
-Subject: [PATCH 09/13] STA. updated version
1096
+Subject: [PATCH 09/14] STA. updated version
1097 1097
 
1098 1098
 ---
1099 1099
  arch/x86/kernel/cpu/vmware.c | 34 ++++++++++++++++++++++++----------
... ...
@@ -1182,7 +1182,7 @@ index cf1fb64..196703c 100644
1182 1182
 From 7061430a3c8906e67978da76a73967b0b26aece7 Mon Sep 17 00:00:00 2001
1183 1183
 From: Alexey Makhalov <amakhalov@vmware.com>
1184 1184
 Date: Tue, 15 Mar 2016 22:29:23 +0000
1185
-Subject: [PATCH 10/13] STA: version with a single backdoor command.
1185
+Subject: [PATCH 10/14] STA: version with a single backdoor command.
1186 1186
 
1187 1187
 ---
1188 1188
  arch/x86/kernel/cpu/vmware.c | 35 +++++++++++++++--------------------
... ...
@@ -1273,7 +1273,7 @@ index 196703c..743b8ad 100644
1273 1273
 From ee3ab56a4bdca7e514b4d07b6a70f724cde7f0f5 Mon Sep 17 00:00:00 2001
1274 1274
 From: Alexey Makhalov <amakhalov@vmware.com>
1275 1275
 Date: Fri, 25 Mar 2016 01:14:17 +0000
1276
-Subject: [PATCH 11/13] Remove delays for smpboot
1276
+Subject: [PATCH 11/14] Remove delays for smpboot
1277 1277
 
1278 1278
 ---
1279 1279
  arch/x86/kernel/smpboot.c | 2 +-
... ...
@@ -1299,7 +1299,7 @@ index fbabe4f..5a18dd6 100644
1299 1299
 From c6ade3b8c3db962d24e07ff9a483d26e46a41bb0 Mon Sep 17 00:00:00 2001
1300 1300
 From: Alexey Makhalov <amakhalov@vmware.com>
1301 1301
 Date: Tue, 29 Mar 2016 21:14:46 +0000
1302
-Subject: [PATCH 12/13] kmsg_dumper to vmware.log
1302
+Subject: [PATCH 12/14] kmsg_dumper to vmware.log
1303 1303
 
1304 1304
 ---
1305 1305
  arch/x86/kernel/cpu/vmware.c | 143 +++++++++++++++++++++++++++++++++++++++++--
... ...
@@ -1492,7 +1492,7 @@ index 743b8ad..e9f7d52 100644
1492 1492
 From 9edf1bf3a56c8c8048d2958d13283df5a283acd1 Mon Sep 17 00:00:00 2001
1493 1493
 From: Alexey Makhalov <amakhalov@vmware.com>
1494 1494
 Date: Mon, 9 May 2016 04:14:03 -0700
1495
-Subject: [PATCH 13/13] __native_read_tsc() -> rdtsc()
1495
+Subject: [PATCH 13/14] __native_read_tsc() -> rdtsc()
1496 1496
 
1497 1497
 ---
1498 1498
  arch/x86/kernel/cpu/vmware.c | 8 ++++----
... ...
@@ -1541,3 +1541,57 @@ index e9f7d52..57cef56 100644
1541 1541
 -- 
1542 1542
 1.9.1
1543 1543
 
1544
+
1545
+From 42ac37f4ec59aee6b37b7beed93c7e1055d14522 Mon Sep 17 00:00:00 2001
1546
+From: Alexey Makhalov <amakhalov@vmware.com>
1547
+Date: Thu, 6 Oct 2016 11:24:55 -0700
1548
+Subject: [PATCH 14/14] Fix lapic_timer_frequency
1549
+
1550
+---
1551
+ arch/x86/kernel/cpu/vmware.c | 15 +++++++++------
1552
+ 1 file changed, 9 insertions(+), 6 deletions(-)
1553
+
1554
+diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
1555
+index 57cef56..63fe6c8 100644
1556
+--- a/arch/x86/kernel/cpu/vmware.c
1557
+@@ -291,7 +291,7 @@ arch_initcall(activate_jump_labels);
1558
+ static void __init paravirt_ops_setup(void)
1559
+ {
1560
+ 	pv_info.name = "VMware";
1561
+-	pv_cpu_ops.io_delay = paravirt_nop,
1562
++	pv_cpu_ops.io_delay = paravirt_nop;
1563
+ 	pv_time_ops.sched_clock = vmware_sched_clock;
1564
+ 	pv_time_ops.read_boot_clock64 = vmware_read_boot_clock64;
1565
+ 
1566
+@@ -319,8 +319,15 @@ static void __init vmware_platform_setup(void)
1567
+ 
1568
+ 	VMWARE_PORT(GETHZ, eax, ebx, ecx, edx);
1569
+ 
1570
+-	if (ebx != UINT_MAX)
1571
++	if (ebx != UINT_MAX) {
1572
+ 		x86_platform.calibrate_tsc = vmware_get_tsc_khz;
1573
++#ifdef CONFIG_X86_LOCAL_APIC
1574
++		/* Skip lapic calibration since we know the bus frequency. */
1575
++		lapic_timer_frequency = ecx / HZ;
1576
++		pr_info("Host bus clock speed read from hypervisor : %u Hz\n",
1577
++			ecx);
1578
++#endif
1579
++	}
1580
+ 	else
1581
+ 		printk(KERN_WARNING
1582
+ 		       "Failed to get TSC freq from the hypervisor\n");
1583
+@@ -330,10 +337,6 @@ static void __init vmware_platform_setup(void)
1584
+ 	printk(KERN_INFO "Pre Kernel boot time: %dms\n",
1585
+ 		(unsigned int) (tsc_at_head / vtsc_khz));
1586
+ 
1587
+-#ifdef CONFIG_X86_LOCAL_APIC
1588
+-	/* Skip lapic calibration since we know bus frequency. */
1589
+-	lapic_timer_frequency = ecx;
1590
+-#endif
1591
+ 	vmware_cyc2ns.cyc2ns_mul =
1592
+ 		DIV_ROUND_CLOSEST(NSEC_PER_MSEC << CYC2NS_SCALE_FACTOR,
1593
+ 				  vtsc_khz);
1594
+-- 
1595
+1.9.1
1596
+
... ...
@@ -1,7 +1,17 @@
1
-diff -Naur a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
2
-+++ b/net/sunrpc/xprtsock.c	2016-09-01 15:08:07.579462068 -0700
3
-@@ -1791,9 +1791,11 @@
1
+From 5ff0b9e728e23e54001c2bb6df29d85ac2c5e08f Mon Sep 17 00:00:00 2001
2
+From: Alexey Makhalov <amakhalov@vmware.com>
3
+Date: Fri, 25 Mar 2016 21:51:12 +0000
4
+Subject: [PATCH] sunrpc: xs_bind uses ip_local_reserved_ports
5
+
6
+---
7
+ net/sunrpc/xprtsock.c | 7 ++++++-
8
+ 1 file changed, 6 insertions(+), 1 deletion(-)
9
+
10
+diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
11
+index 2ffaf6a..90543d6 100644
12
+--- a/net/sunrpc/xprtsock.c
13
+@@ -1798,9 +1798,11 @@ static unsigned short xs_next_srcport(struct sock_xprt *transport, unsigned shor
4 14
  static int xs_bind(struct sock_xprt *transport, struct socket *sock)
5 15
  {
6 16
  	struct sockaddr_storage myaddr;
... ...
@@ -14,7 +24,7 @@ diff -Naur a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
14 14
  
15 15
  	/*
16 16
  	 * If we are asking for any ephemeral port (i.e. port == 0 &&
17
-@@ -1815,6 +1817,8 @@
17
+@@ -1822,6 +1824,8 @@ static int xs_bind(struct sock_xprt *transport, struct socket *sock)
18 18
  
19 19
  	memcpy(&myaddr, &transport->srcaddr, transport->xprt.addrlen);
20 20
  	do {
... ...
@@ -23,7 +33,7 @@ diff -Naur a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
23 23
  		rpc_set_port((struct sockaddr *)&myaddr, port);
24 24
  		err = kernel_bind(sock, (struct sockaddr *)&myaddr,
25 25
  				transport->xprt.addrlen);
26
-@@ -1822,6 +1826,7 @@
26
+@@ -1829,6 +1833,7 @@ static int xs_bind(struct sock_xprt *transport, struct socket *sock)
27 27
  			transport->srcport = port;
28 28
  			break;
29 29
  		}
... ...
@@ -31,3 +41,6 @@ diff -Naur a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
31 31
  		last = port;
32 32
  		port = xs_next_srcport(transport, port);
33 33
  		if (port > last)
34
+-- 
35
+1.9.1
36
+
... ...
@@ -1465,6 +1465,7 @@ CONFIG_FUSION_MAX_SGE=128
1465 1465
 # CONFIG_FIREWIRE_NOSY is not set
1466 1466
 # CONFIG_MACINTOSH_DRIVERS is not set
1467 1467
 CONFIG_NETDEVICES=y
1468
+CONFIG_MII=m
1468 1469
 CONFIG_NET_CORE=y
1469 1470
 # CONFIG_BONDING is not set
1470 1471
 CONFIG_DUMMY=m
... ...
@@ -1500,7 +1501,9 @@ CONFIG_ETHERNET=y
1500 1500
 # CONFIG_NET_VENDOR_AGERE is not set
1501 1501
 # CONFIG_NET_VENDOR_ALTEON is not set
1502 1502
 # CONFIG_ALTERA_TSE is not set
1503
-# CONFIG_NET_VENDOR_AMD is not set
1503
+CONFIG_NET_VENDOR_AMD=y
1504
+# CONFIG_AMD8111_ETH is not set
1505
+CONFIG_PCNET32=m
1504 1506
 # CONFIG_NET_VENDOR_ARC is not set
1505 1507
 # CONFIG_NET_VENDOR_ATHEROS is not set
1506 1508
 # CONFIG_NET_VENDOR_AURORA is not set
... ...
@@ -1530,7 +1533,7 @@ CONFIG_E1000E=m
1530 1530
 # CONFIG_I40E is not set
1531 1531
 # CONFIG_I40EVF is not set
1532 1532
 # CONFIG_FM10K is not set
1533
-CONFIG_NET_VENDOR_I825XX=y
1533
+# CONFIG_NET_VENDOR_I825XX is not set
1534 1534
 # CONFIG_JME is not set
1535 1535
 # CONFIG_NET_VENDOR_MARVELL is not set
1536 1536
 # CONFIG_NET_VENDOR_MELLANOX is not set
... ...
@@ -2,7 +2,7 @@
2 2
 Summary:       Kernel
3 3
 Name:          linux-esx
4 4
 Version:       4.4.20
5
-Release:       4%{?dist}
5
+Release:       5%{?dist}
6 6
 License:       GPLv2
7 7
 URL:           http://www.kernel.org/
8 8
 Group:         System Environment/Kernel
... ...
@@ -33,6 +33,8 @@ Patch17:       vmxnet3-1.4.7.0-set-CHECKSUM_UNNECESSARY-for-IPv6-packets.patch
33 33
 Patch18:       vmxnet3-1.4.8.0-segCnt-can-be-1-for-LRO-packets.patch
34 34
 #fixes CVE-2016-0758
35 35
 Patch19:       keys-fix-asn.1-indefinite-length-object-parsing.patch
36
+Patch20:       vmci-1.1.4.0-use-32bit-atomics-for-queue-headers.patch
37
+Patch21:       vmci-1.1.5.0-doorbell-create-and-destroy-fixes.patch
36 38
 BuildRequires: bc
37 39
 BuildRequires: kbd
38 40
 BuildRequires: kmod
... ...
@@ -87,8 +89,13 @@ The Linux package contains the Linux kernel doc files
87 87
 %patch17 -p1
88 88
 %patch18 -p1
89 89
 %patch19 -p1
90
+%patch20 -p1
91
+%patch21 -p1
90 92
 
91 93
 %build
94
+# patch vmw_balloon driver
95
+sed -i 's/module_init/late_initcall/' drivers/misc/vmw_balloon.c
96
+
92 97
 make mrproper
93 98
 cp %{SOURCE1} .config
94 99
 make LC_ALL= oldconfig
... ...
@@ -155,6 +162,12 @@ ln -sf %{name}-%{version}-%{release}.cfg /boot/photon.cfg
155 155
 /usr/src/%{name}-headers-%{version}-%{release}
156 156
 
157 157
 %changelog
158
+*   Thu Oct  6 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-5
159
+-   .config: added ADM PCnet32 support
160
+-   vmci-1.1.4.0-use-32bit-atomics-for-queue-headers.patch
161
+-   vmci-1.1.5.0-doorbell-create-and-destroy-fixes.patch
162
+-   late_initcall for vmw_balloon driver
163
+-   Minor fixed in pv-ops patchset
158 164
 *   Mon Oct  3 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-4
159 165
 -   Package vmlinux with PROGBITS sections in -debuginfo subpackage
160 166
 *   Wed Sep 21 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-3
... ...
@@ -198,7 +211,7 @@ ln -sf %{name}-%{version}-%{release}.cfg /boot/photon.cfg
198 198
 -   Apply photon8 config (+stack protector regular)
199 199
 -   pv-ops patch: added STA support
200 200
 -   Added patches from generic kernel
201
-*   Tue Mar 09 2016 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 4.2.0-17
201
+*   Wed Mar 09 2016 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 4.2.0-17
202 202
 -   Enable ACPI hotplug support in kernel config
203 203
 *   Sun Feb 14 2016 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-16
204 204
 -   veth patch: don’t modify ip_summed
205 205
new file mode 100644
... ...
@@ -0,0 +1,92 @@
0
+diff --git a/drivers/misc/vmw_vmci/vmci_driver.c b/drivers/misc/vmw_vmci/vmci_driver.c
1
+index b823f9a..896be15 100644
2
+--- a/drivers/misc/vmw_vmci/vmci_driver.c
3
+@@ -113,5 +113,5 @@ module_exit(vmci_drv_exit);
4
+ 
5
+ MODULE_AUTHOR("VMware, Inc.");
6
+ MODULE_DESCRIPTION("VMware Virtual Machine Communication Interface.");
7
+-MODULE_VERSION("1.1.3.0-k");
8
++MODULE_VERSION("1.1.4.0-k");
9
+ MODULE_LICENSE("GPL v2");
10
+diff --git a/include/linux/vmw_vmci_defs.h b/include/linux/vmw_vmci_defs.h
11
+index 65ac54c..1bd31a3 100644
12
+--- a/include/linux/vmw_vmci_defs.h
13
+@@ -734,6 +734,41 @@ static inline void *vmci_event_data_payload(struct vmci_event_data *ev_data)
14
+ }
15
+ 
16
+ /*
17
++ * Helper to read a value from a head or tail pointer. For X86_32, the
18
++ * pointer is treated as a 32bit value, since the pointer value
19
++ * never exceeds a 32bit value in this case. Also, doing an
20
++ * atomic64_read on X86_32 uniprocessor systems may be implemented
21
++ * as a non locked cmpxchg8b, that may end up overwriting updates done
22
++ * by the VMCI device to the memory location. On 32bit SMP, the lock
23
++ * prefix will be used, so correctness isn't an issue, but using a
24
++ * 64bit operation still adds unnecessary overhead.
25
++ */
26
++static inline u64 vmci_q_read_pointer(atomic64_t *var)
27
++{
28
++#if defined(CONFIG_X86_32)
29
++	return atomic_read((atomic_t *)var);
30
++#else
31
++	return atomic64_read(var);
32
++#endif
33
++}
34
++
35
++/*
36
++ * Helper to set the value of a head or tail pointer. For X86_32, the
37
++ * pointer is treated as a 32bit value, since the pointer value
38
++ * never exceeds a 32bit value in this case. On 32bit SMP, using a
39
++ * locked cmpxchg8b adds unnecessary overhead.
40
++ */
41
++static inline void vmci_q_set_pointer(atomic64_t *var,
42
++				      u64 new_val)
43
++{
44
++#if defined(CONFIG_X86_32)
45
++	return atomic_set((atomic_t *)var, (u32)new_val);
46
++#else
47
++	return atomic64_set(var, new_val);
48
++#endif
49
++}
50
++
51
++/*
52
+  * Helper to add a given offset to a head or tail pointer. Wraps the
53
+  * value of the pointer around the max size of the queue.
54
+  */
55
+@@ -741,14 +776,14 @@ static inline void vmci_qp_add_pointer(atomic64_t *var,
56
+ 				       size_t add,
57
+ 				       u64 size)
58
+ {
59
+-	u64 new_val = atomic64_read(var);
60
++	u64 new_val = vmci_q_read_pointer(var);
61
+ 
62
+ 	if (new_val >= size - add)
63
+ 		new_val -= size;
64
+ 
65
+ 	new_val += add;
66
+ 
67
+-	atomic64_set(var, new_val);
68
++	vmci_q_set_pointer(var, new_val);
69
+ }
70
+ 
71
+ /*
72
+@@ -758,7 +793,7 @@ static inline u64
73
+ vmci_q_header_producer_tail(const struct vmci_queue_header *q_header)
74
+ {
75
+ 	struct vmci_queue_header *qh = (struct vmci_queue_header *)q_header;
76
+-	return atomic64_read(&qh->producer_tail);
77
++	return vmci_q_read_pointer(&qh->producer_tail);
78
+ }
79
+ 
80
+ /*
81
+@@ -768,7 +803,7 @@ static inline u64
82
+ vmci_q_header_consumer_head(const struct vmci_queue_header *q_header)
83
+ {
84
+ 	struct vmci_queue_header *qh = (struct vmci_queue_header *)q_header;
85
+-	return atomic64_read(&qh->consumer_head);
86
++	return vmci_q_read_pointer(&qh->consumer_head);
87
+ }
88
+ 
89
+ /*
0 90
new file mode 100644
... ...
@@ -0,0 +1,44 @@
0
+---
1
+ drivers/misc/vmw_vmci/vmci_doorbell.c |    8 +++++++-
2
+ drivers/misc/vmw_vmci/vmci_driver.c   |    2 +-
3
+ 2 files changed, 8 insertions(+), 2 deletions(-)
4
+
5
+diff --git a/drivers/misc/vmw_vmci/vmci_doorbell.c b/drivers/misc/vmw_vmci/vmci_doorbell.c
6
+index a8cee33..b3fa738 100644
7
+--- a/drivers/misc/vmw_vmci/vmci_doorbell.c
8
+@@ -431,6 +431,12 @@ int vmci_doorbell_create(struct vmci_handle *handle,
9
+ 	if (vmci_handle_is_invalid(*handle)) {
10
+ 		u32 context_id = vmci_get_context_id();
11
+ 
12
++		if (context_id == VMCI_INVALID_ID) {
13
++			pr_warn("Failed to get context ID\n");
14
++			result = VMCI_ERROR_NO_RESOURCES;
15
++			goto free_mem;
16
++		}
17
++
18
+ 		/* Let resource code allocate a free ID for us */
19
+ 		new_handle = vmci_make_handle(context_id, VMCI_INVALID_ID);
20
+ 	} else {
21
+@@ -525,7 +531,7 @@ int vmci_doorbell_destroy(struct vmci_handle handle)
22
+ 
23
+ 	entry = container_of(resource, struct dbell_entry, resource);
24
+ 
25
+-	if (vmci_guest_code_active()) {
26
++	if (!hlist_unhashed(&entry->node)) {
27
+ 		int result;
28
+ 
29
+ 		dbell_index_table_remove(entry);
30
+diff --git a/drivers/misc/vmw_vmci/vmci_driver.c b/drivers/misc/vmw_vmci/vmci_driver.c
31
+index 896be15..d7eaf1e 100644
32
+--- a/drivers/misc/vmw_vmci/vmci_driver.c
33
+@@ -113,5 +113,5 @@ module_exit(vmci_drv_exit);
34
+ 
35
+ MODULE_AUTHOR("VMware, Inc.");
36
+ MODULE_DESCRIPTION("VMware Virtual Machine Communication Interface.");
37
+-MODULE_VERSION("1.1.4.0-k");
38
++MODULE_VERSION("1.1.5.0-k");
39
+ MODULE_LICENSE("GPL v2");
40
+-- 
41
+1.7.0