History log of /arch/powerpc/kernel/signal.h
Revision Date Author Comments
18b246fa60dd4bfc71c78d669e2ffaa5df454d6a 22-Feb-2012 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Fix various issues with return to userspace

We have a few problems when returning to userspace. This is a
quick set of fixes for 3.3, I'll look into a more comprehensive
rework for 3.4. This fixes:

- We kept interrupts soft-disabled when schedule'ing or calling
do_signal when returning to userspace as a result of a hardware
interrupt.

- Rename do_signal to do_notify_resume like all other archs (and
do_signal_pending back to do_signal, which it was before Roland
changed it).

- Add the missing call to key_replace_session_keyring() to
do_notify_resume().

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
efbda86098455da014be849713df6498cefc5a2a 25-Mar-2009 Josh Boyer <jwboyer@linux.vnet.ibm.com> powerpc: Sanitize stack pointer in signal handling code

On powerpc64 machines running 32-bit userspace, we can get garbage bits in the
stack pointer passed into the kernel. Most places handle this correctly, but
the signal handling code uses the passed value directly for allocating signal
stack frames.

This fixes the issue by introducing a get_clean_sp function that returns a
sanitized stack pointer. For 32-bit tasks on a 64-bit kernel, the stack
pointer is masked correctly. In all other cases, the stack pointer is simply
returned.

Additionally, we pass an 'is_32' parameter to get_sigframe now in order to
get the properly sanitized stack. The callers are know to be 32 or 64-bit
statically.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
a465f9b694bcfa4957d06751c0274ded49421c82 22-Feb-2009 Anton Blanchard <anton@samba.org> powerpc: Move is_32bit_task

Move is_32bit_task into asm/thread_info.h, that allows us to test for
32/64bit tasks without an ugly CONFIG_PPC64 ifdef.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2e074004c6b71a93c8e08c0dd5e3cec0b92ad0e5 18-Aug-2008 Al Viro <viro@zeniv.linux.org.uk> x86, um: get rid of uml signal.h

the only theoretical reason for it these days is ppc; aside of uml/ppc
being dead, do_signal() would be happier in arch/powerpc/kernel/signal.h
anyway.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
6a274c08f2f4dfac7167bbd849621f3a2b55d424 02-Jul-2008 Michael Neuling <mikey@neuling.org> powerpc: Clean up copy_to/from_user for vsx and fpr

This merges and cleans up some of the ugly copy/to from user code
which is required for the new fpr and vsx layout in the thread_struct.

Also fixes some hard coded buffer sizes and removes a redundant
fpr_flush_to_thread.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2f97cd3912428f5044fa7715293a69349fc455fa 04-Jun-2007 Benjamin Herrenschmidt <benh@kernel.crashing.org> [POWERPC] Less ifdef's in signal.c/signal.h

This patch moves things around a little bit in the new common signal.c
and signal.h files to remove the last #ifdef in the middle of the
common do_signal().

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
a3f61dc0a5335334958ec3b97d0b1946b4ae5375 04-Jun-2007 Benjamin Herrenschmidt <benh@kernel.crashing.org> [POWERPC] Merge creation of signal frame

The code for creating signal frames was still duplicated and split
in strange ways between 32 and 64 bits, including the SA_ONSTACK
handling being in do_signal on 32 bits but inside handle_rt_signal
on 64 bits etc...

This moves the 64 bits get_sigframe() to the generic signal.c,
cleans it a bit, moves the access_ok() call done by all callers to
it as well, and adapts/cleanups the 3 different signal handling cases
to use that common function.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
f478f5430c8a599f46c41e8172a507a5772a6b69 04-Jun-2007 Christoph Hellwig <hch@lst.de> [POWERPC] Consolidate do_signal

do_signal has exactly the same behaviour on 32bit and 64bit and 32bit
compat on 64bit for handling 32bit signals. Consolidate all these
into one common function in signal.c. The only odd left over is
the try_to_free in the 32bit version that no other architecture has
in mainline (only in i386 for some odd SuSE release). We should
probably get rid of it in a separate patch.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
db277e9a67b9d81b9d6cd74edf0c3e1a0ef2aa4b 04-Jun-2007 Christoph Hellwig <hch@lst.de> [POWERPC] Consolidate restore_sigmask

restore_sigmask is exactly the same on 32 and 64bit, so move it to
common code. Also move _BLOCKABLE to signal.h to avoid defining it
multiple times.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
22e38f29328296d9d4cc33e46fd32a63e807abaf 04-Jun-2007 Benjamin Herrenschmidt <benh@kernel.crashing.org> [POWERPC] Make syscall restart code more common

This patch moves the code in signal_32.c and signal_64.c for handling
syscall restart into a common signal.c file and converge around a single
implementation that is based on the 32 bits one, using trap, ccr
and r3 rather than the special "result" field for deciding what to do.

The "result" field is now pretty much deprecated. We still set it for
the sake of whatever might rely on it in userland but we no longer use
it's content.

This, along with a previous patch that enables ptracers to write to
"trap" and "orig_r3" should allow gdb to properly handle syscall
restarting.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>