Skip to content

Commit 2896b80

Browse files
committed
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
2 parents 48bddb1 + 6d20e6b commit 2896b80

File tree

14 files changed

+41
-27
lines changed

14 files changed

+41
-27
lines changed

arch/um/Kconfig.um

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ config LD_SCRIPT_DYN
2020
bool
2121
default y
2222
depends on !LD_SCRIPT_STATIC
23+
select MODULE_REL_CRCS if MODVERSIONS
2324

2425
source "fs/Kconfig.binfmt"
2526

arch/um/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ archheaders:
121121
archprepare: include/generated/user_constants.h
122122

123123
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)
125125

126126
CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
127127
$(call cc-option, -fno-stack-protector,) \

arch/um/configs/i386_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ CONFIG_NET=y
5353
CONFIG_PACKET=y
5454
CONFIG_UNIX=y
5555
CONFIG_INET=y
56-
# CONFIG_INET_LRO is not set
5756
# CONFIG_IPV6 is not set
5857
CONFIG_UML_NET=y
5958
CONFIG_UML_NET_ETHERTAP=y

arch/um/configs/x86_64_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ CONFIG_NET=y
5151
CONFIG_PACKET=y
5252
CONFIG_UNIX=y
5353
CONFIG_INET=y
54-
# CONFIG_INET_LRO is not set
5554
# CONFIG_IPV6 is not set
5655
CONFIG_UML_NET=y
5756
CONFIG_UML_NET_ETHERTAP=y

arch/um/include/asm/thread_info.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <asm/types.h>
1212
#include <asm/page.h>
1313
#include <asm/segment.h>
14+
#include <sysdep/ptrace_user.h>
1415

1516
struct thread_info {
1617
struct task_struct *task; /* main task structure */
@@ -22,6 +23,8 @@ struct thread_info {
2223
0-0xBFFFFFFF for user
2324
0-0xFFFFFFFF for kernel */
2425
struct thread_info *real_thread; /* Points to non-IRQ stack */
26+
unsigned long aux_fp_regs[FP_SIZE]; /* auxiliary fp_regs to save/restore
27+
them out-of-band */
2528
};
2629

2730
#define INIT_THREAD_INFO(tsk) \

arch/um/include/shared/os.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ extern int protect(struct mm_id * mm_idp, unsigned long addr,
278278
extern int is_skas_winch(int pid, int fd, void *data);
279279
extern int start_userspace(unsigned long stub_stack);
280280
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);
282282
extern int map_stub_pages(int fd, unsigned long code, unsigned long data,
283283
unsigned long stack);
284284
extern void new_thread(void *stack, jmp_buf *buf, void (*handler)(void));

arch/um/kernel/gmon_syms.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@
77

88
extern void __bb_init_func(void *) __attribute__((weak));
99
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);

arch/um/kernel/process.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void new_thread_handler(void)
131131
* callback returns only if the kernel thread execs a process
132132
*/
133133
n = fn(arg);
134-
userspace(&current->thread.regs.regs);
134+
userspace(&current->thread.regs.regs, current_thread_info()->aux_fp_regs);
135135
}
136136

137137
/* Called magically, see new_thread_handler above */
@@ -150,7 +150,7 @@ void fork_handler(void)
150150

151151
current->thread.prev_sched = NULL;
152152

153-
userspace(&current->thread.regs.regs);
153+
userspace(&current->thread.regs.regs, current_thread_info()->aux_fp_regs);
154154
}
155155

156156
int copy_thread(unsigned long clone_flags, unsigned long sp,

arch/um/os-Linux/drivers/tuntap_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote,
8080
pid = run_helper(tuntap_pre_exec, &data, argv);
8181

8282
if (pid < 0)
83-
return -pid;
83+
return pid;
8484

8585
close(remote);
8686

arch/um/os-Linux/skas/process.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,11 @@ void wait_stub_done(int pid)
8888

8989
extern unsigned long current_stub_stack(void);
9090

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)
9292
{
9393
int err;
94-
unsigned long fpregs[FP_SIZE];
9594

96-
err = get_fp_registers(pid, fpregs);
95+
err = get_fp_registers(pid, aux_fp_regs);
9796
if (err < 0) {
9897
printk(UM_KERN_ERR "save_fp_registers returned %d\n",
9998
err);
@@ -113,17 +112,17 @@ static void get_skas_faultinfo(int pid, struct faultinfo *fi)
113112
*/
114113
memcpy(fi, (void *)current_stub_stack(), sizeof(*fi));
115114

116-
err = put_fp_registers(pid, fpregs);
115+
err = put_fp_registers(pid, aux_fp_regs);
117116
if (err < 0) {
118117
printk(UM_KERN_ERR "put_fp_registers returned %d\n",
119118
err);
120119
fatal_sigsegv();
121120
}
122121
}
123122

124-
static void handle_segv(int pid, struct uml_pt_regs * regs)
123+
static void handle_segv(int pid, struct uml_pt_regs *regs, unsigned long *aux_fp_regs)
125124
{
126-
get_skas_faultinfo(pid, &regs->faultinfo);
125+
get_skas_faultinfo(pid, &regs->faultinfo, aux_fp_regs);
127126
segv(regs->faultinfo, 0, 1, NULL);
128127
}
129128

@@ -332,7 +331,7 @@ int start_userspace(unsigned long stub_stack)
332331
return err;
333332
}
334333

335-
void userspace(struct uml_pt_regs *regs)
334+
void userspace(struct uml_pt_regs *regs, unsigned long *aux_fp_regs)
336335
{
337336
int err, status, op, pid = userspace_pid[0];
338337
/* To prevent races if using_sysemu changes under us.*/
@@ -407,11 +406,11 @@ void userspace(struct uml_pt_regs *regs)
407406
case SIGSEGV:
408407
if (PTRACE_FULL_FAULTINFO) {
409408
get_skas_faultinfo(pid,
410-
&regs->faultinfo);
409+
&regs->faultinfo, aux_fp_regs);
411410
(*sig_info[SIGSEGV])(SIGSEGV, (struct siginfo *)&si,
412411
regs);
413412
}
414-
else handle_segv(pid, regs);
413+
else handle_segv(pid, regs, aux_fp_regs);
415414
break;
416415
case SIGTRAP + 0x80:
417416
handle_trap(pid, regs, local_using_sysemu);

0 commit comments

Comments
 (0)