From: Nicholas Piggin <npiggin@gmail.com>
To: Benjamin Herrenschmidt <benh@au1.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, Anton Blanchard <anton@samba.org>
Subject: Re: [RFC][PATCH] powerpc/64s: stop using r14 register
Date: Mon, 22 May 2017 10:29:05 +1000 [thread overview]
Message-ID: <20170522102905.32a5645f@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <1495404559.3092.140.camel@au1.ibm.com>
On Mon, 22 May 2017 08:09:19 +1000
Benjamin Herrenschmidt <benh@au1.ibm.com> wrote:
> On Mon, 2017-05-22 at 00:00 +1000, Nicholas Piggin wrote:
> > 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.
It's easy to drop the fixed r14 in future if we can. None of the
incidental asm users of r14 were complicating them by moving them
to another register.
Thanks,
Nick
next prev parent reply other threads:[~2017-05-22 0:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-21 14:00 [RFC][PATCH] powerpc/64s: stop using r14 register Nicholas Piggin
2017-05-21 22:09 ` Benjamin Herrenschmidt
2017-05-22 0:29 ` Nicholas Piggin [this message]
2017-05-22 4:02 ` Michael Ellerman
2017-05-30 19:08 ` Naveen N. Rao
2017-05-31 0:53 ` Nicholas Piggin
2017-05-31 5:55 ` Naveen N. Rao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170522102905.32a5645f@roar.ozlabs.ibm.com \
--to=npiggin@gmail.com \
--cc=anton@samba.org \
--cc=benh@au1.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).