Thread (7 messages) 7 messages, 4 authors, 2017-05-31

Re: [RFC][PATCH] powerpc/64s: stop using r14 register

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-05-22 04:02:09

Nicholas Piggin [off-list ref] writes:
On Mon, 22 May 2017 08:09:19 +1000
Benjamin Herrenschmidt [off-list ref] wrote:
quoted
On Mon, 2017-05-22 at 00:00 +1000, Nicholas Piggin wrote:
quoted
I'd like to take over the r14 register for use as a per-cpu kernel
register similar to the way r13 is used for the paca.  
Why not use r13 instead ? We don't need to access the PACA that often
from C code, I thought we could flip them...
It ended up being a bit too tricky to do it that way. We can't get
directly to per-CPU data from the per-cpu data offset in exception
entry code for a number of reasons. So we end up having to load the
paca first.

I looked at swapping r13 from paca to per-cpu offset at the same
time the stack is set up, so paca is used for early save areas then
per-cpu is used in C code. In practice it ended up getting too
tricky and fragile dealing with nested interrupts, machine checks,
etc.

I think it's something we might slowly work towards (consolidating
back to one fixed register), but as things are it didn't work well.
Yep, agree 100%.

We've talked about flipping r13 for 10 years, rather than spending
another 10 this is a good way to evolve things in the right direction.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help