Commit fbf50f47 authored by Sven Schnelle's avatar Sven Schnelle Committed by Vasily Gorbik
Browse files

s390/signal: remove sigreturn on stack



{rt_}sigreturn is now called from the vdso, so we no longer
need the svc on the stack, and therefore no hack to support that
mechanism on machines with non-executable stack.

Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent df29a744
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
#define ARCH_EXIT_TO_USER_MODE_WORK (_TIF_GUARDED_STORAGE | _TIF_PER_TRAP)

void do_per_trap(struct pt_regs *regs);
void do_syscall(struct pt_regs *regs);

#ifdef CONFIG_DEBUG_ENTRY
static __always_inline void arch_check_user_regs(struct pt_regs *regs)
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ SYSCALL_DEFINE0(ni_syscall)
	return -ENOSYS;
}

void do_syscall(struct pt_regs *regs)
static void do_syscall(struct pt_regs *regs)
{
	unsigned long nr;

+1 −11
Original line number Diff line number Diff line
@@ -301,10 +301,9 @@ static void (*pgm_check_table[128])(struct pt_regs *regs);
void noinstr __do_pgm_check(struct pt_regs *regs)
{
	unsigned long last_break = S390_lowcore.breaking_event_addr;
	unsigned int trapnr, syscall_redirect = 0;
	unsigned int trapnr;
	irqentry_state_t state;

	add_random_kstack_offset();
	regs->int_code = *(u32 *)&S390_lowcore.pgm_ilc;
	regs->int_parm_long = S390_lowcore.trans_exc_code;

@@ -346,18 +345,9 @@ void noinstr __do_pgm_check(struct pt_regs *regs)
	trapnr = regs->int_code & PGM_INT_CODE_MASK;
	if (trapnr)
		pgm_check_table[trapnr](regs);
	syscall_redirect = user_mode(regs) && test_pt_regs_flag(regs, PIF_SYSCALL);
out:
	local_irq_disable();
	irqentry_exit(regs, state);

	if (syscall_redirect) {
		enter_from_user_mode(regs);
		local_irq_enable();
		regs->orig_gpr2 = regs->gprs[2];
		do_syscall(regs);
		exit_to_user_mode();
	}
}

/*
+0 −23
Original line number Diff line number Diff line
@@ -285,26 +285,6 @@ static noinline void do_sigbus(struct pt_regs *regs)
			(void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK));
}

static noinline int signal_return(struct pt_regs *regs)
{
	u16 instruction;
	int rc;

	rc = __get_user(instruction, (u16 __user *) regs->psw.addr);
	if (rc)
		return rc;
	if (instruction == 0x0a77) {
		set_pt_regs_flag(regs, PIF_SYSCALL);
		regs->int_code = 0x00040077;
		return 0;
	} else if (instruction == 0x0aad) {
		set_pt_regs_flag(regs, PIF_SYSCALL);
		regs->int_code = 0x000400ad;
		return 0;
	}
	return -EACCES;
}

static noinline void do_fault_error(struct pt_regs *regs, int access,
					vm_fault_t fault)
{
@@ -312,9 +292,6 @@ static noinline void do_fault_error(struct pt_regs *regs, int access,

	switch (fault) {
	case VM_FAULT_BADACCESS:
		if (access == VM_EXEC && signal_return(regs) == 0)
			break;
		fallthrough;
	case VM_FAULT_BADMAP:
		/* Bad memory access. Check if it is kernel or user space. */
		if (user_mode(regs)) {