linux/arch/tile
Chris Metcalf fc327e268f arch/tile: fix up some issues in calling do_work_pending()
First, we were at risk of handling thread-info flags, in particular
do_signal(), when returning from kernel space.  This could happen
after a failed kernel_execve(), or when forking a kernel thread.
The fix is to test in do_work_pending() for user_mode() and return
immediately if so; we already had this test for one of the flags,
so I just hoisted it to the top of the function.

Second, if a ptraced process updated the callee-saved registers
in the ptregs struct and then processed another thread-info flag, we
would overwrite the modifications with the original callee-saved
registers.  To fix this, we add a register to note if we've already
saved the registers once, and skip doing it on additional passes
through the loop.  To avoid a performance hit from the couple of
extra instructions involved, I modified the GET_THREAD_INFO() macro
to be guaranteed to be one instruction, then bundled it with adjacent
instructions, yielding an overall net savings.

Reported-By: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
2012-05-16 16:01:16 -04:00
..
configs arch/tile/configs: convert to minimal configs via "make savedefconfig" 2012-03-14 14:33:16 -04:00
include arch/tile: fix up some issues in calling do_work_pending() 2012-05-16 16:01:16 -04:00
kernel arch/tile: fix up some issues in calling do_work_pending() 2012-05-16 16:01:16 -04:00
kvm virtio: expose for non-virtualization users too 2011-07-23 16:20:30 +09:30
lib arch/tile: fix finv_buffer_remote() for tilegx 2012-04-02 12:13:53 -04:00
mm arch/tile: remove bogus performance optimization 2012-04-02 12:13:59 -04:00
Kbuild arch/tile: core support for Tilera 32-bit chips. 2010-06-04 17:11:18 -04:00
Kconfig arch/tile/Kconfig: don't specify CONFIG_PAGE_OFFSET for 64-bit builds 2012-04-02 12:00:14 -04:00
Kconfig.debug lib: consolidate DEBUG_STACK_USAGE option 2011-05-25 08:39:54 -07:00
Makefile arch/tile: stop mentioning the "kvm" subdirectory 2012-04-02 12:13:46 -04:00