linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mhiramat@kernel.org (Masami Hiramatsu)
To: linux-arm-kernel@lists.infradead.org
Subject: do page fault in atomic bug on arm
Date: Mon, 27 Nov 2017 10:40:34 +0900	[thread overview]
Message-ID: <20171127104034.205fc0b50e9bf9dafdcd05c7@kernel.org> (raw)
In-Reply-To: <08bb4658-5b62-e306-5aa8-366be25986ca@linaro.org>

On Sun, 26 Nov 2017 22:59:58 +0800
Alex Shi <alex.shi@linaro.org> wrote:

> cc mhiramat at kernel.org
> 
> Thanks a lot for look into this! :)
> 
> Regards
> Alex
> 
> On 11/25/2017 04:25 AM, Russell King - ARM Linux wrote:
> > On Fri, Nov 24, 2017 at 07:27:00PM +0000, Russell King - ARM Linux wrote:
> >> Adding Tixy, as he's more knowledgable in this area - I suggest
> >> someone knowledgable in this area runs
> >>
> >> 	ftracetest test.d/kprobe/multiple_kprobes.tc
> >>
> >> and fixes these bugs... also running the entire ftracetest suite
> >> would probably also be a very good idea.
> > 
> > There's some other stupidities as well:
> > 
> > trace_kprobe: Inserting kprobe at __error_lpae+0
> > trace_kprobe: Inserting kprobe at str_lpae+0
> > trace_kprobe: Inserting kprobe at __error_p+0
> > trace_kprobe: Inserting kprobe at str_p1+0
> > trace_kprobe: Inserting kprobe at str_p2+0
> > trace_kprobe: Could not insert probe at str_p2+0: -22
> > 
> > str_lpae: .asciz "\nError: Kernel with LPAE support, but CPU does not support LPAE.\n"
> > str_p1: .asciz  "\nError: unrecognized/unsupported processor variant (0x"
> > str_p2: .asciz  ").\n"
> > 
> > So we successfully placed a kprobe on some ASCII strings, which are
> > used prior to the kernel being properly up and running, which means
> > we have to use relative references to these strings, and relative
> > references to strings in other sections is not simple.

Oops, that's my mistake. It should pick only text symbols.

> > 
> > More worrying:
> > 
> > trace_kprobe: Inserting kprobe at __turn_mmu_on+0
> > trace_kprobe: Inserting kprobe at __idmap_text_start+0
> > trace_kprobe: Inserting kprobe at __turn_mmu_on_end+0
> > ...
> > trace_kprobe: Inserting kprobe at __idmap_text_end+0
> > ...
> > trace_kprobe: Inserting kprobe at secondary_startup+0
> > trace_kprobe: Inserting kprobe at secondary_startup_arm+0
> > trace_kprobe: Inserting kprobe at __secondary_switched+0
> > trace_kprobe: Inserting kprobe at __secondary_data+0
> > trace_kprobe: Inserting kprobe at __enable_mmu+0
> > trace_kprobe: Inserting kprobe at __do_fixup_smp_on_up+0
> > trace_kprobe: Inserting kprobe at __fixup_a_pv_table+0
> > trace_kprobe: Inserting kprobe at fixup_pv_table+0
> > trace_kprobe: Inserting kprobe at __lookup_processor_type+0
> > trace_kprobe: Inserting kprobe at __lookup_processor_type_data+0
> > 
> > These are definitely a no-no for tracing, because they're part of the
> > early startup code for the kernel when no stacks are available.

It should be rejected by kprobes arch dependent code.

> > Some of these can't live in the special "do not use kprobes here"
> > section as they need to be in other sections (like .idmap) because
> > they need to be part of the identity-mapped code.

kprobes already has a blacklist on x86, so it is a good time to start
making it on arm/arm64 too.

Thank you,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2017-11-27  1:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 13:06 do page fault in atomic bug on arm Alex Shi
2017-11-21 13:20 ` Russell King - ARM Linux
2017-11-24 15:09   ` Alex Shi
2017-11-24 15:56     ` Russell King - ARM Linux
2017-11-26 14:58       ` Alex Shi
2017-11-26 15:23         ` Alex Shi
2017-11-24 19:27     ` Russell King - ARM Linux
2017-11-24 20:25       ` Russell King - ARM Linux
2017-11-24 22:20         ` Russell King - ARM Linux
2017-11-26 15:02           ` Alex Shi
2017-11-26 14:59         ` Alex Shi
2017-11-27  1:40           ` Masami Hiramatsu [this message]
2017-11-27 13:36             ` Andrew Lunn
2017-11-27 13:55               ` Russell King - ARM Linux
2017-11-28  5:52                 ` Masami Hiramatsu
2017-11-28  9:52                   ` Russell King - ARM Linux
2017-11-30  2:41                     ` Masami Hiramatsu
2017-11-26 12:07       ` Alex Shi
2017-11-27  1:34         ` Masami Hiramatsu

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=20171127104034.205fc0b50e9bf9dafdcd05c7@kernel.org \
    --to=mhiramat@kernel.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).