From: keescook@chromium.org (Kees Cook)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] coresight: Use %px to print pcsr instead of %p
Date: Mon, 9 Apr 2018 10:54:58 -0700 [thread overview]
Message-ID: <CAGXu5jKSj2V0mmKwXzQC_U+5d38Sfomy0Xpz18Dfoh1doXrF8w@mail.gmail.com> (raw)
In-Reply-To: <20180409161056.GA13134@leoy-ThinkPad-X240s>
On Mon, Apr 9, 2018 at 9:10 AM, Leo Yan <leo.yan@linaro.org> wrote:
> Hi Mathieu, Kees,
>
> On Fri, Apr 06, 2018 at 09:47:31AM -0600, Mathieu Poirier wrote:
>> On 5 April 2018 at 00:26, Kees Cook <keescook@chromium.org> wrote:
>> > On Tue, Mar 13, 2018 at 10:24 AM, Mathieu Poirier
>> > <mathieu.poirier@linaro.org> wrote:
>> >> From: Leo Yan <leo.yan@linaro.org>
>> >>
>> >> Commit ad67b74d2469 ("printk: hash addresses printed with %p") lets
>> >> printk specifier %p to hash all addresses before printing, this was
>> >> resulting in the high 32 bits of pcsr can only output zeros. So
>> >> module cannot completely print pc value and it's pointless for debugging
>> >> purpose.
>> >>
>> >> This patch fixes this by using %px to print pcsr instead.
>> >
>> > Why is %p (and now %px) needed here at all? %pS is already used, which
>> > should give useful debugging details, yes?
>>
>> Hey Leo,
>>
>> I've taken a second look at this and Kees has a point, %pS should be
>> sufficient here. Please test again and see if %px is absolutely
>> necessary. If you think that is the case please provide a snapshot of
>> the corner case that makes the change mandatory.
>
> Sorry I missed replying for this patch due to my email filter and
> thanks for suggestion.
>
> I can think out one case which should use %px: if CPU is locked up in
> firmwares (e.g. NS-EL2 or ARM-TF in S-EL3), we can rely on %px to read
> back PC hex value; for this case the CPU PC address is out of kernel
> space.
>
> How about you guys think for this?
Wouldn't %pS still give you a meaningful offset?
-Kees
--
Kees Cook
Pixel Security
next prev parent reply other threads:[~2018-04-09 17:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-13 17:24 [PATCH 0/2] coresight: next v4.16-rc5 Mathieu Poirier
2018-03-13 17:24 ` [PATCH 1/2] coresight: Use %px to print pcsr instead of %p Mathieu Poirier
2018-04-05 6:26 ` Kees Cook
2018-04-06 15:47 ` Mathieu Poirier
2018-04-09 16:10 ` Leo Yan
2018-04-09 17:54 ` Kees Cook [this message]
2018-04-09 23:44 ` Leo Yan
2018-03-13 17:24 ` [PATCH 2/2] coresight: etm4x: Fix bit shifting Mathieu Poirier
2018-03-14 16:59 ` [PATCH 0/2] coresight: next v4.16-rc5 Greg KH
2018-03-15 14:41 ` Mathieu Poirier
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=CAGXu5jKSj2V0mmKwXzQC_U+5d38Sfomy0Xpz18Dfoh1doXrF8w@mail.gmail.com \
--to=keescook@chromium.org \
--cc=linux-arm-kernel@lists.infradead.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).