]> git.baikalelectronics.ru Git - kernel.git/commit
tile: fast-path unaligned memory access for tilegx
authorChris Metcalf <cmetcalf@tilera.com>
Tue, 6 Aug 2013 20:04:13 +0000 (16:04 -0400)
committerChris Metcalf <cmetcalf@tilera.com>
Tue, 13 Aug 2013 20:04:10 +0000 (16:04 -0400)
commit23e0453eb52cfe8545eb313875dcfda950f474f0
treeee33ba7e452e8614130a811211eb2383a3133194
parentaf38e699f9a121772d68dc38e5e5b16701505680
tile: fast-path unaligned memory access for tilegx

This change enables unaligned userspace memory access via a kernel
fast path on tilegx.  The kernel tracks user PC/instruction pairs
per-thread using a direct-mapped cache in userspace.  The cache
maps those PC/instruction pairs to JIT'ed instruction sequences that
load or store using byte-wide load store intructions and then
synthesize 2-, 4- or 8-byte load or store results.  Once an
instruction has been seen to generate an unaligned access once,
subsequent hits on that instruction typically require overhead
of only around 50 cycles if cache and TLB is hot.

We support the prctl() PR_GET_UNALIGN / PR_SET_UNALIGN sys call to
enable or disable unaligned fixups on a per-process basis.

To do this we pull some of the tilepro unaligned support out of the
single_step.c file; tilepro uses instruction disassembly for both
single-step and unaligned access support.  Since tilegx actually has
hardware singlestep support, though, it's cleaner to keep the tilegx
unaligned access code in a separate file.  While we're at it,
properly rename the tilepro-specific types, etc., to have tilepro
suffixes instead of generic tile suffixes.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
15 files changed:
arch/tile/include/asm/processor.h
arch/tile/include/asm/ptrace.h
arch/tile/include/asm/sections.h
arch/tile/include/asm/thread_info.h
arch/tile/include/asm/traps.h
arch/tile/kernel/Makefile
arch/tile/kernel/asm-offsets.c
arch/tile/kernel/intvec_32.S
arch/tile/kernel/intvec_64.S
arch/tile/kernel/proc.c
arch/tile/kernel/process.c
arch/tile/kernel/ptrace.c
arch/tile/kernel/single_step.c
arch/tile/kernel/unaligned.c [new file with mode: 0644]
arch/tile/mm/fault.c