diff options
Diffstat (limited to 'arch/sparc/kernel')
| -rw-r--r-- | arch/sparc/kernel/process_64.c | 2 | ||||
| -rw-r--r-- | arch/sparc/kernel/signal32.c | 37 | ||||
| -rw-r--r-- | arch/sparc/kernel/signal_64.c | 36 | ||||
| -rw-r--r-- | arch/sparc/kernel/sys_sparc_32.c | 2 | ||||
| -rw-r--r-- | arch/sparc/kernel/sys_sparc_64.c | 2 | ||||
| -rw-r--r-- | arch/sparc/kernel/syscalls/syscall.tbl | 2 | ||||
| -rw-r--r-- | arch/sparc/kernel/traps_32.c | 22 | ||||
| -rw-r--r-- | arch/sparc/kernel/traps_64.c | 44 | ||||
| -rw-r--r-- | arch/sparc/kernel/unaligned_32.c | 2 | ||||
| -rw-r--r-- | arch/sparc/kernel/vio.c | 4 | 
10 files changed, 109 insertions, 44 deletions
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index d33c58a58d4f..547b06b49ce3 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c @@ -518,7 +518,7 @@ void synchronize_user_stack(void)  static void stack_unaligned(unsigned long sp)  { -	force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) sp, 0); +	force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) sp);  }  static const char uwfault32[] = KERN_INFO \ diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index e9695a06492f..4276b9e003ca 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c @@ -745,3 +745,40 @@ asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp)  out:  	return ret;  } + +/* + * Compile-time assertions for siginfo_t offsets. Check NSIG* as well, as + * changes likely come with new fields that should be added below. + */ +static_assert(NSIGILL	== 11); +static_assert(NSIGFPE	== 15); +static_assert(NSIGSEGV	== 9); +static_assert(NSIGBUS	== 5); +static_assert(NSIGTRAP	== 6); +static_assert(NSIGCHLD	== 6); +static_assert(NSIGSYS	== 2); +static_assert(sizeof(compat_siginfo_t) == 128); +static_assert(__alignof__(compat_siginfo_t) == 4); +static_assert(offsetof(compat_siginfo_t, si_signo)	== 0x00); +static_assert(offsetof(compat_siginfo_t, si_errno)	== 0x04); +static_assert(offsetof(compat_siginfo_t, si_code)	== 0x08); +static_assert(offsetof(compat_siginfo_t, si_pid)	== 0x0c); +static_assert(offsetof(compat_siginfo_t, si_uid)	== 0x10); +static_assert(offsetof(compat_siginfo_t, si_tid)	== 0x0c); +static_assert(offsetof(compat_siginfo_t, si_overrun)	== 0x10); +static_assert(offsetof(compat_siginfo_t, si_status)	== 0x14); +static_assert(offsetof(compat_siginfo_t, si_utime)	== 0x18); +static_assert(offsetof(compat_siginfo_t, si_stime)	== 0x1c); +static_assert(offsetof(compat_siginfo_t, si_value)	== 0x14); +static_assert(offsetof(compat_siginfo_t, si_int)	== 0x14); +static_assert(offsetof(compat_siginfo_t, si_ptr)	== 0x14); +static_assert(offsetof(compat_siginfo_t, si_addr)	== 0x0c); +static_assert(offsetof(compat_siginfo_t, si_trapno)	== 0x10); +static_assert(offsetof(compat_siginfo_t, si_addr_lsb)	== 0x10); +static_assert(offsetof(compat_siginfo_t, si_lower)	== 0x14); +static_assert(offsetof(compat_siginfo_t, si_upper)	== 0x18); +static_assert(offsetof(compat_siginfo_t, si_pkey)	== 0x14); +static_assert(offsetof(compat_siginfo_t, si_perf_data)	== 0x10); +static_assert(offsetof(compat_siginfo_t, si_perf_type)	== 0x14); +static_assert(offsetof(compat_siginfo_t, si_band)	== 0x0c); +static_assert(offsetof(compat_siginfo_t, si_fd)		== 0x10); diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index a0eec62c825d..cea23cf95600 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c @@ -556,3 +556,39 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long  	user_enter();  } +/* + * Compile-time assertions for siginfo_t offsets. Check NSIG* as well, as + * changes likely come with new fields that should be added below. + */ +static_assert(NSIGILL	== 11); +static_assert(NSIGFPE	== 15); +static_assert(NSIGSEGV	== 9); +static_assert(NSIGBUS	== 5); +static_assert(NSIGTRAP	== 6); +static_assert(NSIGCHLD	== 6); +static_assert(NSIGSYS	== 2); +static_assert(sizeof(siginfo_t) == 128); +static_assert(__alignof__(siginfo_t) == 8); +static_assert(offsetof(siginfo_t, si_signo)	== 0x00); +static_assert(offsetof(siginfo_t, si_errno)	== 0x04); +static_assert(offsetof(siginfo_t, si_code)	== 0x08); +static_assert(offsetof(siginfo_t, si_pid)	== 0x10); +static_assert(offsetof(siginfo_t, si_uid)	== 0x14); +static_assert(offsetof(siginfo_t, si_tid)	== 0x10); +static_assert(offsetof(siginfo_t, si_overrun)	== 0x14); +static_assert(offsetof(siginfo_t, si_status)	== 0x18); +static_assert(offsetof(siginfo_t, si_utime)	== 0x20); +static_assert(offsetof(siginfo_t, si_stime)	== 0x28); +static_assert(offsetof(siginfo_t, si_value)	== 0x18); +static_assert(offsetof(siginfo_t, si_int)	== 0x18); +static_assert(offsetof(siginfo_t, si_ptr)	== 0x18); +static_assert(offsetof(siginfo_t, si_addr)	== 0x10); +static_assert(offsetof(siginfo_t, si_trapno)	== 0x18); +static_assert(offsetof(siginfo_t, si_addr_lsb)	== 0x18); +static_assert(offsetof(siginfo_t, si_lower)	== 0x20); +static_assert(offsetof(siginfo_t, si_upper)	== 0x28); +static_assert(offsetof(siginfo_t, si_pkey)	== 0x20); +static_assert(offsetof(siginfo_t, si_perf_data)	== 0x18); +static_assert(offsetof(siginfo_t, si_perf_type)	== 0x20); +static_assert(offsetof(siginfo_t, si_band)	== 0x10); +static_assert(offsetof(siginfo_t, si_fd)	== 0x14); diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c index be77538bc038..082a551897ed 100644 --- a/arch/sparc/kernel/sys_sparc_32.c +++ b/arch/sparc/kernel/sys_sparc_32.c @@ -151,7 +151,7 @@ sparc_breakpoint (struct pt_regs *regs)  #ifdef DEBUG_SPARC_BREAKPOINT          printk ("TRAP: Entering kernel PC=%x, nPC=%x\n", regs->pc, regs->npc);  #endif -	force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc, 0); +	force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc);  #ifdef DEBUG_SPARC_BREAKPOINT  	printk ("TRAP: Returning to space: PC=%x nPC=%x\n", regs->pc, regs->npc); diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c index 6b92fadb6ec7..1e9a9e016237 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c @@ -514,7 +514,7 @@ asmlinkage void sparc_breakpoint(struct pt_regs *regs)  #ifdef DEBUG_SPARC_BREAKPOINT          printk ("TRAP: Entering kernel PC=%lx, nPC=%lx\n", regs->tpc, regs->tnpc);  #endif -	force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->tpc, 0); +	force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->tpc);  #ifdef DEBUG_SPARC_BREAKPOINT  	printk ("TRAP: Returning to space: PC=%lx nPC=%lx\n", regs->tpc, regs->tnpc);  #endif diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl index 603f5a821502..f520e9cd2c78 100644 --- a/arch/sparc/kernel/syscalls/syscall.tbl +++ b/arch/sparc/kernel/syscalls/syscall.tbl @@ -270,7 +270,7 @@  222	common	delete_module		sys_delete_module  223	common	get_kernel_syms		sys_ni_syscall  224	common	getpgid			sys_getpgid -225	common	bdflush			sys_bdflush +225	common	bdflush			sys_ni_syscall  226	common	sysfs			sys_sysfs  227	common	afs_syscall		sys_nis_syscall  228	common	setfsuid		sys_setfsuid16 diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c index 247a0d9683b2..5630e5a395e0 100644 --- a/arch/sparc/kernel/traps_32.c +++ b/arch/sparc/kernel/traps_32.c @@ -102,8 +102,8 @@ void do_hw_interrupt(struct pt_regs *regs, unsigned long type)  	if(regs->psr & PSR_PS)  		die_if_kernel("Kernel bad trap", regs); -	force_sig_fault(SIGILL, ILL_ILLTRP, -			(void __user *)regs->pc, type - 0x80); +	force_sig_fault_trapno(SIGILL, ILL_ILLTRP, +			       (void __user *)regs->pc, type - 0x80);  }  void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc, @@ -116,7 +116,7 @@ void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned lon  	       regs->pc, *(unsigned long *)regs->pc);  #endif -	send_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)pc, 0, current); +	send_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)pc, current);  }  void do_priv_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc, @@ -124,7 +124,7 @@ void do_priv_instruction(struct pt_regs *regs, unsigned long pc, unsigned long n  {  	if(psr & PSR_PS)  		die_if_kernel("Penguin instruction from Penguin mode??!?!", regs); -	send_sig_fault(SIGILL, ILL_PRVOPC, (void __user *)pc, 0, current); +	send_sig_fault(SIGILL, ILL_PRVOPC, (void __user *)pc, current);  }  /* XXX User may want to be allowed to do this. XXX */ @@ -145,7 +145,7 @@ void do_memaccess_unaligned(struct pt_regs *regs, unsigned long pc, unsigned lon  #endif  	send_sig_fault(SIGBUS, BUS_ADRALN,  		       /* FIXME: Should dig out mna address */ (void *)0, -		       0, current); +		       current);  }  static unsigned long init_fsr = 0x0UL; @@ -291,7 +291,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,  		else if (fsr & 0x01)  			code = FPE_FLTRES;  	} -	send_sig_fault(SIGFPE, code, (void __user *)pc, 0, fpt); +	send_sig_fault(SIGFPE, code, (void __user *)pc, fpt);  #ifndef CONFIG_SMP  	last_task_used_math = NULL;  #endif @@ -305,7 +305,7 @@ void handle_tag_overflow(struct pt_regs *regs, unsigned long pc, unsigned long n  {  	if(psr & PSR_PS)  		die_if_kernel("Penguin overflow trap from kernel mode", regs); -	send_sig_fault(SIGEMT, EMT_TAGOVF, (void __user *)pc, 0, current); +	send_sig_fault(SIGEMT, EMT_TAGOVF, (void __user *)pc, current);  }  void handle_watchpoint(struct pt_regs *regs, unsigned long pc, unsigned long npc, @@ -327,13 +327,13 @@ void handle_reg_access(struct pt_regs *regs, unsigned long pc, unsigned long npc  	printk("Register Access Exception at PC %08lx NPC %08lx PSR %08lx\n",  	       pc, npc, psr);  #endif -	force_sig_fault(SIGBUS, BUS_OBJERR, (void __user *)pc, 0); +	force_sig_fault(SIGBUS, BUS_OBJERR, (void __user *)pc);  }  void handle_cp_disabled(struct pt_regs *regs, unsigned long pc, unsigned long npc,  			unsigned long psr)  { -	send_sig_fault(SIGILL, ILL_COPROC, (void __user *)pc, 0, current); +	send_sig_fault(SIGILL, ILL_COPROC, (void __user *)pc, current);  }  void handle_cp_exception(struct pt_regs *regs, unsigned long pc, unsigned long npc, @@ -343,13 +343,13 @@ void handle_cp_exception(struct pt_regs *regs, unsigned long pc, unsigned long n  	printk("Co-Processor Exception at PC %08lx NPC %08lx PSR %08lx\n",  	       pc, npc, psr);  #endif -	send_sig_fault(SIGILL, ILL_COPROC, (void __user *)pc, 0, current); +	send_sig_fault(SIGILL, ILL_COPROC, (void __user *)pc, current);  }  void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, unsigned long npc,  		       unsigned long psr)  { -	send_sig_fault(SIGFPE, FPE_INTDIV, (void __user *)pc, 0, current); +	send_sig_fault(SIGFPE, FPE_INTDIV, (void __user *)pc, current);  }  #ifdef CONFIG_DEBUG_BUGVERBOSE diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index a850dccd78ea..6863025ed56d 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c @@ -107,8 +107,8 @@ void bad_trap(struct pt_regs *regs, long lvl)  		regs->tpc &= 0xffffffff;  		regs->tnpc &= 0xffffffff;  	} -	force_sig_fault(SIGILL, ILL_ILLTRP, -			(void __user *)regs->tpc, lvl); +	force_sig_fault_trapno(SIGILL, ILL_ILLTRP, +			       (void __user *)regs->tpc, lvl);  }  void bad_trap_tl1(struct pt_regs *regs, long lvl) @@ -201,8 +201,7 @@ void spitfire_insn_access_exception(struct pt_regs *regs, unsigned long sfsr, un  		regs->tpc &= 0xffffffff;  		regs->tnpc &= 0xffffffff;  	} -	force_sig_fault(SIGSEGV, SEGV_MAPERR, -			(void __user *)regs->tpc, 0); +	force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)regs->tpc);  out:  	exception_exit(prev_state);  } @@ -237,7 +236,7 @@ void sun4v_insn_access_exception(struct pt_regs *regs, unsigned long addr, unsig  		regs->tpc &= 0xffffffff;  		regs->tnpc &= 0xffffffff;  	} -	force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *) addr, 0); +	force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *) addr);  }  void sun4v_insn_access_exception_tl1(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx) @@ -321,7 +320,7 @@ void spitfire_data_access_exception(struct pt_regs *regs, unsigned long sfsr, un  	if (is_no_fault_exception(regs))  		return; -	force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)sfar, 0); +	force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)sfar);  out:  	exception_exit(prev_state);  } @@ -385,13 +384,13 @@ void sun4v_data_access_exception(struct pt_regs *regs, unsigned long addr, unsig  	 */  	switch (type) {  	case HV_FAULT_TYPE_INV_ASI: -		force_sig_fault(SIGILL, ILL_ILLADR, (void __user *)addr, 0); +		force_sig_fault(SIGILL, ILL_ILLADR, (void __user *)addr);  		break;  	case HV_FAULT_TYPE_MCD_DIS: -		force_sig_fault(SIGSEGV, SEGV_ACCADI, (void __user *)addr, 0); +		force_sig_fault(SIGSEGV, SEGV_ACCADI, (void __user *)addr);  		break;  	default: -		force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)addr, 0); +		force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)addr);  		break;  	}  } @@ -568,7 +567,7 @@ static void spitfire_ue_log(unsigned long afsr, unsigned long afar, unsigned lon  		regs->tpc &= 0xffffffff;  		regs->tnpc &= 0xffffffff;  	} -	force_sig_fault(SIGBUS, BUS_OBJERR, (void *)0, 0); +	force_sig_fault(SIGBUS, BUS_OBJERR, (void *)0);  }  void spitfire_access_error(struct pt_regs *regs, unsigned long status_encoded, unsigned long afar) @@ -2069,8 +2068,7 @@ void do_mcd_err(struct pt_regs *regs, struct sun4v_error_entry ent)  	/* Send SIGSEGV to the userspace process with the right signal  	 * code  	 */ -	force_sig_fault(SIGSEGV, SEGV_ADIDERR, (void __user *)ent.err_raddr, -			0); +	force_sig_fault(SIGSEGV, SEGV_ADIDERR, (void __user *)ent.err_raddr);  }  /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate. @@ -2184,7 +2182,7 @@ bool sun4v_nonresum_error_user_handled(struct pt_regs *regs,  	}  	if (attrs & SUN4V_ERR_ATTRS_PIO) {  		force_sig_fault(SIGBUS, BUS_ADRERR, -				(void __user *)sun4v_get_vaddr(regs), 0); +				(void __user *)sun4v_get_vaddr(regs));  		return true;  	} @@ -2340,8 +2338,7 @@ static void do_fpe_common(struct pt_regs *regs)  			else if (fsr & 0x01)  				code = FPE_FLTRES;  		} -		force_sig_fault(SIGFPE, code, -				(void __user *)regs->tpc, 0); +		force_sig_fault(SIGFPE, code, (void __user *)regs->tpc);  	}  } @@ -2395,8 +2392,7 @@ void do_tof(struct pt_regs *regs)  		regs->tpc &= 0xffffffff;  		regs->tnpc &= 0xffffffff;  	} -	force_sig_fault(SIGEMT, EMT_TAGOVF, -			(void __user *)regs->tpc, 0); +	force_sig_fault(SIGEMT, EMT_TAGOVF, (void __user *)regs->tpc);  out:  	exception_exit(prev_state);  } @@ -2415,8 +2411,7 @@ void do_div0(struct pt_regs *regs)  		regs->tpc &= 0xffffffff;  		regs->tnpc &= 0xffffffff;  	} -	force_sig_fault(SIGFPE, FPE_INTDIV, -			(void __user *)regs->tpc, 0); +	force_sig_fault(SIGFPE, FPE_INTDIV, (void __user *)regs->tpc);  out:  	exception_exit(prev_state);  } @@ -2612,7 +2607,7 @@ void do_illegal_instruction(struct pt_regs *regs)  			}  		}  	} -	force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)pc, 0); +	force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)pc);  out:  	exception_exit(prev_state);  } @@ -2632,7 +2627,7 @@ void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned lo  	if (is_no_fault_exception(regs))  		return; -	force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)sfar, 0); +	force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)sfar);  out:  	exception_exit(prev_state);  } @@ -2650,7 +2645,7 @@ void sun4v_do_mna(struct pt_regs *regs, unsigned long addr, unsigned long type_c  	if (is_no_fault_exception(regs))  		return; -	force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) addr, 0); +	force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) addr);  }  /* sun4v_mem_corrupt_detect_precise() - Handle precise exception on an ADI @@ -2697,7 +2692,7 @@ void sun4v_mem_corrupt_detect_precise(struct pt_regs *regs, unsigned long addr,  		regs->tpc &= 0xffffffff;  		regs->tnpc &= 0xffffffff;  	} -	force_sig_fault(SIGSEGV, SEGV_ADIPERR, (void __user *)addr, 0); +	force_sig_fault(SIGSEGV, SEGV_ADIPERR, (void __user *)addr);  }  void do_privop(struct pt_regs *regs) @@ -2712,8 +2707,7 @@ void do_privop(struct pt_regs *regs)  		regs->tpc &= 0xffffffff;  		regs->tnpc &= 0xffffffff;  	} -	force_sig_fault(SIGILL, ILL_PRVOPC, -			(void __user *)regs->tpc, 0); +	force_sig_fault(SIGILL, ILL_PRVOPC, (void __user *)regs->tpc);  out:  	exception_exit(prev_state);  } diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c index ef5c5207c9ff..455f0258c745 100644 --- a/arch/sparc/kernel/unaligned_32.c +++ b/arch/sparc/kernel/unaligned_32.c @@ -278,5 +278,5 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)  {  	send_sig_fault(SIGBUS, BUS_ADRALN,  		       (void __user *)safe_compute_effective_address(regs, insn), -		       0, current); +		       current);  } diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c index 348a88691219..01122a208f94 100644 --- a/arch/sparc/kernel/vio.c +++ b/arch/sparc/kernel/vio.c @@ -93,7 +93,7 @@ static int vio_device_probe(struct device *dev)  	return drv->probe(vdev, id);  } -static int vio_device_remove(struct device *dev) +static void vio_device_remove(struct device *dev)  {  	struct vio_dev *vdev = to_vio_dev(dev);  	struct vio_driver *drv = to_vio_driver(dev->driver); @@ -107,8 +107,6 @@ static int vio_device_remove(struct device *dev)  		drv->remove(vdev);  	} - -	return 0;  }  static ssize_t devspec_show(struct device *dev,  |