This updated version was contributed by Adrian Drzewiecki
<adriand@vmware.com>
Change-Id: I7060fcb7993bbb51499282b4e1efc26299745c89
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4600
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
| ... | ... |
@@ -2,7 +2,7 @@ |
| 2 | 2 |
Summary: Kernel |
| 3 | 3 |
Name: linux-esx |
| 4 | 4 |
Version: 4.9.74 |
| 5 |
-Release: 2%{?dist}
|
|
| 5 |
+Release: 3%{?dist}
|
|
| 6 | 6 |
License: GPLv2 |
| 7 | 7 |
URL: http://www.kernel.org/ |
| 8 | 8 |
Group: System Environment/Kernel |
| ... | ... |
@@ -23,7 +23,7 @@ Patch6: linux-4.9-sysctl-sched_weighted_cpuload_uses_rla.patch |
| 23 | 23 |
Patch7: linux-4.9-watchdog-Disable-watchdog-on-virtual-machines.patch |
| 24 | 24 |
Patch9: SUNRPC-Do-not-reuse-srcport-for-TIME_WAIT-socket.patch |
| 25 | 25 |
Patch10: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch |
| 26 |
-Patch11: net-9p-vsock.patch |
|
| 26 |
+Patch11: vsock-transport-for-9p.patch |
|
| 27 | 27 |
Patch12: x86-vmware-sta.patch |
| 28 | 28 |
# -esx |
| 29 | 29 |
Patch13: serial-8250-do-not-probe-U6-16550A-fifo-size.patch |
| ... | ... |
@@ -210,6 +210,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
|
| 210 | 210 |
/usr/src/linux-headers-%{uname_r}
|
| 211 | 211 |
|
| 212 | 212 |
%changelog |
| 213 |
+* Thu Jan 04 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.74-3 |
|
| 214 |
+- Update vsock transport for 9p with newer version. |
|
| 213 | 215 |
* Wed Jan 03 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.74-2 |
| 214 | 216 |
- Fix SMB3 mount regression. |
| 215 | 217 |
* Tue Jan 02 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.74-1 |
| ... | ... |
@@ -2,7 +2,7 @@ |
| 2 | 2 |
Summary: Kernel |
| 3 | 3 |
Name: linux-secure |
| 4 | 4 |
Version: 4.9.74 |
| 5 |
-Release: 2%{?kat_build:.%kat_build}%{?dist}
|
|
| 5 |
+Release: 3%{?kat_build:.%kat_build}%{?dist}
|
|
| 6 | 6 |
License: GPLv2 |
| 7 | 7 |
URL: http://www.kernel.org/ |
| 8 | 8 |
Group: System Environment/Kernel |
| ... | ... |
@@ -25,7 +25,7 @@ Patch6: linux-4.9-sysctl-sched_weighted_cpuload_uses_rla.patch |
| 25 | 25 |
Patch7: linux-4.9-watchdog-Disable-watchdog-on-virtual-machines.patch |
| 26 | 26 |
Patch9: SUNRPC-Do-not-reuse-srcport-for-TIME_WAIT-socket.patch |
| 27 | 27 |
Patch10: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch |
| 28 |
-Patch11: net-9p-vsock.patch |
|
| 28 |
+Patch11: vsock-transport-for-9p.patch |
|
| 29 | 29 |
Patch12: x86-vmware-sta.patch |
| 30 | 30 |
# secure |
| 31 | 31 |
Patch13: 0001-NOWRITEEXEC-and-PAX-features-MPROTECT-EMUTRAMP.patch |
| ... | ... |
@@ -296,6 +296,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
|
| 296 | 296 |
/usr/src/linux-headers-%{uname_r}
|
| 297 | 297 |
|
| 298 | 298 |
%changelog |
| 299 |
+* Thu Jan 04 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.74-3 |
|
| 300 |
+- Update vsock transport for 9p with newer version. |
|
| 299 | 301 |
* Wed Jan 03 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.74-2 |
| 300 | 302 |
- Fix SMB3 mount regression. |
| 301 | 303 |
* Tue Jan 02 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.74-1 |
| ... | ... |
@@ -2,7 +2,7 @@ |
| 2 | 2 |
Summary: Kernel |
| 3 | 3 |
Name: linux |
| 4 | 4 |
Version: 4.9.74 |
| 5 |
-Release: 2%{?kat_build:.%kat_build}%{?dist}
|
|
| 5 |
+Release: 3%{?kat_build:.%kat_build}%{?dist}
|
|
| 6 | 6 |
License: GPLv2 |
| 7 | 7 |
URL: http://www.kernel.org/ |
| 8 | 8 |
Group: System Environment/Kernel |
| ... | ... |
@@ -26,7 +26,7 @@ Patch6: linux-4.9-sysctl-sched_weighted_cpuload_uses_rla.patch |
| 26 | 26 |
Patch7: linux-4.9-watchdog-Disable-watchdog-on-virtual-machines.patch |
| 27 | 27 |
Patch9: SUNRPC-Do-not-reuse-srcport-for-TIME_WAIT-socket.patch |
| 28 | 28 |
Patch10: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch |
| 29 |
-Patch11: net-9p-vsock.patch |
|
| 29 |
+Patch11: vsock-transport-for-9p.patch |
|
| 30 | 30 |
Patch12: x86-vmware-sta.patch |
| 31 | 31 |
#HyperV patches |
| 32 | 32 |
Patch13: 0004-vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch |
| ... | ... |
@@ -324,6 +324,8 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
|
| 324 | 324 |
/usr/share/doc/* |
| 325 | 325 |
|
| 326 | 326 |
%changelog |
| 327 |
+* Thu Jan 04 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.74-3 |
|
| 328 |
+- Update vsock transport for 9p with newer version. |
|
| 327 | 329 |
* Wed Jan 03 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.74-2 |
| 328 | 330 |
- Fix SMB3 mount regression. |
| 329 | 331 |
* Tue Jan 02 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.74-1 |
| 330 | 332 |
deleted file mode 100644 |
| ... | ... |
@@ -1,117 +0,0 @@ |
| 1 |
-From 43b616d904088b830bdb42ed9c016ce5f239bc73 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Alexey Makhalov <amakhalov@vmware.com> |
|
| 3 |
-Date: Tue, 9 May 2017 12:37:20 -0700 |
|
| 4 |
-Subject: [PATCH] net 9p vsock support |
|
| 5 |
- |
|
| 6 |
- net/9p/trans_fd.c | 45 +++++++++++++++++++++++++++++++++++++-------- |
|
| 7 |
- 1 file changed, 37 insertions(+), 8 deletions(-) |
|
| 8 |
- |
|
| 9 |
-diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c |
|
| 10 |
-index 7bc2208b6cc4..4acfd8a7f52c 100644 |
|
| 11 |
-+++ b/net/9p/trans_fd.c |
|
| 12 |
-@@ -37,6 +37,8 @@ |
|
| 13 |
- #include <linux/un.h> |
|
| 14 |
- #include <linux/uaccess.h> |
|
| 15 |
- #include <linux/inet.h> |
|
| 16 |
-+#include <linux/vmw_vmci_defs.h> |
|
| 17 |
-+#include <uapi/linux/vm_sockets.h> |
|
| 18 |
- #include <linux/idr.h> |
|
| 19 |
- #include <linux/file.h> |
|
| 20 |
- #include <linux/parser.h> |
|
| 21 |
-@@ -64,6 +66,7 @@ struct p9_fd_opts {
|
|
| 22 |
- int wfd; |
|
| 23 |
- u16 port; |
|
| 24 |
- int privport; |
|
| 25 |
-+ int vsock; |
|
| 26 |
- }; |
|
| 27 |
- |
|
| 28 |
- /* |
|
| 29 |
-@@ -73,7 +76,7 @@ struct p9_fd_opts {
|
|
| 30 |
- |
|
| 31 |
- enum {
|
|
| 32 |
- /* Options that take integer arguments */ |
|
| 33 |
-- Opt_port, Opt_rfdno, Opt_wfdno, Opt_err, |
|
| 34 |
-+ Opt_port, Opt_rfdno, Opt_wfdno, Opt_err, Opt_vsock, |
|
| 35 |
- /* Options that take no arguments */ |
|
| 36 |
- Opt_privport, |
|
| 37 |
- }; |
|
| 38 |
-@@ -83,6 +86,7 @@ static const match_table_t tokens = {
|
|
| 39 |
- {Opt_rfdno, "rfdno=%u"},
|
|
| 40 |
- {Opt_wfdno, "wfdno=%u"},
|
|
| 41 |
- {Opt_privport, "privport"},
|
|
| 42 |
-+ {Opt_vsock, "vsock=%d"},
|
|
| 43 |
- {Opt_err, NULL},
|
|
| 44 |
- }; |
|
| 45 |
- |
|
| 46 |
-@@ -739,6 +743,7 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) |
|
| 47 |
- opts->rfd = ~0; |
|
| 48 |
- opts->wfd = ~0; |
|
| 49 |
- opts->privport = 0; |
|
| 50 |
-+ opts->vsock = 0; |
|
| 51 |
- |
|
| 52 |
- if (!params) |
|
| 53 |
- return 0; |
|
| 54 |
-@@ -778,6 +783,9 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) |
|
| 55 |
- case Opt_privport: |
|
| 56 |
- opts->privport = 1; |
|
| 57 |
- break; |
|
| 58 |
-+ case Opt_vsock: |
|
| 59 |
-+ opts->vsock = option; |
|
| 60 |
-+ break; |
|
| 61 |
- default: |
|
| 62 |
- continue; |
|
| 63 |
- } |
|
| 64 |
-@@ -942,11 +950,27 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args) |
|
| 65 |
- |
|
| 66 |
- csocket = NULL; |
|
| 67 |
- |
|
| 68 |
-- sin_server.sin_family = AF_INET; |
|
| 69 |
-- sin_server.sin_addr.s_addr = in_aton(addr); |
|
| 70 |
-- sin_server.sin_port = htons(opts.port); |
|
| 71 |
-- err = __sock_create(current->nsproxy->net_ns, PF_INET, |
|
| 72 |
-- SOCK_STREAM, IPPROTO_TCP, &csocket, 1); |
|
| 73 |
-+ if (opts.vsock == 0) {
|
|
| 74 |
-+ sin_server.sin_family = AF_INET; |
|
| 75 |
-+ sin_server.sin_addr.s_addr = in_aton(addr); |
|
| 76 |
-+ sin_server.sin_port = htons(opts.port); |
|
| 77 |
-+ err = __sock_create(current->nsproxy->net_ns, PF_INET, |
|
| 78 |
-+ SOCK_STREAM, IPPROTO_TCP, &csocket, 1); |
|
| 79 |
-+ } else {
|
|
| 80 |
-+ /* |
|
| 81 |
-+ * for vsock, addr is not used, but opts.vsock is the vsock address, |
|
| 82 |
-+ * where 2 means host (hypervisor), and other numbers mean the vmci id |
|
| 83 |
-+ * in the VMX file of this running VM |
|
| 84 |
-+ */ |
|
| 85 |
-+ struct sockaddr_vm *vsock_server = (struct sockaddr_vm*)&sin_server; |
|
| 86 |
-+ |
|
| 87 |
-+ memset(vsock_server, 0, sizeof(struct sockaddr_vm)); |
|
| 88 |
-+ vsock_server->svm_family = AF_VSOCK; |
|
| 89 |
-+ vsock_server->svm_port = opts.port; |
|
| 90 |
-+ vsock_server->svm_cid = opts.vsock; |
|
| 91 |
-+ err = __sock_create(current->nsproxy->net_ns, PF_VSOCK, |
|
| 92 |
-+ SOCK_STREAM, 0, &csocket, 1); |
|
| 93 |
-+ } |
|
| 94 |
- if (err) {
|
|
| 95 |
- pr_err("%s (%d): problem creating socket\n",
|
|
| 96 |
- __func__, task_pid_nr(current)); |
|
| 97 |
-@@ -967,8 +991,13 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args) |
|
| 98 |
- (struct sockaddr *)&sin_server, |
|
| 99 |
- sizeof(struct sockaddr_in), 0); |
|
| 100 |
- if (err < 0) {
|
|
| 101 |
-- pr_err("%s (%d): problem connecting socket to %s\n",
|
|
| 102 |
-- __func__, task_pid_nr(current), addr); |
|
| 103 |
-+ if (opts.vsock) {
|
|
| 104 |
-+ pr_err("%s (%d): problem connecting vmware vsock addr %d\n",
|
|
| 105 |
-+ __func__, task_pid_nr(current), opts.vsock); |
|
| 106 |
-+ } else {
|
|
| 107 |
-+ pr_err("%s (%d): problem connecting socket to %s\n",
|
|
| 108 |
-+ __func__, task_pid_nr(current), addr); |
|
| 109 |
-+ } |
|
| 110 |
- sock_release(csocket); |
|
| 111 |
- return err; |
|
| 112 |
- } |
|
| 113 |
-2.11.0 |
|
| 114 |
- |
| 115 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,125 @@ |
| 0 |
+From ae3d2a171fe2f091adf4d084962df7415a6845e8 Mon Sep 17 00:00:00 2001 |
|
| 1 |
+From: Alexey Makhalov <amakhalov@vmware.com> |
|
| 2 |
+Date: Fri, 22 Dec 2017 15:13:17 -0800 |
|
| 3 |
+Subject: [PATCH] vsock transport for 9p |
|
| 4 |
+ |
|
| 5 |
+This second and correct implementation of 9p support over vsock. |
|
| 6 |
+Second implementation addresses the issue, described in PR 2007859. |
|
| 7 |
+ |
|
| 8 |
+Author: Adrian Drzewiecki <adriand@vmware.com> |
|
| 9 |
+ |
|
| 10 |
+Here's a patch which adds a new transport type instead, following the |
|
| 11 |
+methods that are used for others. That is, instead of doing |
|
| 12 |
+ |
|
| 13 |
+$ mount -t9p -ovsock=1234 fubar /mnt |
|
| 14 |
+ |
|
| 15 |
+One would do: |
|
| 16 |
+ |
|
| 17 |
+$ mount -t9p -otrans=vsock 1234 /mnt |
|
| 18 |
+--- |
|
| 19 |
+ net/9p/trans_fd.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
| 20 |
+ 1 file changed, 68 insertions(+) |
|
| 21 |
+ |
|
| 22 |
+diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c |
|
| 23 |
+index 985046ae..322a6bc8 100644 |
|
| 24 |
+--- a/net/9p/trans_fd.c |
|
| 25 |
+@@ -37,6 +37,8 @@ |
|
| 26 |
+ #include <linux/un.h> |
|
| 27 |
+ #include <linux/uaccess.h> |
|
| 28 |
+ #include <linux/inet.h> |
|
| 29 |
++#include <linux/vmw_vmci_defs.h> |
|
| 30 |
++#include <uapi/linux/vm_sockets.h> |
|
| 31 |
+ #include <linux/idr.h> |
|
| 32 |
+ #include <linux/file.h> |
|
| 33 |
+ #include <linux/parser.h> |
|
| 34 |
+@@ -938,6 +940,59 @@ static int p9_bind_privport(struct socket *sock) |
|
| 35 |
+ return err; |
|
| 36 |
+ } |
|
| 37 |
+ |
|
| 38 |
++static int |
|
| 39 |
++p9_fd_create_vsock(struct p9_client *client, const char *addr, char *args) |
|
| 40 |
++{
|
|
| 41 |
++ int err; |
|
| 42 |
++ struct socket *csocket; |
|
| 43 |
++ struct sockaddr_vm vsock_server; |
|
| 44 |
++ struct p9_fd_opts opts; |
|
| 45 |
++ |
|
| 46 |
++ err = parse_opts(args, &opts); |
|
| 47 |
++ if (err < 0) |
|
| 48 |
++ return err; |
|
| 49 |
++ |
|
| 50 |
++ csocket = NULL; |
|
| 51 |
++ |
|
| 52 |
++ memset(&vsock_server, 0, sizeof(struct sockaddr_vm)); |
|
| 53 |
++ vsock_server.svm_family = AF_VSOCK; |
|
| 54 |
++ vsock_server.svm_port = opts.port; |
|
| 55 |
++ |
|
| 56 |
++ err = kstrtou32(addr, 0, &vsock_server.svm_cid); |
|
| 57 |
++ if (err < 0) |
|
| 58 |
++ return err; |
|
| 59 |
++ |
|
| 60 |
++ err = __sock_create(current->nsproxy->net_ns, PF_VSOCK, |
|
| 61 |
++ SOCK_STREAM, 0, &csocket, 1); |
|
| 62 |
++ if (err) {
|
|
| 63 |
++ pr_err("%s (%d): problem creating socket\n",
|
|
| 64 |
++ __func__, task_pid_nr(current)); |
|
| 65 |
++ return err; |
|
| 66 |
++ } |
|
| 67 |
++ |
|
| 68 |
++ /* XXX: applicable? */ |
|
| 69 |
++ if (opts.privport) {
|
|
| 70 |
++ err = p9_bind_privport(csocket); |
|
| 71 |
++ if (err < 0) {
|
|
| 72 |
++ pr_err("%s (%d): problem binding to privport\n",
|
|
| 73 |
++ __func__, task_pid_nr(current)); |
|
| 74 |
++ sock_release(csocket); |
|
| 75 |
++ return err; |
|
| 76 |
++ } |
|
| 77 |
++ } |
|
| 78 |
++ |
|
| 79 |
++ err = csocket->ops->connect(csocket, |
|
| 80 |
++ (struct sockaddr *)&vsock_server, |
|
| 81 |
++ sizeof(struct sockaddr_vm), 0); |
|
| 82 |
++ if (err < 0) {
|
|
| 83 |
++ pr_err("%s (%d): problem connecting vmware vsock addr %s\n",
|
|
| 84 |
++ __func__, task_pid_nr(current), addr); |
|
| 85 |
++ sock_release(csocket); |
|
| 86 |
++ return err; |
|
| 87 |
++ } |
|
| 88 |
++ |
|
| 89 |
++ return p9_socket_open(client, csocket); |
|
| 90 |
++} |
|
| 91 |
+ |
|
| 92 |
+ static int |
|
| 93 |
+ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args) |
|
| 94 |
+@@ -1053,6 +1108,18 @@ p9_fd_create(struct p9_client *client, const char *addr, char *args) |
|
| 95 |
+ return 0; |
|
| 96 |
+ } |
|
| 97 |
+ |
|
| 98 |
++static struct p9_trans_module p9_vsock_trans = {
|
|
| 99 |
++ .name = "vsock", |
|
| 100 |
++ .maxsize = MAX_SOCK_BUF, |
|
| 101 |
++ .def = 0, |
|
| 102 |
++ .create = p9_fd_create_vsock, |
|
| 103 |
++ .close = p9_fd_close, |
|
| 104 |
++ .request = p9_fd_request, |
|
| 105 |
++ .cancel = p9_fd_cancel, |
|
| 106 |
++ .cancelled = p9_fd_cancelled, |
|
| 107 |
++ .owner = THIS_MODULE, |
|
| 108 |
++}; |
|
| 109 |
++ |
|
| 110 |
+ static struct p9_trans_module p9_tcp_trans = {
|
|
| 111 |
+ .name = "tcp", |
|
| 112 |
+ .maxsize = MAX_SOCK_BUF, |
|
| 113 |
+@@ -1126,6 +1193,7 @@ static void p9_poll_workfn(struct work_struct *work) |
|
| 114 |
+ |
|
| 115 |
+ int p9_trans_fd_init(void) |
|
| 116 |
+ {
|
|
| 117 |
++ v9fs_register_trans(&p9_vsock_trans); |
|
| 118 |
+ v9fs_register_trans(&p9_tcp_trans); |
|
| 119 |
+ v9fs_register_trans(&p9_unix_trans); |
|
| 120 |
+ v9fs_register_trans(&p9_fd_trans); |
|
| 121 |
+-- |
|
| 122 |
+2.11.0 |
|
| 123 |
+ |