Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml

Pull UML updates from Richard Weinberger:
"Beside of various fixes this also contains patches to enable features
such was Kcov, kmemleak and TRACE_IRQFLAGS_SUPPORT on UML"

* 'for-linus-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
hostfs: Freeing an ERR_PTR in hostfs_fill_sb_common()
um: Support kcov
um: Enable TRACE_IRQFLAGS_SUPPORT
um: Use asm-generic/irqflags.h
um: Fix possible deadlock in sig_handler_common()
um: Select HAVE_DEBUG_KMEMLEAK
um: Setup physical memory in setup_arch()
um: Eliminate null test after alloc_bootmem

+32 -24
+3 -2
arch/um/Kconfig.common
··· 1 1 config UML 2 2 bool 3 3 default y 4 + select ARCH_HAS_KCOV 4 5 select HAVE_ARCH_AUDITSYSCALL 5 6 select HAVE_ARCH_SECCOMP_FILTER 6 7 select HAVE_UID16 7 8 select HAVE_FUTEX_CMPXCHG if FUTEX 9 + select HAVE_DEBUG_KMEMLEAK 8 10 select GENERIC_IRQ_SHOW 9 11 select GENERIC_CPU_DEVICES 10 12 select GENERIC_IO ··· 33 31 config PCMCIA 34 32 bool 35 33 36 - # Yet to do! 37 34 config TRACE_IRQFLAGS_SUPPORT 38 35 bool 39 - default n 36 + default y 40 37 41 38 config LOCKDEP_SUPPORT 42 39 bool
+7 -11
arch/um/include/asm/irqflags.h
··· 6 6 extern void block_signals(void); 7 7 extern void unblock_signals(void); 8 8 9 + #define arch_local_save_flags arch_local_save_flags 9 10 static inline unsigned long arch_local_save_flags(void) 10 11 { 11 12 return get_signals(); 12 13 } 13 14 15 + #define arch_local_irq_restore arch_local_irq_restore 14 16 static inline void arch_local_irq_restore(unsigned long flags) 15 17 { 16 18 set_signals(flags); 17 19 } 18 20 21 + #define arch_local_irq_enable arch_local_irq_enable 19 22 static inline void arch_local_irq_enable(void) 20 23 { 21 24 unblock_signals(); 22 25 } 23 26 27 + #define arch_local_irq_disable arch_local_irq_disable 24 28 static inline void arch_local_irq_disable(void) 25 29 { 26 30 block_signals(); 27 31 } 28 32 29 - static inline unsigned long arch_local_irq_save(void) 30 - { 31 - unsigned long flags; 32 - flags = arch_local_save_flags(); 33 - arch_local_irq_disable(); 34 - return flags; 35 - } 33 + #define ARCH_IRQ_DISABLED 0 34 + #define ARCh_IRQ_ENABLED (SIGIO|SIGVTALRM) 36 35 37 - static inline bool arch_irqs_disabled(void) 38 - { 39 - return arch_local_save_flags() == 0; 40 - } 36 + #include <asm-generic/irqflags.h> 41 37 42 38 #endif
+5
arch/um/kernel/Makefile
··· 3 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. 9 + KCOV_INSTRUMENT := n 10 + 6 11 CPPFLAGS_vmlinux.lds := -DSTART=$(LDS_START) \ 7 12 -DELF_ARCH=$(LDS_ELF_ARCH) \ 8 13 -DELF_FORMAT=$(LDS_ELF_FORMAT) \
-2
arch/um/kernel/initrd.c
··· 37 37 } 38 38 39 39 area = alloc_bootmem(size); 40 - if (area == NULL) 41 - return 0; 42 40 43 41 if (load_initrd(initrd, area, size) == -1) 44 42 return 0;
+4 -4
arch/um/kernel/um_arch.c
··· 319 319 320 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 322 virtmem_size = physmem_size; 326 323 stack = (unsigned long) argv; 327 324 stack &= ~(1024 * 1024 - 1); ··· 331 334 printf("Kernel virtual memory size shrunk to %lu bytes\n", 332 335 virtmem_size); 333 336 334 - stack_protections((unsigned long) &init_thread_info); 335 337 os_flush_stdout(); 336 338 337 339 return start_uml(); ··· 338 342 339 343 void __init setup_arch(char **cmdline_p) 340 344 { 345 + stack_protections((unsigned long) &init_thread_info); 346 + setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem); 347 + mem_total_pages(physmem_size, iomem_size, highmem); 348 + 341 349 paging_init(); 342 350 strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); 343 351 *cmdline_p = command_line;
+3
arch/um/os-Linux/Makefile
··· 3 3 # Licensed under the GPL 4 4 # 5 5 6 + # Don't instrument UML-specific code 7 + KCOV_INSTRUMENT := n 8 + 6 9 obj-y = aio.o execvp.o file.o helper.o irq.o main.o mem.o process.o \ 7 10 registers.o sigio.o signal.o start_up.o time.o tty.o \ 8 11 umid.o user_syms.o util.o drivers/ skas/
+3 -2
arch/um/os-Linux/signal.c
··· 15 15 #include <kern_util.h> 16 16 #include <os.h> 17 17 #include <sysdep/mcontext.h> 18 + #include <um_malloc.h> 18 19 19 20 void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = { 20 21 [SIGTRAP] = relay_signal, ··· 33 32 struct uml_pt_regs *r; 34 33 int save_errno = errno; 35 34 36 - r = malloc(sizeof(struct uml_pt_regs)); 35 + r = uml_kmalloc(sizeof(struct uml_pt_regs), UM_GFP_ATOMIC); 37 36 if (!r) 38 37 panic("out of memory"); 39 38 ··· 92 91 { 93 92 struct uml_pt_regs *regs; 94 93 95 - regs = malloc(sizeof(struct uml_pt_regs)); 94 + regs = uml_kmalloc(sizeof(struct uml_pt_regs), UM_GFP_ATOMIC); 96 95 if (!regs) 97 96 panic("out of memory"); 98 97
+3
arch/x86/um/vdso/Makefile
··· 2 2 # Building vDSO images for x86. 3 3 # 4 4 5 + # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. 6 + KCOV_INSTRUMENT := n 7 + 5 8 VDSO64-y := y 6 9 7 10 vdso-install-$(VDSO64-y) += vdso.so
+4 -3
fs/hostfs/hostfs_kern.c
··· 959 959 960 960 if (S_ISLNK(root_inode->i_mode)) { 961 961 char *name = follow_link(host_root_path); 962 - if (IS_ERR(name)) 962 + if (IS_ERR(name)) { 963 963 err = PTR_ERR(name); 964 - else 965 - err = read_name(root_inode, name); 964 + goto out_put; 965 + } 966 + err = read_name(root_inode, name); 966 967 kfree(name); 967 968 if (err) 968 969 goto out_put;