linux/arch/tile/kernel
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
..
asm-offsets.c
backtrace.c arch/tile: factor out <arch/opcode.h> header 2011-11-03 16:58:54 -04:00
compat_signal.c tile: Use set_current_blocked() and block_sigmask() 2012-03-13 16:42:05 -04:00
compat.c [PATCH v3] ipc: provide generic compat versions of IPC syscalls 2012-03-15 13:13:38 -04:00
early_printk.c Disintegrate asm/system.h for Tile 2012-03-28 18:30:03 +01:00
entry.S arch/tile: add "nop" after "nap" to help GX idle power draw 2012-04-02 12:13:29 -04:00
futex_64.S arch/tile: finish enabling support for TILE-Gx 64-bit chip 2011-05-12 15:52:12 -04:00
hardwall.c arch/tile: more /proc and /sys file support 2011-05-27 10:39:05 -04:00
head_32.S arch/tile: support newer binutils assembler shift semantics 2011-03-17 14:32:06 -04:00
head_64.S arch/tile: finish enabling support for TILE-Gx 64-bit chip 2011-05-12 15:52:12 -04:00
hvglue.lds arch/tile: Enable more sophisticated IRQ model for 32-bit chips. 2010-07-06 13:34:01 -04:00
init_task.c
intvec_32.S arch/tile: fix up some issues in calling do_work_pending() 2012-05-16 16:01:16 -04:00
intvec_64.S arch/tile: fix up some issues in calling do_work_pending() 2012-05-16 16:01:16 -04:00
irq.c arch/tile: use new generic {enable,disable}_percpu_irq() routines 2011-12-03 15:31:49 -05:00
machine_kexec.c treewide: convert uses of ATTRIB_NORETURN to __noreturn 2012-01-12 20:13:03 -08:00
Makefile arch/tile: more /proc and /sys file support 2011-05-27 10:39:05 -04:00
messaging.c arch/tile: bomb raw_local_irq_ to arch_local_irq_ 2010-11-01 15:30:42 -04:00
module.c arch/tile: don't leak kernel memory when we unload modules 2012-04-02 12:13:19 -04:00
pci-dma.c arch/tile: add a few #includes and an EXPORT to catch up with kernel changes. 2011-12-03 15:31:41 -05:00
pci.c arch/tile: fix a couple of functions that should be __init 2012-04-25 12:45:26 -04:00
proc.c arch/tile: avoid unused variable warning in proc.c for tilegx 2012-04-11 12:45:20 -04:00
process.c arch/tile: fix up some issues in calling do_work_pending() 2012-05-16 16:01:16 -04:00
ptrace.c arch/tile: don't allow user code to set the PL via ptrace or signal return 2010-11-01 15:31:17 -04:00
reboot.c arch/tile: bomb raw_local_irq_ to arch_local_irq_ 2010-11-01 15:30:42 -04:00
regs_32.S Disintegrate asm/system.h for Tile 2012-03-28 18:30:03 +01:00
regs_64.S Disintegrate asm/system.h for Tile 2012-03-28 18:30:03 +01:00
relocate_kernel.S
setup.c Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2012-04-06 17:56:20 -07:00
signal.c tile: Use set_current_blocked() and block_sigmask() 2012-03-13 16:42:05 -04:00
single_step.c VM: add "vm_mmap()" helper function 2012-04-20 17:29:13 -07:00
smp.c arch/tile: implement panic_smp_self_stop() 2012-04-02 12:13:32 -04:00
smpboot.c tile/CPU hotplug: Add missing call to notify_cpu_starting() 2012-04-09 14:02:23 -04:00
stack.c arch/tile: various bugs in stack backtracer 2012-04-02 12:12:45 -04:00
sys.c arch/tile: cleanups for tilegx compat mode 2011-05-19 22:56:13 -04:00
sysfs.c arch/tile: Fix up from commit 8a25a2fd12 2012-03-12 15:31:37 -04:00
tile-desc_32.c arch/tile: factor out <arch/opcode.h> header 2011-11-03 16:58:54 -04:00
tile-desc_64.c arch/tile: factor out <arch/opcode.h> header 2011-11-03 16:58:54 -04:00
time.c clocksource: tile: convert to use clocksource_register_hz 2011-06-03 17:26:21 -04:00
tlb.c tile: replace mm->cpu_vm_mask with mm_cpumask() 2011-05-04 14:41:44 -04:00
traps.c arch/tile: fix up some minor trap handling issues 2012-04-02 12:12:52 -04:00
vmlinux.lds.S percpu: Always align percpu output section to PAGE_SIZE 2011-03-24 18:50:09 +01:00