diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-15 17:50:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-15 17:50:51 -0400 |
commit | 8d1e5133bf260aabdf2cc6facd4a8e696414d16a (patch) | |
tree | 0e152a07b3892546879f55028b26b1701f7de8e6 | |
parent | 6a4d4b3253c1341843ba473429cf76a0e54f053d (diff) | |
parent | 5ec9121195a4f1cecd0fa592636c5f81eb03dc8c (diff) |
Merge branch 'for-linus-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
Pull uml updates from Richard Weinberger:
"Minor updates for UML:
- fixes for our new vector network driver by Anton
- initcall cleanup by Alexander
- We have a new mailinglist, sourceforge.net sucks"
* 'for-linus-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
um: Fix raw interface options
um: Fix initialization of vector queues
um: remove uml initcalls
um: Update mailing list address
-rw-r--r-- | MAINTAINERS | 3 | ||||
-rw-r--r-- | arch/um/drivers/vector_kern.c | 20 | ||||
-rw-r--r-- | arch/um/include/asm/common.lds.S | 6 | ||||
-rw-r--r-- | arch/um/include/shared/init.h | 5 | ||||
-rw-r--r-- | arch/um/os-Linux/main.c | 12 |
5 files changed, 15 insertions, 31 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 3b263e2e216a..a5f04264ad10 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -15015,8 +15015,7 @@ F: drivers/media/usb/zr364xx/ | |||
15015 | USER-MODE LINUX (UML) | 15015 | USER-MODE LINUX (UML) |
15016 | M: Jeff Dike <jdike@addtoit.com> | 15016 | M: Jeff Dike <jdike@addtoit.com> |
15017 | M: Richard Weinberger <richard@nod.at> | 15017 | M: Richard Weinberger <richard@nod.at> |
15018 | L: user-mode-linux-devel@lists.sourceforge.net | 15018 | L: linux-um@lists.infradead.org |
15019 | L: user-mode-linux-user@lists.sourceforge.net | ||
15020 | W: http://user-mode-linux.sourceforge.net | 15019 | W: http://user-mode-linux.sourceforge.net |
15021 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git | 15020 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git |
15022 | S: Maintained | 15021 | S: Maintained |
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 627075e6d875..50ee3bb5a63a 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c | |||
@@ -188,7 +188,7 @@ static int get_transport_options(struct arglist *def) | |||
188 | if (strncmp(transport, TRANS_TAP, TRANS_TAP_LEN) == 0) | 188 | if (strncmp(transport, TRANS_TAP, TRANS_TAP_LEN) == 0) |
189 | return (vec_rx | VECTOR_BPF); | 189 | return (vec_rx | VECTOR_BPF); |
190 | if (strncmp(transport, TRANS_RAW, TRANS_RAW_LEN) == 0) | 190 | if (strncmp(transport, TRANS_RAW, TRANS_RAW_LEN) == 0) |
191 | return (vec_rx | vec_tx); | 191 | return (vec_rx | vec_tx | VECTOR_QDISC_BYPASS); |
192 | return (vec_rx | vec_tx); | 192 | return (vec_rx | vec_tx); |
193 | } | 193 | } |
194 | 194 | ||
@@ -504,15 +504,19 @@ static struct vector_queue *create_queue( | |||
504 | 504 | ||
505 | result = kmalloc(sizeof(struct vector_queue), GFP_KERNEL); | 505 | result = kmalloc(sizeof(struct vector_queue), GFP_KERNEL); |
506 | if (result == NULL) | 506 | if (result == NULL) |
507 | goto out_fail; | 507 | return NULL; |
508 | result->max_depth = max_size; | 508 | result->max_depth = max_size; |
509 | result->dev = vp->dev; | 509 | result->dev = vp->dev; |
510 | result->mmsg_vector = kmalloc( | 510 | result->mmsg_vector = kmalloc( |
511 | (sizeof(struct mmsghdr) * max_size), GFP_KERNEL); | 511 | (sizeof(struct mmsghdr) * max_size), GFP_KERNEL); |
512 | if (result->mmsg_vector == NULL) | ||
513 | goto out_mmsg_fail; | ||
512 | result->skbuff_vector = kmalloc( | 514 | result->skbuff_vector = kmalloc( |
513 | (sizeof(void *) * max_size), GFP_KERNEL); | 515 | (sizeof(void *) * max_size), GFP_KERNEL); |
514 | if (result->mmsg_vector == NULL || result->skbuff_vector == NULL) | 516 | if (result->skbuff_vector == NULL) |
515 | goto out_fail; | 517 | goto out_skb_fail; |
518 | |||
519 | /* further failures can be handled safely by destroy_queue*/ | ||
516 | 520 | ||
517 | mmsg_vector = result->mmsg_vector; | 521 | mmsg_vector = result->mmsg_vector; |
518 | for (i = 0; i < max_size; i++) { | 522 | for (i = 0; i < max_size; i++) { |
@@ -563,6 +567,11 @@ static struct vector_queue *create_queue( | |||
563 | result->head = 0; | 567 | result->head = 0; |
564 | result->tail = 0; | 568 | result->tail = 0; |
565 | return result; | 569 | return result; |
570 | out_skb_fail: | ||
571 | kfree(result->mmsg_vector); | ||
572 | out_mmsg_fail: | ||
573 | kfree(result); | ||
574 | return NULL; | ||
566 | out_fail: | 575 | out_fail: |
567 | destroy_queue(result); | 576 | destroy_queue(result); |
568 | return NULL; | 577 | return NULL; |
@@ -1232,9 +1241,8 @@ static int vector_net_open(struct net_device *dev) | |||
1232 | 1241 | ||
1233 | if ((vp->options & VECTOR_QDISC_BYPASS) != 0) { | 1242 | if ((vp->options & VECTOR_QDISC_BYPASS) != 0) { |
1234 | if (!uml_raw_enable_qdisc_bypass(vp->fds->rx_fd)) | 1243 | if (!uml_raw_enable_qdisc_bypass(vp->fds->rx_fd)) |
1235 | vp->options = vp->options | VECTOR_BPF; | 1244 | vp->options |= VECTOR_BPF; |
1236 | } | 1245 | } |
1237 | |||
1238 | if ((vp->options & VECTOR_BPF) != 0) | 1246 | if ((vp->options & VECTOR_BPF) != 0) |
1239 | vp->bpf = uml_vector_default_bpf(vp->fds->rx_fd, dev->dev_addr); | 1247 | vp->bpf = uml_vector_default_bpf(vp->fds->rx_fd, dev->dev_addr); |
1240 | 1248 | ||
diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S index b30d73ca29d0..7adb4e6b658a 100644 --- a/arch/um/include/asm/common.lds.S +++ b/arch/um/include/asm/common.lds.S | |||
@@ -53,12 +53,6 @@ | |||
53 | CON_INITCALL | 53 | CON_INITCALL |
54 | } | 54 | } |
55 | 55 | ||
56 | .uml.initcall.init : { | ||
57 | __uml_initcall_start = .; | ||
58 | *(.uml.initcall.init) | ||
59 | __uml_initcall_end = .; | ||
60 | } | ||
61 | |||
62 | SECURITY_INIT | 56 | SECURITY_INIT |
63 | 57 | ||
64 | .exitcall : { | 58 | .exitcall : { |
diff --git a/arch/um/include/shared/init.h b/arch/um/include/shared/init.h index b3f5865a92c9..c66de434a983 100644 --- a/arch/um/include/shared/init.h +++ b/arch/um/include/shared/init.h | |||
@@ -64,14 +64,10 @@ struct uml_param { | |||
64 | int (*setup_func)(char *, int *); | 64 | int (*setup_func)(char *, int *); |
65 | }; | 65 | }; |
66 | 66 | ||
67 | extern initcall_t __uml_initcall_start, __uml_initcall_end; | ||
68 | extern initcall_t __uml_postsetup_start, __uml_postsetup_end; | 67 | extern initcall_t __uml_postsetup_start, __uml_postsetup_end; |
69 | extern const char *__uml_help_start, *__uml_help_end; | 68 | extern const char *__uml_help_start, *__uml_help_end; |
70 | #endif | 69 | #endif |
71 | 70 | ||
72 | #define __uml_initcall(fn) \ | ||
73 | static initcall_t __uml_initcall_##fn __uml_init_call = fn | ||
74 | |||
75 | #define __uml_exitcall(fn) \ | 71 | #define __uml_exitcall(fn) \ |
76 | static exitcall_t __uml_exitcall_##fn __uml_exit_call = fn | 72 | static exitcall_t __uml_exitcall_##fn __uml_exit_call = fn |
77 | 73 | ||
@@ -108,7 +104,6 @@ extern struct uml_param __uml_setup_start, __uml_setup_end; | |||
108 | */ | 104 | */ |
109 | #define __uml_init_setup __used __section(.uml.setup.init) | 105 | #define __uml_init_setup __used __section(.uml.setup.init) |
110 | #define __uml_setup_help __used __section(.uml.help.init) | 106 | #define __uml_setup_help __used __section(.uml.help.init) |
111 | #define __uml_init_call __used __section(.uml.initcall.init) | ||
112 | #define __uml_postsetup_call __used __section(.uml.postsetup.init) | 107 | #define __uml_postsetup_call __used __section(.uml.postsetup.init) |
113 | #define __uml_exit_call __used __section(.uml.exitcall.exit) | 108 | #define __uml_exit_call __used __section(.uml.exitcall.exit) |
114 | 109 | ||
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 5f970ece5ac3..f1fee2b91239 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c | |||
@@ -40,17 +40,6 @@ static void set_stklim(void) | |||
40 | } | 40 | } |
41 | } | 41 | } |
42 | 42 | ||
43 | static __init void do_uml_initcalls(void) | ||
44 | { | ||
45 | initcall_t *call; | ||
46 | |||
47 | call = &__uml_initcall_start; | ||
48 | while (call < &__uml_initcall_end) { | ||
49 | (*call)(); | ||
50 | call++; | ||
51 | } | ||
52 | } | ||
53 | |||
54 | static void last_ditch_exit(int sig) | 43 | static void last_ditch_exit(int sig) |
55 | { | 44 | { |
56 | uml_cleanup(); | 45 | uml_cleanup(); |
@@ -151,7 +140,6 @@ int __init main(int argc, char **argv, char **envp) | |||
151 | scan_elf_aux(envp); | 140 | scan_elf_aux(envp); |
152 | #endif | 141 | #endif |
153 | 142 | ||
154 | do_uml_initcalls(); | ||
155 | change_sig(SIGPIPE, 0); | 143 | change_sig(SIGPIPE, 0); |
156 | ret = linux_main(argc, argv); | 144 | ret = linux_main(argc, argv); |
157 | 145 | ||