Browse code

kernels: fix panic in ip_set

Extras:
All kernels:
- version bump up to 4.9.94
- apply vmxnet3 patches to address bug# 2084294.
linux:
- .config: disable XEN_BALLOON_MEMORY_HOTPLUG
Move update_linux script to tools/scripts.

Change-Id: Ie7e1c8aa0dc724d74d838802d50dfaced58afa24
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4963
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Srivatsa S. Bhat <srivatsab@vmware.com>

Alexey Makhalov authored on 2018/04/03 06:27:40
Showing 13 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 Summary:	Linux API header files
2 2
 Name:		linux-api-headers
3
-Version:	4.9.90
3
+Version:	4.9.94
4 4
 Release:	1%{?dist}
5 5
 License:	GPLv2
6 6
 URL:		http://www.kernel.org/
... ...
@@ -8,7 +8,7 @@ Group:		System Environment/Kernel
8 8
 Vendor:		VMware, Inc.
9 9
 Distribution: Photon
10 10
 Source0:        http://www.kernel.org/pub/linux/kernel/v4.x/linux-%{version}.tar.xz
11
-%define sha1 linux=e6f8a32fdfe078407073514fbdda968f59406725
11
+%define sha1 linux=82437991bdd6284fd3fd1fe21eb13f97abac203b
12 12
 BuildArch:	noarch
13 13
 %description
14 14
 The Linux API Headers expose the kernel's API for use by Glibc.
... ...
@@ -25,6 +25,10 @@ find /%{buildroot}%{_includedir} \( -name .install -o -name ..install.cmd \) -de
25 25
 %defattr(-,root,root)
