From: Balbir Singh <bsingharora@gmail.com>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org,
"Gautham R . Shenoy" <ego@linux.vnet.ibm.com>,
"Shreyas B. Prabhu" <shreyasbp@gmail.com>
Subject: Re: [PATCH] powerpc/64s: relocation, register save fixes for system reset interrupt
Date: Fri, 14 Oct 2016 16:45:24 +1100 [thread overview]
Message-ID: <e637b3ee-ffd1-97c0-9362-b163e74a0892@gmail.com> (raw)
In-Reply-To: <20161014141610.418d0cc4@roar.ozlabs.ibm.com>
On 14/10/16 14:16, Nicholas Piggin wrote:
> Thanks Balbir and Gautham for testing and reviewing.
>
> On Thu, 13 Oct 2016 22:54:32 +1100
> Balbir Singh <bsingharora@gmail.com> wrote:
>
>> On 13/10/16 13:17, Nicholas Piggin wrote:
>>> This patch does a couple of things. First of all, powernv immediately
>>> explodes when running a relocated kernel, because the system reset
>>> exception for handling sleeps does not do correct relocated branches.
>>>
>>> Secondly, the sleep handling code trashes the condition and cfar
>>> registers, which we would like to preserve for debugging purposes (for
>>> non-sleep case exception).
>>
>> Agreed, that is a good side, we also save the PPR in r9 and set the
>> PPR to HMT_MEDIUM
>>
>>>
>>> This patch changes the exception to use the standard format that saves
>>> registers before any tests or branches are made. It adds the test for
>>> idle-wakeup as an "extra" to break out of the normal exception path.
>>> Then it branches to a relocated idle handler that calls the various
>>> idle handling functions.
>>>
>>> After this patch, POWER8 CPU simulator now boots powernv kernel that is
>>> running at non-zero.
>>>
>>
>> Yep, a much required fixup. I had done a version before your changes
>
> Yeah, I didn't mean to push ahead of your patch -- I was halfway through
> writing the register save patch when I realized yours did not get merged
> yet. Credit to you for originally finding and fixing it.
>
No problems with that
>>
>>> Cc: Balbir Singh <bsingharora@gmail.com>
>>> Cc: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
>>> Cc: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
>>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>>> ---
>>> arch/powerpc/include/asm/exception-64s.h | 16 ++++++++++
>>> arch/powerpc/kernel/exceptions-64s.S | 50 ++++++++++++++++++--------------
>>> 2 files changed, 45 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
>>> index 2e4e7d8..84d49b1 100644
>>> --- a/arch/powerpc/include/asm/exception-64s.h
>>> +++ b/arch/powerpc/include/asm/exception-64s.h
>>> @@ -93,6 +93,10 @@
>>> ld reg,PACAKBASE(r13); /* get high part of &label */ \
>>> ori reg,reg,(FIXED_SYMBOL_ABS_ADDR(label))@l;
>>>
>>> +#define __LOAD_HANDLER(reg, label) \
>>
>> I wonder if it is a good idea to trap
>>
>> .if (reg == 13);
>> .error "Don't use r13";
>> .abort;
>> .endif;
>
> Well... I guess checking is always nice, but r13 is taboo for anything but paca
> for virtually all assembly in the kernel. So I don't know if the benefit is very
> large.
>
The thing with macros that take arguments is that there is no indication whats
OK and whats not. You are right r13 is taboo, but we could probably still use
r13 and do a GET_PACA() later, like we did earlier, so lets drop this
> Now a scripted test to check the objdump might be nice. You could whitelist the few
> places that set r13, and then give errors for any other code that sets it.
>
Good idea
Balbir Singh
next prev parent reply other threads:[~2016-10-14 5:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 2:17 [PATCH] powerpc/64s: relocation, register save fixes for system reset interrupt Nicholas Piggin
2016-10-13 11:02 ` Gautham R Shenoy
2016-10-13 11:54 ` Balbir Singh
2016-10-14 3:16 ` Nicholas Piggin
2016-10-14 5:45 ` Balbir Singh [this message]
2016-10-27 11:38 ` Michael Ellerman
2016-10-28 12:01 ` Balbir Singh
2016-11-02 6:04 ` [PATCH] " Mahesh Jagannath Salgaonkar
2016-11-02 6:57 ` Nicholas Piggin
2016-11-02 8:24 ` Mahesh J Salgaonkar
2016-11-02 8:36 ` Nicholas Piggin
2016-11-02 8:45 ` Gautham R Shenoy
2016-11-03 5:21 ` Nicholas Piggin
2016-11-03 5:56 ` Shreyas B. Prabhu
2016-11-03 6:17 ` Nicholas Piggin
2016-11-03 6:32 ` Shreyas B. Prabhu
2016-11-03 7:02 ` Nicholas Piggin
2016-11-04 9:04 ` Gautham R Shenoy
2016-11-04 11:47 ` Nicholas Piggin
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=e637b3ee-ffd1-97c0-9362-b163e74a0892@gmail.com \
--to=bsingharora@gmail.com \
--cc=ego@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
--cc=shreyasbp@gmail.com \
/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).