aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/Kconfig.common5
-rw-r--r--arch/um/include/asm/irqflags.h18
-rw-r--r--arch/um/kernel/Makefile5
-rw-r--r--arch/um/kernel/initrd.c2
-rw-r--r--arch/um/kernel/um_arch.c8
-rw-r--r--arch/um/os-Linux/Makefile3
-rw-r--r--arch/um/os-Linux/signal.c5
7 files changed, 25 insertions, 21 deletions
diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index 58650d098fb4..fd443852103c 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -1,10 +1,12 @@
1config UML 1config UML
2 bool 2 bool
3 default y 3 default y
4 select ARCH_HAS_KCOV
4 select HAVE_ARCH_AUDITSYSCALL 5 select HAVE_ARCH_AUDITSYSCALL
5 select HAVE_ARCH_SECCOMP_FILTER 6 select HAVE_ARCH_SECCOMP_FILTER
6 select HAVE_UID16 7 select HAVE_UID16
7 select HAVE_FUTEX_CMPXCHG if FUTEX 8 select HAVE_FUTEX_CMPXCHG if FUTEX
9 select HAVE_DEBUG_KMEMLEAK
8 select GENERIC_IRQ_SHOW 10 select GENERIC_IRQ_SHOW
9 select GENERIC_CPU_DEVICES 11 select GENERIC_CPU_DEVICES
10 select GENERIC_IO 12 select GENERIC_IO
@@ -31,10 +33,9 @@ config PCI
31config PCMCIA 33config PCMCIA
32 bool 34 bool
33 35
34# Yet to do!
35config TRACE_IRQFLAGS_SUPPORT 36config TRACE_IRQFLAGS_SUPPORT
36 bool 37 bool
37 default n 38 default y
38 39
39config LOCKDEP_SUPPORT 40config LOCKDEP_SUPPORT
40 bool 41 bool
diff --git a/arch/um/include/asm/irqflags.h b/arch/um/include/asm/irqflags.h
index c780d8a16773..3bb221e1d5a4 100644
--- a/arch/um/include/asm/irqflags.h
+++ b/arch/um/include/asm/irqflags.h
@@ -6,37 +6,33 @@ extern int set_signals(int enable);
6extern void block_signals(void); 6extern void block_signals(void);
7extern void unblock_signals(void); 7extern void unblock_signals(void);
8 8
9#define arch_local_save_flags arch_local_save_flags
9static inline unsigned long arch_local_save_flags(void) 10static inline unsigned long arch_local_save_flags(void)
10{ 11{
11 return get_signals(); 12 return get_signals();
12} 13}
13 14
15#define arch_local_irq_restore arch_local_irq_restore
14static inline void arch_local_irq_restore(unsigned long flags) 16static inline void arch_local_irq_restore(unsigned long flags)
15{ 17{
16 set_signals(flags); 18 set_signals(flags);
17} 19}
18 20
21#define arch_local_irq_enable arch_local_irq_enable
19static inline void arch_local_irq_enable(void) 22static inline void arch_local_irq_enable(void)
20{ 23{
21 unblock_signals(); 24 unblock_signals();
22} 25}
23 26
27#define arch_local_irq_disable arch_local_irq_disable
24static inline void arch_local_irq_disable(void) 28static inline void arch_local_irq_disable(void)
25{ 29{
26 block_signals(); 30 block_signals();
27} 31}
28 32
29static inline unsigned long arch_local_irq_save(void) 33#define ARCH_IRQ_DISABLED 0
30{ 34#define ARCh_IRQ_ENABLED (SIGIO|SIGVTALRM)
31 unsigned long flags;
32 flags = arch_local_save_flags();
33 arch_local_irq_disable();
34 return flags;
35}
36 35
37static inline bool arch_irqs_disabled(void) 36#include <asm-generic/irqflags.h>
38{
39 return arch_local_save_flags() == 0;
40}
41 37
42#endif 38#endif
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index a6a5e42caaef..2f36d515762e 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -3,6 +3,11 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6# Don't instrument UML-specific code; without this, we may crash when
7# accessing the instrumentation buffer for the first time from the
8# kernel.
9KCOV_INSTRUMENT := n
10
6CPPFLAGS_vmlinux.lds := -DSTART=$(LDS_START) \ 11CPPFLAGS_vmlinux.lds := -DSTART=$(LDS_START) \
7 -DELF_ARCH=$(LDS_ELF_ARCH) \ 12 -DELF_ARCH=$(LDS_ELF_ARCH) \
8 -DELF_FORMAT=$(LDS_ELF_FORMAT) \ 13 -DELF_FORMAT=$(LDS_ELF_FORMAT) \
diff --git a/arch/um/kernel/initrd.c b/arch/um/kernel/initrd.c
index 55cead809b18..48bae81f8dca 100644
--- a/arch/um/kernel/initrd.c
+++ b/arch/um/kernel/initrd.c
@@ -37,8 +37,6 @@ static int __init read_initrd(void)
37 } 37 }
38 38
39 area = alloc_bootmem(size); 39 area = alloc_bootmem(size);
40 if (area == NULL)
41 return 0;
42 40
43 if (load_initrd(initrd, area, size) == -1) 41 if (load_initrd(initrd, area, size) == -1)
44 return 0; 42 return 0;
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 16630e75f056..e8175a8aa22c 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -319,9 +319,6 @@ int __init linux_main(int argc, char **argv)
319 319
320 start_vm = VMALLOC_START; 320 start_vm = VMALLOC_START;
321 321
322 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
323 mem_total_pages(physmem_size, iomem_size, highmem);
324
325 virtmem_size = physmem_size; 322 virtmem_size = physmem_size;
326 stack = (unsigned long) argv; 323 stack = (unsigned long) argv;
327 stack &= ~(1024 * 1024 - 1); 324 stack &= ~(1024 * 1024 - 1);
@@ -334,7 +331,6 @@ int __init linux_main(int argc, char **argv)
334 printf("Kernel virtual memory size shrunk to %lu bytes\n", 331 printf("Kernel virtual memory size shrunk to %lu bytes\n",
335 virtmem_size); 332 virtmem_size);
336 333
337 stack_protections((unsigned long) &init_thread_info);
338 os_flush_stdout(); 334 os_flush_stdout();
339 335
340 return start_uml(); 336 return start_uml();
@@ -342,6 +338,10 @@ int __init linux_main(int argc, char **argv)
342 338
343void __init setup_arch(char **cmdline_p) 339void __init setup_arch(char **cmdline_p)
344{ 340{
341 stack_protections((unsigned long) &init_thread_info);
342 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
343 mem_total_pages(physmem_size, iomem_size, highmem);
344
345 paging_init(); 345 paging_init();
346 strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); 346 strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
347 *cmdline_p = command_line; 347 *cmdline_p = command_line;
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile
index 08ff5094fcdd..ada473bf6f46 100644
--- a/arch/um/os-Linux/Makefile
+++ b/arch/um/os-Linux/Makefile
@@ -3,6 +3,9 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6# Don't instrument UML-specific code
7KCOV_INSTRUMENT := n
8
6obj-y = aio.o execvp.o file.o helper.o irq.o main.o mem.o process.o \ 9obj-y = aio.o execvp.o file.o helper.o irq.o main.o mem.o process.o \
7 registers.o sigio.o signal.o start_up.o time.o tty.o \ 10 registers.o sigio.o signal.o start_up.o time.o tty.o \
8 umid.o user_syms.o util.o drivers/ skas/ 11 umid.o user_syms.o util.o drivers/ skas/
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index 8acaf4e384c0..a86d7cc2c2d8 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -15,6 +15,7 @@
15#include <kern_util.h> 15#include <kern_util.h>
16#include <os.h> 16#include <os.h>
17#include <sysdep/mcontext.h> 17#include <sysdep/mcontext.h>
18#include <um_malloc.h>
18 19
19void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = { 20void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
20 [SIGTRAP] = relay_signal, 21 [SIGTRAP] = relay_signal,
@@ -32,7 +33,7 @@ static void sig_handler_common(int sig, struct siginfo *si, mcontext_t *mc)
32 struct uml_pt_regs *r; 33 struct uml_pt_regs *r;
33 int save_errno = errno; 34 int save_errno = errno;
34 35
35 r = malloc(sizeof(struct uml_pt_regs)); 36 r = uml_kmalloc(sizeof(struct uml_pt_regs), UM_GFP_ATOMIC);
36 if (!r) 37 if (!r)
37 panic("out of memory"); 38 panic("out of memory");
38 39
@@ -91,7 +92,7 @@ static void timer_real_alarm_handler(mcontext_t *mc)
91{ 92{
92 struct uml_pt_regs *regs; 93 struct uml_pt_regs *regs;
93 94
94 regs = malloc(sizeof(struct uml_pt_regs)); 95 regs = uml_kmalloc(sizeof(struct uml_pt_regs), UM_GFP_ATOMIC);
95 if (!regs) 96 if (!regs)
96 panic("out of memory"); 97 panic("out of memory");
97 98