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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull UML updates from Richard Weinberger:

- minor improvements

- fixes for Debian's new gcc defaults (pie enabled by default)

- fixes for XSTATE/XSAVE to make UML work again on modern systems

* 'for-linus-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
um: return negative in tuntap_open_tramp()
um: remove a stray tab
um: Use relative modversions with LD_SCRIPT_DYN
um: link vmlinux with -no-pie
um: Fix CONFIG_GCOV for modules.
Fix minor typos and grammar in UML start_up help
um: defconfig: Cleanup from old Kconfig options
um: Fix FP register size for XSTATE/XSAVE

+41 -27
+1
arch/um/Kconfig.um
··· 20 20 bool 21 21 default y 22 22 depends on !LD_SCRIPT_STATIC 23 + select MODULE_REL_CRCS if MODVERSIONS 23 24 24 25 source "fs/Kconfig.binfmt" 25 26
+1 -1
arch/um/Makefile
··· 121 121 archprepare: include/generated/user_constants.h 122 122 123 123 LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static 124 - LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib 124 + LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib $(call cc-option, -no-pie) 125 125 126 126 CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \ 127 127 $(call cc-option, -fno-stack-protector,) \
-1
arch/um/configs/i386_defconfig
··· 53 53 CONFIG_PACKET=y 54 54 CONFIG_UNIX=y 55 55 CONFIG_INET=y 56 - # CONFIG_INET_LRO is not set 57 56 # CONFIG_IPV6 is not set 58 57 CONFIG_UML_NET=y 59 58 CONFIG_UML_NET_ETHERTAP=y
-1
arch/um/configs/x86_64_defconfig
··· 51 51 CONFIG_PACKET=y 52 52 CONFIG_UNIX=y 53 53 CONFIG_INET=y 54 - # CONFIG_INET_LRO is not set 55 54 # CONFIG_IPV6 is not set 56 55 CONFIG_UML_NET=y 57 56 CONFIG_UML_NET_ETHERTAP=y
+3
arch/um/include/asm/thread_info.h
··· 11 11 #include <asm/types.h> 12 12 #include <asm/page.h> 13 13 #include <asm/segment.h> 14 + #include <sysdep/ptrace_user.h> 14 15 15 16 struct thread_info { 16 17 struct task_struct *task; /* main task structure */ ··· 23 22 0-0xBFFFFFFF for user 24 23 0-0xFFFFFFFF for kernel */ 25 24 struct thread_info *real_thread; /* Points to non-IRQ stack */ 25 + unsigned long aux_fp_regs[FP_SIZE]; /* auxiliary fp_regs to save/restore 26 + them out-of-band */ 26 27 }; 27 28 28 29 #define INIT_THREAD_INFO(tsk) \
+1 -1
arch/um/include/shared/os.h
··· 278 278 extern int is_skas_winch(int pid, int fd, void *data); 279 279 extern int start_userspace(unsigned long stub_stack); 280 280 extern int copy_context_skas0(unsigned long stack, int pid); 281 - extern void userspace(struct uml_pt_regs *regs); 281 + extern void userspace(struct uml_pt_regs *regs, unsigned long *aux_fp_regs); 282 282 extern int map_stub_pages(int fd, unsigned long code, unsigned long data, 283 283 unsigned long stack); 284 284 extern void new_thread(void *stack, jmp_buf *buf, void (*handler)(void));
+7
arch/um/kernel/gmon_syms.c
··· 7 7 8 8 extern void __bb_init_func(void *) __attribute__((weak)); 9 9 EXPORT_SYMBOL(__bb_init_func); 10 + 11 + extern void __gcov_init(void *) __attribute__((weak)); 12 + EXPORT_SYMBOL(__gcov_init); 13 + extern void __gcov_merge_add(void *, unsigned int) __attribute__((weak)); 14 + EXPORT_SYMBOL(__gcov_merge_add); 15 + extern void __gcov_exit(void) __attribute__((weak)); 16 + EXPORT_SYMBOL(__gcov_exit);
+2 -2
arch/um/kernel/process.c
··· 131 131 * callback returns only if the kernel thread execs a process 132 132 */ 133 133 n = fn(arg); 134 - userspace(&current->thread.regs.regs); 134 + userspace(&current->thread.regs.regs, current_thread_info()->aux_fp_regs); 135 135 } 136 136 137 137 /* Called magically, see new_thread_handler above */ ··· 150 150 151 151 current->thread.prev_sched = NULL; 152 152 153 - userspace(&current->thread.regs.regs); 153 + userspace(&current->thread.regs.regs, current_thread_info()->aux_fp_regs); 154 154 } 155 155 156 156 int copy_thread(unsigned long clone_flags, unsigned long sp,
+1 -1
arch/um/os-Linux/drivers/tuntap_user.c
··· 80 80 pid = run_helper(tuntap_pre_exec, &data, argv); 81 81 82 82 if (pid < 0) 83 - return -pid; 83 + return pid; 84 84 85 85 close(remote); 86 86
+8 -9
arch/um/os-Linux/skas/process.c
··· 88 88 89 89 extern unsigned long current_stub_stack(void); 90 90 91 - static void get_skas_faultinfo(int pid, struct faultinfo *fi) 91 + static void get_skas_faultinfo(int pid, struct faultinfo *fi, unsigned long *aux_fp_regs) 92 92 { 93 93 int err; 94 - unsigned long fpregs[FP_SIZE]; 95 94 96 - err = get_fp_registers(pid, fpregs); 95 + err = get_fp_registers(pid, aux_fp_regs); 97 96 if (err < 0) { 98 97 printk(UM_KERN_ERR "save_fp_registers returned %d\n", 99 98 err); ··· 112 113 */ 113 114 memcpy(fi, (void *)current_stub_stack(), sizeof(*fi)); 114 115 115 - err = put_fp_registers(pid, fpregs); 116 + err = put_fp_registers(pid, aux_fp_regs); 116 117 if (err < 0) { 117 118 printk(UM_KERN_ERR "put_fp_registers returned %d\n", 118 119 err); ··· 120 121 } 121 122 } 122 123 123 - static void handle_segv(int pid, struct uml_pt_regs * regs) 124 + static void handle_segv(int pid, struct uml_pt_regs *regs, unsigned long *aux_fp_regs) 124 125 { 125 - get_skas_faultinfo(pid, &regs->faultinfo); 126 + get_skas_faultinfo(pid, &regs->faultinfo, aux_fp_regs); 126 127 segv(regs->faultinfo, 0, 1, NULL); 127 128 } 128 129 ··· 331 332 return err; 332 333 } 333 334 334 - void userspace(struct uml_pt_regs *regs) 335 + void userspace(struct uml_pt_regs *regs, unsigned long *aux_fp_regs) 335 336 { 336 337 int err, status, op, pid = userspace_pid[0]; 337 338 /* To prevent races if using_sysemu changes under us.*/ ··· 406 407 case SIGSEGV: 407 408 if (PTRACE_FULL_FAULTINFO) { 408 409 get_skas_faultinfo(pid, 409 - &regs->faultinfo); 410 + &regs->faultinfo, aux_fp_regs); 410 411 (*sig_info[SIGSEGV])(SIGSEGV, (struct siginfo *)&si, 411 412 regs); 412 413 } 413 - else handle_segv(pid, regs); 414 + else handle_segv(pid, regs, aux_fp_regs); 414 415 break; 415 416 case SIGTRAP + 0x80: 416 417 handle_trap(pid, regs, local_using_sysemu);
+3 -3
arch/um/os-Linux/start_up.c
··· 154 154 155 155 __uml_setup("nosysemu", nosysemu_cmd_param, 156 156 "nosysemu\n" 157 - " Turns off syscall emulation patch for ptrace (SYSEMU) on.\n" 157 + " Turns off syscall emulation patch for ptrace (SYSEMU).\n" 158 158 " SYSEMU is a performance-patch introduced by Laurent Vivier. It changes\n" 159 - " behaviour of ptrace() and helps reducing host context switch rate.\n" 160 - " To make it working, you need a kernel patch for your host, too.\n" 159 + " behaviour of ptrace() and helps reduce host context switch rates.\n" 160 + " To make it work, you need a kernel patch for your host, too.\n" 161 161 " See http://perso.wanadoo.fr/laurent.vivier/UML/ for further \n" 162 162 " information.\n\n"); 163 163
+12 -6
arch/x86/um/os-Linux/registers.c
··· 5 5 */ 6 6 7 7 #include <errno.h> 8 + #include <stdlib.h> 8 9 #include <sys/ptrace.h> 9 10 #ifdef __i386__ 10 11 #include <sys/user.h> ··· 32 31 33 32 if (have_xstate_support) { 34 33 iov.iov_base = fp_regs; 35 - iov.iov_len = sizeof(struct _xstate); 34 + iov.iov_len = FP_SIZE * sizeof(unsigned long); 36 35 if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0) 37 36 return -errno; 38 37 return 0; ··· 52 51 { 53 52 #ifdef PTRACE_SETREGSET 54 53 struct iovec iov; 55 - 56 54 if (have_xstate_support) { 57 55 iov.iov_base = fp_regs; 58 - iov.iov_len = sizeof(struct _xstate); 56 + iov.iov_len = FP_SIZE * sizeof(unsigned long); 59 57 if (ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov) < 0) 60 58 return -errno; 61 59 return 0; ··· 125 125 void arch_init_registers(int pid) 126 126 { 127 127 #ifdef PTRACE_GETREGSET 128 - struct _xstate fp_regs; 128 + void * fp_regs; 129 129 struct iovec iov; 130 130 131 - iov.iov_base = &fp_regs; 132 - iov.iov_len = sizeof(struct _xstate); 131 + fp_regs = malloc(FP_SIZE * sizeof(unsigned long)); 132 + if(fp_regs == NULL) 133 + return; 134 + 135 + iov.iov_base = fp_regs; 136 + iov.iov_len = FP_SIZE * sizeof(unsigned long); 133 137 if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) == 0) 134 138 have_xstate_support = 1; 139 + 140 + free(fp_regs); 135 141 #endif 136 142 } 137 143 #endif
+1 -1
arch/x86/um/os-Linux/tls.c
··· 37 37 continue; 38 38 else if (errno == ENOSYS) 39 39 *supports_tls = 0; 40 - return; 40 + return; 41 41 } 42 42 } 43 43
+1 -1
arch/x86/um/user-offsets.c
··· 51 51 DEFINE(HOST_ORIG_AX, ORIG_EAX); 52 52 #else 53 53 #ifdef FP_XSTATE_MAGIC1 54 - DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long)); 54 + DEFINE_LONGS(HOST_FP_SIZE, 2696); 55 55 #else 56 56 DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long)); 57 57 #endif