26 26
 %{_includedir}/*
27 27
 %changelog
28
+*   Wed Apr 18 2018 Alexey Makhalov <amakhalov@vmware.com> 4.9.94-1
29
+-   Update to version 4.9.94
30
+*   Mon Apr 02 2018 Alexey Makhalov <amakhalov@vmware.com> 4.9.92-1
31
+-   Update to version 4.9.92
28 32
 *   Tue Mar 27 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.90-1
29 33
 -   Update to version 4.9.90
30 34
 *   Thu Mar 22 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.89-1
... ...
@@ -3684,8 +3684,7 @@ CONFIG_HYPERV_BALLOON=m
3684 3684
 #
3685 3685
 CONFIG_XEN_BALLOON=y
3686 3686
 CONFIG_XEN_SELFBALLOONING=y
3687
-CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
3688
-CONFIG_XEN_BALLOON_MEMORY_HOTPLUG_LIMIT=512
3687
+# CONFIG_XEN_BALLOON_MEMORY_HOTPLUG is not set
3689 3688
 CONFIG_XEN_SCRUB_PAGES=y
3690 3689
 CONFIG_XEN_DEV_EVTCHN=m
3691 3690
 CONFIG_XEN_BACKEND=y
... ...
@@ -1,7 +1,7 @@
1 1
 %global security_hardening none
2 2
 Summary:        Kernel
3 3
 Name:           linux-aws
4
-Version:        4.9.90
4
+Version:        4.9.94
5 5
 Release:        1%{?kat_build:.%kat_build}%{?dist}
6 6
 License:    	GPLv2
7 7
 URL:        	http://www.kernel.org/
... ...
@@ -9,7 +9,7 @@ Group:        	System Environment/Kernel
9 9
 Vendor:         VMware, Inc.
10 10
 Distribution: 	Photon
11 11
 Source0:        http://www.kernel.org/pub/linux/kernel/v4.x/linux-%{version}.tar.xz
12
-%define sha1 linux=e6f8a32fdfe078407073514fbdda968f59406725
12
+%define sha1 linux=82437991bdd6284fd3fd1fe21eb13f97abac203b
13 13
 Source1:	config-aws
14 14
 Source2:	initramfs.trigger
15 15
 # common
... ...
@@ -42,6 +42,16 @@ Patch25:        0002-allow-also-ecb-cipher_null.patch
42 42
 Patch26:        add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch
43 43
 # Fix CVE-2017-1000252
44 44
 Patch28:        kvm-dont-accept-wrong-gsi-values.patch
45
+Patch30:        vmxnet3-avoid-xmit-reset-due-to-a-race-in-vmxnet3.patch
46
+Patch31:        vmxnet3-use-correct-flag-to-indicate-LRO-feature.patch
47
+Patch32:        netfilter-ipset-pernet-ops-must-be-unregistered-last.patch
48
+
49
+# TODO: remove these patches on update
50
+# 4.9.94 has a compile time error. Revert this commit to fix it.
51
+# https://www.spinics.net/lists/stable/msg235266.html
52
+Patch33:        perf-tests-Decompress-kernel-module-before-objdump.patch
53
+Patch34:        perf-tests-Decompress-kernel-module-when-reading-DSO-data.patch
54
+
45 55
 # For Spectre
46 56
 Patch52: 0141-locking-barriers-introduce-new-observable-speculatio.patch
47 57
 Patch53: 0142-bpf-prevent-speculative-execution-in-eBPF-interprete.patch
... ...
@@ -200,6 +210,11 @@ This package contains the 'perf' performance analysis tools for Linux kernel.
200 200
 %patch25 -p1
201 201
 %patch26 -p1
202 202
 %patch28 -p1
203
+%patch30 -p1
204
+%patch31 -p1
205
+%patch32 -p1
206
+%patch33 -p1 -R
207
+%patch34 -p1 -R
203 208
 
204 209
 %patch52 -p1
205 210
 %patch53 -p1
... ...
@@ -419,6 +434,10 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
419 419
 /usr/share/doc/*
420 420
 
421 421
 %changelog
422
+*   Wed Apr 18 2018 Alexey Makhalov <amakhalov@vmware.com> 4.9.94-1
423
+-   Update to version 4.9.94. Fix panic in ip_set.
424
+*   Mon Apr 02 2018 Alexey Makhalov <amakhalov@vmware.com> 4.9.92-1
425
+-   Update to version 4.9.92. Apply vmxnet3 patches.
422 426
 *   Tue Mar 27 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.90-1
423 427
 -   Update to version 4.9.90
424 428
 *   Thu Mar 22 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.89-1
... ...
@@ -1,7 +1,7 @@
1 1
 %global security_hardening none
2 2
 Summary:        Kernel
3 3
 Name:           linux-esx
4
-Version:        4.9.90
4
+Version:        4.9.94
5 5
 Release:        1%{?dist}
6 6
 License:        GPLv2
7 7
 URL:            http://www.kernel.org/
... ...
@@ -9,7 +9,7 @@ Group:          System Environment/Kernel
9 9
 Vendor:         VMware, Inc.
10 10
 Distribution:   Photon
11 11
 Source0:        http://www.kernel.org/pub/linux/kernel/v4.x/linux-%{version}.tar.xz
12
-%define sha1 linux=e6f8a32fdfe078407073514fbdda968f59406725
12
+%define sha1 linux=82437991bdd6284fd3fd1fe21eb13f97abac203b
13 13
 Source1:        config-esx
14 14
 Source2:        initramfs.trigger
15 15
 # common
... ...
@@ -39,6 +39,9 @@ Patch22:        add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.pat
39 39
 # Fix CVE-2017-1000252
40 40
 Patch24:        kvm-dont-accept-wrong-gsi-values.patch
41 41
 Patch25:        init-do_mounts-recreate-dev-root.patch
42
+Patch30:        vmxnet3-avoid-xmit-reset-due-to-a-race-in-vmxnet3.patch
43
+Patch31:        vmxnet3-use-correct-flag-to-indicate-LRO-feature.patch
44
+Patch32:        netfilter-ipset-pernet-ops-must-be-unregistered-last.patch
42 45
 # For Spectre
43 46
 Patch52: 0141-locking-barriers-introduce-new-observable-speculatio.patch
44 47
 Patch53: 0142-bpf-prevent-speculative-execution-in-eBPF-interprete.patch
... ...
@@ -115,6 +118,9 @@ The Linux package contains the Linux kernel doc files
115 115
 %patch22 -p1
116 116
 %patch24 -p1
117 117
 %patch25 -p1
118
+%patch30 -p1
119
+%patch31 -p1
120
+%patch32 -p1
118 121
 
119 122
 %patch52 -p1
120 123
 %patch53 -p1
... ...
@@ -226,6 +232,10 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
226 226
 /usr/src/linux-headers-%{uname_r}
227 227
 
228 228
 %changelog
229
+*   Wed Apr 18 2018 Alexey Makhalov <amakhalov@vmware.com> 4.9.94-1
230
+-   Update to version 4.9.94. Fix panic in ip_set.
231
+*   Mon Apr 02 2018 Alexey Makhalov <amakhalov@vmware.com> 4.9.92-1
232
+-   Update to version 4.9.92. Apply vmxnet3 patches.
229 233
 *   Tue Mar 27 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.90-1
230 234
 -   Update to version 4.9.90
231 235
 *   Thu Mar 22 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.89-1
... ...
@@ -1,7 +1,7 @@
1 1
 %global security_hardening none
2 2
 Summary:        Kernel
3 3
 Name:           linux-secure
4
-Version:        4.9.90
4
+Version:        4.9.94
5 5
 Release:        1%{?kat_build:.%kat_build}%{?dist}
6 6
 License:        GPLv2
7 7
 URL:            http://www.kernel.org/
... ...
@@ -9,7 +9,7 @@ Group:          System Environment/Kernel
9 9
 Vendor:         VMware, Inc.
10 10
 Distribution:   Photon
11 11
 Source0:        http://www.kernel.org/pub/linux/kernel/v4.x/linux-%{version}.tar.xz
12
-%define sha1 linux=e6f8a32fdfe078407073514fbdda968f59406725
12
+%define sha1 linux=82437991bdd6284fd3fd1fe21eb13f97abac203b
13 13
 Source1:        config-secure
14 14
 Source2:        aufs4.9.tar.gz
15 15
 %define sha1 aufs=ebe716ce4b638a3772c7cd3161abbfe11d584906
... ...
@@ -48,6 +48,9 @@ Patch28:        0002-allow-also-ecb-cipher_null.patch
48 48
 Patch29:        add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch
49 49
 # Fix CVE-2017-1000252
50 50
 Patch31:        kvm-dont-accept-wrong-gsi-values.patch
51
+Patch32:        vmxnet3-avoid-xmit-reset-due-to-a-race-in-vmxnet3.patch
52
+Patch33:        vmxnet3-use-correct-flag-to-indicate-LRO-feature.patch
53
+Patch34:        netfilter-ipset-pernet-ops-must-be-unregistered-last.patch
51 54
 # For Spectre
52 55
 Patch52: 0141-locking-barriers-introduce-new-observable-speculatio.patch
53 56
 Patch53: 0142-bpf-prevent-speculative-execution-in-eBPF-interprete.patch
... ...
@@ -168,6 +171,9 @@ EOF
168 168
 %patch28 -p1
169 169
 %patch29 -p1
170 170
 %patch31 -p1
171
+%patch32 -p1
172
+%patch33 -p1
173
+%patch34 -p1
171 174
 
172 175
 # spectre
173 176
 %patch52 -p1
... ...
@@ -315,6 +321,10 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
315 315
 /usr/src/linux-headers-%{uname_r}
316 316
 
317 317
 %changelog
318
+*   Wed Apr 18 2018 Alexey Makhalov <amakhalov@vmware.com> 4.9.94-1
319
+-   Update to version 4.9.94. Fix panic in ip_set.
320
+*   Mon Apr 02 2018 Alexey Makhalov <amakhalov@vmware.com> 4.9.92-1
321
+-   Update to version 4.9.92. Apply vmxnet3 patches.
318 322
 *   Tue Mar 27 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.90-1
319 323
 -   Update to version 4.9.90
320 324
 *   Thu Mar 22 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.89-1
... ...
@@ -1,7 +1,7 @@
1 1
 %global security_hardening none
2 2
 Summary:        Kernel
3 3
 Name:           linux
4
-Version:        4.9.90
4
+Version:        4.9.94
5 5
 Release:        1%{?kat_build:.%kat_build}%{?dist}
6 6
 License:    	GPLv2
7 7
 URL:        	http://www.kernel.org/
... ...
@@ -9,7 +9,7 @@ Group:        	System Environment/Kernel
9 9
 Vendor:         VMware, Inc.
10 10
 Distribution: 	Photon
11 11
 Source0:        http://www.kernel.org/pub/linux/kernel/v4.x/linux-%{version}.tar.xz
12
-%define sha1 linux=e6f8a32fdfe078407073514fbdda968f59406725
12
+%define sha1 linux=82437991bdd6284fd3fd1fe21eb13f97abac203b
13 13
 Source1:	config
14 14
 Source2:	initramfs.trigger
15 15
 %define ena_version 1.1.3
... ...
@@ -45,6 +45,16 @@ Patch25:        0002-allow-also-ecb-cipher_null.patch
45 45
 Patch26:        add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch
46 46
 # Fix CVE-2017-1000252
47 47
 Patch28:        kvm-dont-accept-wrong-gsi-values.patch
48
+Patch30:        vmxnet3-avoid-xmit-reset-due-to-a-race-in-vmxnet3.patch
49
+Patch31:        vmxnet3-use-correct-flag-to-indicate-LRO-feature.patch
50
+Patch32:        netfilter-ipset-pernet-ops-must-be-unregistered-last.patch
51
+
52
+# TODO: remove these patches on update
53
+# 4.9.94 has a compile time error. Revert this commit to fix it.
54
+# https://www.spinics.net/lists/stable/msg235266.html
55
+Patch33:        perf-tests-Decompress-kernel-module-before-objdump.patch
56
+Patch34:        perf-tests-Decompress-kernel-module-when-reading-DSO-data.patch
57
+
48 58
 # For Spectre
49 59
 Patch52: 0141-locking-barriers-introduce-new-observable-speculatio.patch
50 60
 Patch53: 0142-bpf-prevent-speculative-execution-in-eBPF-interprete.patch
... ...
@@ -158,6 +168,11 @@ This package contains the 'perf' performance analysis tools for Linux kernel.
158 158
 %patch25 -p1
159 159
 %patch26 -p1
160 160
 %patch28 -p1
161
+%patch30 -p1
162
+%patch31 -p1
163
+%patch32 -p1
164
+%patch33 -p1 -R
165
+%patch34 -p1 -R
161 166
 
162 167
 %patch52 -p1
163 168
 %patch53 -p1
... ...
@@ -340,6 +355,11 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
340 340
 /usr/share/doc/*
341 341
 
342 342
 %changelog
343
+*   Wed Apr 18 2018 Alexey Makhalov <amakhalov@vmware.com> 4.9.94-1
344
+-   Update to version 4.9.94. Fix panic in ip_set.
345
+-   .config: disable XEN_BALLOON_MEMORY_HOTPLUG
346
+*   Mon Apr 02 2018 Alexey Makhalov <amakhalov@vmware.com> 4.9.92-1
347
+-   Update to version 4.9.92. Apply vmxnet3 patches.
343 348
 *   Tue Mar 27 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.90-1
344 349
 -   Update to version 4.9.90
345 350
 *   Thu Mar 22 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.89-1
346 351
new file mode 100644
... ...
@@ -0,0 +1,81 @@
0
+From e23ed762db7ed1950a6408c3be80bc56909ab3d4 Mon Sep 17 00:00:00 2001
1
+From: Florian Westphal <fw@strlen.de>
2
+Date: Tue, 26 Sep 2017 11:57:54 +0200
3
+Subject: netfilter: ipset: pernet ops must be unregistered last
4
+
5
+Removing the ipset module leaves a small window where one cpu performs
6
+module removal while another runs a command like 'ipset flush'.
7
+
8
+ipset uses net_generic(), unregistering the pernet ops frees this
9
+storage area.
10
+
11
+Fix it by first removing the user-visible api handlers and the pernet
12
+ops last.
13
+
14
+Fixes: 1785e8f473082 ("netfiler: ipset: Add net namespace for ipset")
15
+Reported-by: Li Shuang <shuali@redhat.com>
16
+Signed-off-by: Florian Westphal <fw@strlen.de>
17
+Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
18
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
19
+---
20
+ net/netfilter/ipset/ip_set_core.c | 22 +++++++++++++---------
21
+ 1 file changed, 13 insertions(+), 9 deletions(-)
22
+
23
+(limited to 'net/netfilter/ipset/ip_set_core.c')
24
+
25
+diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
26
+index e495b5e..a7f049f 100644
27
+--- a/net/netfilter/ipset/ip_set_core.c
28
+@@ -2072,25 +2072,28 @@ static struct pernet_operations ip_set_net_ops = {
29
+ static int __init
30
+ ip_set_init(void)
31
+ {
32
+-	int ret = nfnetlink_subsys_register(&ip_set_netlink_subsys);
33
++	int ret = register_pernet_subsys(&ip_set_net_ops);
34
+ 
35
++	if (ret) {
36
++		pr_err("ip_set: cannot register pernet_subsys.\n");
37
++		return ret;
38
++	}
39
++
40
++	ret = nfnetlink_subsys_register(&ip_set_netlink_subsys);
41
+ 	if (ret != 0) {
42
+ 		pr_err("ip_set: cannot register with nfnetlink.\n");
43
++		unregister_pernet_subsys(&ip_set_net_ops);
44
+ 		return ret;
45
+ 	}
46
++
47
+ 	ret = nf_register_sockopt(&so_set);
48
+ 	if (ret != 0) {
49
+ 		pr_err("SO_SET registry failed: %d\n", ret);
50
+ 		nfnetlink_subsys_unregister(&ip_set_netlink_subsys);
51
++		unregister_pernet_subsys(&ip_set_net_ops);
52
+ 		return ret;
53
+ 	}
54
+-	ret = register_pernet_subsys(&ip_set_net_ops);
55
+-	if (ret) {
56
+-		pr_err("ip_set: cannot register pernet_subsys.\n");
57
+-		nf_unregister_sockopt(&so_set);
58
+-		nfnetlink_subsys_unregister(&ip_set_netlink_subsys);
59
+-		return ret;
60
+-	}
61
++
62
+ 	pr_info("ip_set: protocol %u\n", IPSET_PROTOCOL);
63
+ 	return 0;
64
+ }
65
+@@ -2098,9 +2101,10 @@ ip_set_init(void)
66
+ static void __exit
67
+ ip_set_fini(void)
68
+ {
69
+-	unregister_pernet_subsys(&ip_set_net_ops);
70
+ 	nf_unregister_sockopt(&so_set);
71
+ 	nfnetlink_subsys_unregister(&ip_set_netlink_subsys);
72
++
73
++	unregister_pernet_subsys(&ip_set_net_ops);
74
+ 	pr_debug("these are the famous last words\n");
75
+ }
76
+ 
77
+-- 
78
+cgit v1.1
79
+
0 80
new file mode 100644
... ...
@@ -0,0 +1,65 @@
0
+commit 7525a238be8f46617cdda29d1be5b85ffe3b042d
1
+Author: Namhyung Kim <namhyung@kernel.org>
2
+Date:   Thu Jun 8 16:31:07 2017 +0900
3
+
4
+    perf tests: Decompress kernel module before objdump
5
+    
6
+    
7
+    [ Upstream commit 94df1040b1e6aacd8dec0ba3c61d7e77cd695f26 ]
8
+    
9
+    If a kernel modules is compressed, it should be decompressed before
10
+    running objdump to parse binary data correctly.  This fixes a failure of
11
+    object code reading test for me.
12
+    
13
+    Signed-off-by: Namhyung Kim <namhyung@kernel.org>
14
+    Acked-by: Adrian Hunter <adrian.hunter@intel.com>
15
+    Acked-by: Jiri Olsa <jolsa@kernel.org>
16
+    Cc: David Ahern <dsahern@gmail.com>
17
+    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
18
+    Cc: Wang Nan <wangnan0@huawei.com>
19
+    Cc: kernel-team@lge.com
20
+    Link: http://lkml.kernel.org/r/20170608073109.30699-8-namhyung@kernel.org
21
+    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
22
+    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
23
+    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
+
25
+diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
26
+index ff5bc6363a79..150334064071 100644
27
+--- a/tools/perf/tests/code-reading.c
28
+@@ -224,6 +224,8 @@ static int read_object_code(u64 addr, size_t len, u8 cpumode,
29
+ 	unsigned char buf2[BUFSZ];
30
+ 	size_t ret_len;
31
+ 	u64 objdump_addr;
32
++	const char *objdump_name;
33
++	char decomp_name[KMOD_DECOMP_LEN];
34
+ 	int ret;
35
+ 
36
+ 	pr_debug("Reading object code for memory address: %#"PRIx64"\n", addr);
37
+@@ -284,9 +286,25 @@ static int read_object_code(u64 addr, size_t len, u8 cpumode,
38
+ 		state->done[state->done_cnt++] = al.map->start;
39
+ 	}
40
+ 
41
++	objdump_name = al.map->dso->long_name;
42
++	if (dso__needs_decompress(al.map->dso)) {
43
++		if (dso__decompress_kmodule_path(al.map->dso, objdump_name,
44
++						 decomp_name,
45
++						 sizeof(decomp_name)) < 0) {
46
++			pr_debug("decompression failed\n");
47
++			return -1;
48
++		}
49
++
50
++		objdump_name = decomp_name;
51
++	}
52
++
53
+ 	/* Read the object code using objdump */
54
+ 	objdump_addr = map__rip_2objdump(al.map, al.addr);
55
+-	ret = read_via_objdump(al.map->dso->long_name, objdump_addr, buf2, len);
56
++	ret = read_via_objdump(objdump_name, objdump_addr, buf2, len);
57
++
58
++	if (dso__needs_decompress(al.map->dso))
59
++		unlink(objdump_name);
60
++
61
+ 	if (ret > 0) {
62
+ 		/*
63
+ 		 * The kernel maps are inaccurate - assume objdump is right in
0 64
new file mode 100644
... ...
@@ -0,0 +1,52 @@
0
+commit e2d054998b151e85b6305aa72264f67097bd78e9
1
+Author: Namhyung Kim <namhyung@kernel.org>
2
+Date:   Thu Jun 8 16:31:05 2017 +0900
3
+
4
+    perf tools: Decompress kernel module when reading DSO data
5
+    
6
+    
7
+    [ Upstream commit 1d6b3c9ba756a5134fd7ad1959acac776d17404b ]
8
+    
9
+    Currently perf decompresses kernel modules when loading the symbol table
10
+    but it missed to do it when reading raw data.
11
+    
12
+    Signed-off-by: Namhyung Kim <namhyung@kernel.org>
13
+    Acked-by: Jiri Olsa <jolsa@kernel.org>
14
+    Cc: Adrian Hunter <adrian.hunter@intel.com>
15
+    Cc: David Ahern <dsahern@gmail.com>
16
+    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
17
+    Cc: Wang Nan <wangnan0@huawei.com>
18
+    Cc: kernel-team@lge.com
19
+    Link: http://lkml.kernel.org/r/20170608073109.30699-6-namhyung@kernel.org
20
+    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
21
+    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
22
+    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
+
24
+diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
25
+index d2c6cdd9d42b..4bc58822416c 100644
26
+--- a/tools/perf/util/dso.c
27
+@@ -366,7 +366,23 @@ static int __open_dso(struct dso *dso, struct machine *machine)
28
+ 	if (!is_regular_file(name))
29
+ 		return -EINVAL;
30
+ 
31
++	if (dso__needs_decompress(dso)) {
32
++		char newpath[KMOD_DECOMP_LEN];
33
++		size_t len = sizeof(newpath);
34
++
35
++		if (dso__decompress_kmodule_path(dso, name, newpath, len) < 0) {
36
++			free(name);
37
++			return -dso->load_errno;
38
++		}
39
++
40
++		strcpy(name, newpath);
41
++	}
42
++
43
+ 	fd = do_open(name);
44
++
45
++	if (dso__needs_decompress(dso))
46
++		unlink(name);
47
++
48
+ 	free(name);
49
+ 	return fd;
50
+ }
0 51
new file mode 100644
... ...
@@ -0,0 +1,96 @@
0
+From 7a4c003d6921e2af215f4790aa43a292bdc78be0 Mon Sep 17 00:00:00 2001
1
+From: Ronak Doshi <doshir@vmware.com>
2
+Date: Fri, 16 Mar 2018 14:47:54 -0700
3
+Subject: vmxnet3: avoid xmit reset due to a race in vmxnet3
4
+
5
+The field txNumDeferred is used by the driver to keep track of the number
6
+of packets it has pushed to the emulation. The driver increments it on
7
+pushing the packet to the emulation and the emulation resets it to 0 at
8
+the end of the transmit.
9
+
10
+There is a possibility of a race either when (a) ESX is under heavy load or
11
+(b) workload inside VM is of low packet rate.
12
+
13
+This race results in xmit hangs when network coalescing is disabled. This
14
+change creates a local copy of txNumDeferred and uses it to perform ring
15
+arithmetic.
16
+
17
+Reported-by: Noriho Tanaka <ntanaka@vmware.com>
18
+Signed-off-by: Ronak Doshi <doshir@vmware.com>
19
+Acked-by: Shrikrishna Khare <skhare@vmware.com>
20
+Signed-off-by: David S. Miller <davem@davemloft.net>
21
+---
22
+ drivers/net/vmxnet3/vmxnet3_drv.c | 13 ++++++++-----
23
+ drivers/net/vmxnet3/vmxnet3_int.h |  4 ++--
24
+ 2 files changed, 10 insertions(+), 7 deletions(-)
25
+
26
+diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
27
+index 8b39c16..b466a42 100644
28
+--- a/drivers/net/vmxnet3/vmxnet3_drv.c
29
+@@ -977,6 +977,8 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
30
+ {
31
+ 	int ret;
32
+ 	u32 count;
33
++	int num_pkts;
34
++	int tx_num_deferred;
35
+ 	unsigned long flags;
36
+ 	struct vmxnet3_tx_ctx ctx;
37
+ 	union Vmxnet3_GenericDesc *gdesc;
38
+@@ -1075,12 +1077,12 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
39
+ #else
40
+ 	gdesc = ctx.sop_txd;
41
+ #endif
42
++	tx_num_deferred = le32_to_cpu(tq->shared->txNumDeferred);
43
+ 	if (ctx.mss) {
44
+ 		gdesc->txd.hlen = ctx.eth_ip_hdr_size + ctx.l4_hdr_size;
45
+ 		gdesc->txd.om = VMXNET3_OM_TSO;
46
+ 		gdesc->txd.msscof = ctx.mss;
47
+-		le32_add_cpu(&tq->shared->txNumDeferred, (skb->len -
48
+-			     gdesc->txd.hlen + ctx.mss - 1) / ctx.mss);
49
++		num_pkts = (skb->len - gdesc->txd.hlen + ctx.mss - 1) / ctx.mss;
50
+ 	} else {
51
+ 		if (skb->ip_summed == CHECKSUM_PARTIAL) {
52
+ 			gdesc->txd.hlen = ctx.eth_ip_hdr_size;
53
+@@ -1091,8 +1093,10 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
54
+ 			gdesc->txd.om = 0;
55
+ 			gdesc->txd.msscof = 0;
56
+ 		}
57
+-		le32_add_cpu(&tq->shared->txNumDeferred, 1);
58
++		num_pkts = 1;
59
+ 	}
60
++	le32_add_cpu(&tq->shared->txNumDeferred, num_pkts);
61
++	tx_num_deferred += num_pkts;
62
+ 
63
+ 	if (skb_vlan_tag_present(skb)) {
64
+ 		gdesc->txd.ti = 1;
65
+@@ -1118,8 +1122,7 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
66
+ 
67
+ 	spin_unlock_irqrestore(&tq->tx_lock, flags);
68
+ 
69
+-	if (le32_to_cpu(tq->shared->txNumDeferred) >=
70
+-					le32_to_cpu(tq->shared->txThreshold)) {
71
++	if (tx_num_deferred >= le32_to_cpu(tq->shared->txThreshold)) {
72
+ 		tq->shared->txNumDeferred = 0;
73
+ 		VMXNET3_WRITE_BAR0_REG(adapter,
74
+ 				       VMXNET3_REG_TXPROD + tq->qid * 8,
75
+diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
76
+index 5ba2229..b94fdfd 100644
77
+--- a/drivers/net/vmxnet3/vmxnet3_int.h
78
+@@ -69,10 +69,10 @@
79
+ /*
80
+  * Version numbers
81
+  */
82
+-#define VMXNET3_DRIVER_VERSION_STRING   "1.4.a.0-k"
83
++#define VMXNET3_DRIVER_VERSION_STRING   "1.4.c.0-k"
84
+ 
85
+ /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
86
+-#define VMXNET3_DRIVER_VERSION_NUM      0x01040a00
87
++#define VMXNET3_DRIVER_VERSION_NUM      0x01040c00
88
+ 
89
+ #if defined(CONFIG_PCI_MSI)
90
+ 	/* RSS only makes sense if MSI-X is supported. */
91
+-- 
92
+cgit v1.1
93
+
0 94
new file mode 100644
... ...
@@ -0,0 +1,70 @@
0
+From 034f405793897a3c8f642935f5494b86c340cde7 Mon Sep 17 00:00:00 2001
1
+From: Ronak Doshi <doshir@vmware.com>
2
+Date: Fri, 16 Mar 2018 14:49:19 -0700
3
+Subject: vmxnet3: use correct flag to indicate LRO feature
4
+
5
+'Commit 45dac1d6ea04 ("vmxnet3: Changes for vmxnet3 adapter version 2
6
+(fwd)")' introduced a flag "lro" in structure vmxnet3_adapter which is
7
+used to indicate whether LRO is enabled or not. However, the patch
8
+did not set the flag and hence it was never exercised.
9
+
10
+So, when LRO is enabled, it resulted in poor TCP performance due to
11
+delayed acks. This issue is seen with packets which are larger than
12
+the mss getting a delayed ack rather than an immediate ack, thus
13
+resulting in high latency.
14
+
15
+This patch removes the lro flag and directly uses device features
16
+against NETIF_F_LRO to check if lro is enabled.
17
+
18
+Fixes: 45dac1d6ea04 ("vmxnet3: Changes for vmxnet3 adapter version 2 (fwd)")
19
+Reported-by: Rachel Lunnon <rachel_lunnon@stormagic.com>
20
+Signed-off-by: Ronak Doshi <doshir@vmware.com>
21
+Acked-by: Shrikrishna Khare <skhare@vmware.com>
22
+Signed-off-by: David S. Miller <davem@davemloft.net>
23
+---
24
+ drivers/net/vmxnet3/vmxnet3_drv.c | 3 ++-
25
+ drivers/net/vmxnet3/vmxnet3_int.h | 5 ++---
26
+ 2 files changed, 4 insertions(+), 4 deletions(-)
27
+
28
+diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
29
+index b466a42..e04937f 100644
30
+--- a/drivers/net/vmxnet3/vmxnet3_drv.c
31
+@@ -1473,7 +1473,8 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
32
+ 			vmxnet3_rx_csum(adapter, skb,
33
+ 					(union Vmxnet3_GenericDesc *)rcd);
34
+ 			skb->protocol = eth_type_trans(skb, adapter->netdev);
35
+-			if (!rcd->tcp || !adapter->lro)
36
++			if (!rcd->tcp ||
37
++			    !(adapter->netdev->features & NETIF_F_LRO))
38
+ 				goto not_lro;
39
+ 
40
+ 			if (segCnt != 0 && mss != 0) {
41
+diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
42
+index b94fdfd..99387a4 100644
43
+--- a/drivers/net/vmxnet3/vmxnet3_int.h
44
+@@ -69,10 +69,10 @@
45
+ /*
46
+  * Version numbers
47
+  */
48
+-#define VMXNET3_DRIVER_VERSION_STRING   "1.4.c.0-k"
49
++#define VMXNET3_DRIVER_VERSION_STRING   "1.4.d.0-k"
50
+ 
51
+ /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
52
+-#define VMXNET3_DRIVER_VERSION_NUM      0x01040c00
53
++#define VMXNET3_DRIVER_VERSION_NUM      0x01040d00
54
+ 
55
+ #if defined(CONFIG_PCI_MSI)
56
+ 	/* RSS only makes sense if MSI-X is supported. */
57
+@@ -343,7 +343,6 @@ struct vmxnet3_adapter {
58
+ 	u8                              version;
59
+ 
60
+ 	bool				rxcsum;
61
+-	bool				lro;
62
+ 
63
+ #ifdef VMXNET3_RSS
64
+ 	struct UPT1_RSSConf		*rss_conf;
65
+-- 
66
+cgit v1.1
67
+
0 68
new file mode 100755
... ...
@@ -0,0 +1,18 @@
0
+#! /bin/sh
1
+
2
+specs="linux-api-headers/linux-api-headers.spec linux/linux.spec linux/linux-esx.spec linux/linux-secure.spec linux/linux-aws.spec"
3
+
4
+tarball_url=`curl -s https://www.kernel.org  | grep -Eo 'https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.[0-9]*.tar.xz'`
5
+tarball=$(basename $tarball_url)
6
+version=`echo $tarball | sed 's/linux-//; s/.tar.xz//'`
7
+echo latest linux version: $version
8
+test -f stage/SOURCES/$tarball && echo up to date && exit 0
9
+$(cd stage/SOURCES && wget $tarball_url)
10
+sha1=`sha1sum stage/SOURCES/$tarball | awk '{print $1}'`
11
+changelog_entry=$(echo "`date +"%a %b %d %Y"` `git config user.name` <`git config user.email`> $version-1")
12
+for spec in $specs; do
13
+	sed -i '/^Version:/ s/4.9.[0-9]*/'$version'/' SPECS/$spec
14
+	sed -i '/^Release:/ s/[0-9]*%/1%/' SPECS/$spec
15
+	sed -i '/^%define sha1 linux/ s/=[0-9a-f]*$/='$sha1'/' SPECS/$spec
16
+	sed -i '/^%changelog/a*   '"$changelog_entry"'\n-   Update to version '"$version"'' SPECS/$spec
17
+done
0 18
deleted file mode 100755
... ...
@@ -1,18 +0,0 @@
1
-#! /bin/sh
2
-
3
-specs="linux-api-headers/linux-api-headers.spec linux/linux.spec linux/linux-esx.spec linux/linux-secure.spec linux/linux-aws.spec"
4
-
5
-tarball_url=`curl -s https://www.kernel.org  | grep -Eo 'https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.[0-9]*.tar.xz'`
6
-tarball=$(basename $tarball_url)
7
-version=`echo $tarball | sed 's/linux-//; s/.tar.xz//'`
8
-echo latest linux version: $version
9
-test -f stage/SOURCES/$tarball && echo up to date && exit 0
10
-$(cd stage/SOURCES && wget $tarball_url)
11
-sha1=`sha1sum stage/SOURCES/$tarball | awk '{print $1}'`
12
-changelog_entry=$(echo "`date +"%a %b %d %Y"` `git config user.name` <`git config user.email`> $version-1")
13
-for spec in $specs; do
14
-	sed -i '/^Version:/ s/4.9.[0-9]*/'$version'/' SPECS/$spec
15
-	sed -i '/^Release:/ s/[0-9]*%/1%/' SPECS/$spec
16
-	sed -i '/^%define sha1 linux/ s/=[0-9a-f]*$/='$sha1'/' SPECS/$spec
17
-	sed -i '/^%changelog/a*   '"$changelog_entry"'\n-   Update to version '"$version"'' SPECS/$spec
18
-done