]> git.karo-electronics.de Git - karo-tx-linux.git/commit
tilegx: change how we find the kernel stack
authorChris Metcalf <cmetcalf@tilera.com>
Sat, 10 Aug 2013 16:35:02 +0000 (12:35 -0400)
committerChris Metcalf <cmetcalf@tilera.com>
Tue, 13 Aug 2013 20:27:48 +0000 (16:27 -0400)
commitf2c9eadf19a3868c715182ad2c12481435f5b4b6
tree53b2d8d05a440bd1284df8a1708cec2541ec8461
parentc5d705a56cdc0df8e1ff9e27cabb2a6365cb7745
tilegx: change how we find the kernel stack

Previously, we used a special-purpose register (SPR_SYSTEM_SAVE_K_0)
to hold the CPU number and the top of the current kernel stack
by using the low bits to hold the CPU number, and using the high
bits to hold the address of the page just above where we'd want
the kernel stack to be.  That way we could initialize a new SP
when first entering the kernel by just masking the SPR value and
subtracting a couple of words.

However, it's actually more useful to be able to place an arbitrary
kernel-top value in the SPR.  This allows us to create a new stack
context (e.g. for virtualization) with an arbitrary top-of-stack VA.
To make this work, we now store the CPU number in the high bits,
above the highest legal VA bit (42 bits in the current tilegx
microarchitecture).  The full 42 bits are thus available to store the
top of stack value.  Getting the current cpu (a relatively common
operation) is still fast; it's now a shift rather than a mask.

We make this change only for tilegx, since tilepro has too few SPR
bits to do this, and we don't need this support on tilepro anyway.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
arch/tile/include/asm/processor.h
arch/tile/kernel/head_32.S
arch/tile/kernel/head_64.S
arch/tile/kernel/intvec_32.S
arch/tile/kernel/intvec_64.S
arch/tile/kernel/stack.c