diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-13 13:20:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-13 13:20:02 -0400 |
commit | ec059019b7e6ae3926a8e1dec02a62d64dd8c060 (patch) | |
tree | ab60e0f2d21154dda05f58af310a66c94179d70a | |
parent | 1251704a631b62591ad1d1b6ead252e9e597d5f5 (diff) | |
parent | ce4586063f1af780b1c6b7e344907e6f9c1ba59a (diff) |
Merge branch 'for-linus-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
Pull UML fixes from Richard Weinberger:
"No new stuff, just fixes"
* 'for-linus-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
um: Add missing NR_CPUS include
um: Fix to call read_initrd after init_bootmem
um: Include kbuild.h instead of duplicating its macros
um: Fix PTRACE_POKEUSER on x86_64
um: Set number of CPUs
um: Fix _print_addr()
-rw-r--r-- | arch/um/Kconfig.common | 5 | ||||
-rw-r--r-- | arch/um/kernel/initrd.c | 4 | ||||
-rw-r--r-- | arch/um/kernel/sysrq.c | 6 | ||||
-rw-r--r-- | arch/um/kernel/um_arch.c | 6 | ||||
-rw-r--r-- | arch/um/os-Linux/skas/process.c | 4 | ||||
-rw-r--r-- | arch/x86/um/ptrace_64.c | 2 | ||||
-rw-r--r-- | arch/x86/um/shared/sysdep/kernel-offsets.h | 9 |
7 files changed, 17 insertions, 19 deletions
diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common index ed9c5b5ff028..85f6dd204ab6 100644 --- a/arch/um/Kconfig.common +++ b/arch/um/Kconfig.common | |||
@@ -57,3 +57,8 @@ config HZ | |||
57 | config SUBARCH | 57 | config SUBARCH |
58 | string | 58 | string |
59 | option env="SUBARCH" | 59 | option env="SUBARCH" |
60 | |||
61 | config NR_CPUS | ||
62 | int | ||
63 | range 1 1 | ||
64 | default 1 | ||
diff --git a/arch/um/kernel/initrd.c b/arch/um/kernel/initrd.c index 48bae81f8dca..6f6e7896e53f 100644 --- a/arch/um/kernel/initrd.c +++ b/arch/um/kernel/initrd.c | |||
@@ -14,7 +14,7 @@ | |||
14 | static char *initrd __initdata = NULL; | 14 | static char *initrd __initdata = NULL; |
15 | static int load_initrd(char *filename, void *buf, int size); | 15 | static int load_initrd(char *filename, void *buf, int size); |
16 | 16 | ||
17 | static int __init read_initrd(void) | 17 | int __init read_initrd(void) |
18 | { | 18 | { |
19 | void *area; | 19 | void *area; |
20 | long long size; | 20 | long long size; |
@@ -46,8 +46,6 @@ static int __init read_initrd(void) | |||
46 | return 0; | 46 | return 0; |
47 | } | 47 | } |
48 | 48 | ||
49 | __uml_postsetup(read_initrd); | ||
50 | |||
51 | static int __init uml_initrd_setup(char *line, int *add) | 49 | static int __init uml_initrd_setup(char *line, int *add) |
52 | { | 50 | { |
53 | initrd = line; | 51 | initrd = line; |
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c index a76295f7ede9..6b995e870d55 100644 --- a/arch/um/kernel/sysrq.c +++ b/arch/um/kernel/sysrq.c | |||
@@ -20,10 +20,8 @@ | |||
20 | 20 | ||
21 | static void _print_addr(void *data, unsigned long address, int reliable) | 21 | static void _print_addr(void *data, unsigned long address, int reliable) |
22 | { | 22 | { |
23 | pr_info(" [<%08lx>]", address); | 23 | pr_info(" [<%08lx>] %s%pF\n", address, reliable ? "" : "? ", |
24 | pr_cont(" %s", reliable ? "" : "? "); | 24 | (void *)address); |
25 | print_symbol("%s", address); | ||
26 | pr_cont("\n"); | ||
27 | } | 25 | } |
28 | 26 | ||
29 | static const struct stacktrace_ops stackops = { | 27 | static const struct stacktrace_ops stackops = { |
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 4b85acd4020c..64a1fd06f3fd 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c | |||
@@ -338,11 +338,17 @@ int __init linux_main(int argc, char **argv) | |||
338 | return start_uml(); | 338 | return start_uml(); |
339 | } | 339 | } |
340 | 340 | ||
341 | int __init __weak read_initrd(void) | ||
342 | { | ||
343 | return 0; | ||
344 | } | ||
345 | |||
341 | void __init setup_arch(char **cmdline_p) | 346 | void __init setup_arch(char **cmdline_p) |
342 | { | 347 | { |
343 | stack_protections((unsigned long) &init_thread_info); | 348 | stack_protections((unsigned long) &init_thread_info); |
344 | setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem); | 349 | setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem); |
345 | mem_total_pages(physmem_size, iomem_size, highmem); | 350 | mem_total_pages(physmem_size, iomem_size, highmem); |
351 | read_initrd(); | ||
346 | 352 | ||
347 | paging_init(); | 353 | paging_init(); |
348 | strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); | 354 | strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); |
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 23025d645160..03b3c4cc7735 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <registers.h> | 21 | #include <registers.h> |
22 | #include <skas.h> | 22 | #include <skas.h> |
23 | #include <sysdep/stub.h> | 23 | #include <sysdep/stub.h> |
24 | #include <linux/threads.h> | ||
24 | 25 | ||
25 | int is_skas_winch(int pid, int fd, void *data) | 26 | int is_skas_winch(int pid, int fd, void *data) |
26 | { | 27 | { |
@@ -233,9 +234,6 @@ static int userspace_tramp(void *stack) | |||
233 | return 0; | 234 | return 0; |
234 | } | 235 | } |
235 | 236 | ||
236 | /* Each element set once, and only accessed by a single processor anyway */ | ||
237 | #undef NR_CPUS | ||
238 | #define NR_CPUS 1 | ||
239 | int userspace_pid[NR_CPUS]; | 237 | int userspace_pid[NR_CPUS]; |
240 | 238 | ||
241 | int start_userspace(unsigned long stub_stack) | 239 | int start_userspace(unsigned long stub_stack) |
diff --git a/arch/x86/um/ptrace_64.c b/arch/x86/um/ptrace_64.c index a5c9910d234f..09a085bde0d4 100644 --- a/arch/x86/um/ptrace_64.c +++ b/arch/x86/um/ptrace_64.c | |||
@@ -125,7 +125,7 @@ int poke_user(struct task_struct *child, long addr, long data) | |||
125 | else if ((addr >= offsetof(struct user, u_debugreg[0])) && | 125 | else if ((addr >= offsetof(struct user, u_debugreg[0])) && |
126 | (addr <= offsetof(struct user, u_debugreg[7]))) { | 126 | (addr <= offsetof(struct user, u_debugreg[7]))) { |
127 | addr -= offsetof(struct user, u_debugreg[0]); | 127 | addr -= offsetof(struct user, u_debugreg[0]); |
128 | addr = addr >> 2; | 128 | addr = addr >> 3; |
129 | if ((addr == 4) || (addr == 5)) | 129 | if ((addr == 4) || (addr == 5)) |
130 | return -EIO; | 130 | return -EIO; |
131 | child->thread.arch.debugregs[addr] = data; | 131 | child->thread.arch.debugregs[addr] = data; |
diff --git a/arch/x86/um/shared/sysdep/kernel-offsets.h b/arch/x86/um/shared/sysdep/kernel-offsets.h index 46a9df99f3c5..7e1d35b6ad5c 100644 --- a/arch/x86/um/shared/sysdep/kernel-offsets.h +++ b/arch/x86/um/shared/sysdep/kernel-offsets.h | |||
@@ -2,16 +2,9 @@ | |||
2 | #include <linux/sched.h> | 2 | #include <linux/sched.h> |
3 | #include <linux/elf.h> | 3 | #include <linux/elf.h> |
4 | #include <linux/crypto.h> | 4 | #include <linux/crypto.h> |
5 | #include <linux/kbuild.h> | ||
5 | #include <asm/mman.h> | 6 | #include <asm/mman.h> |
6 | 7 | ||
7 | #define DEFINE(sym, val) \ | ||
8 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | ||
9 | |||
10 | #define BLANK() asm volatile("\n->" : : ) | ||
11 | |||
12 | #define OFFSET(sym, str, mem) \ | ||
13 | DEFINE(sym, offsetof(struct str, mem)); | ||
14 | |||
15 | void foo(void) | 8 | void foo(void) |
16 | { | 9 | { |
17 | #include <common-offsets.h> | 10 | #include <common-offsets.h> |