linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andy Lutomirski <luto@amacapital.net>,
	Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [RFC][PATCH] x86/ftrace: Have ftrace trampolines turn read-only at the end of system boot up
Date: Fri, 1 May 2020 12:19:16 -0400	[thread overview]
Message-ID: <20200501121916.310942b8@gandalf.local.home> (raw)
In-Reply-To: <20200501151310.zo5bhnxpu5gubofj@treble>

On Fri, 1 May 2020 10:13:10 -0500
Josh Poimboeuf <jpoimboe@redhat.com> wrote:

> On Fri, May 01, 2020 at 09:24:04AM -0400, Steven Rostedt wrote:
> > On Fri, 1 May 2020 00:17:06 -0500
> > Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >   
> > > > Would it be easier to just call a new __text_poke_bp() which skips the
> > > > SYSTEM_BOOTING check, since you know the trampoline will always be
> > > > read-only?
> > > > 
> > > > Like:    
> > > 
> > > early_trace_init() is called after mm_init(), so I thought it might
> > > work, but I guess not:  
> > 
> > Yeah, I was about to say that this happens before mm_init() ;-)  
> 
> It happens *after* mm_init().  But now text_poke() has a dependency on
> poking_init(), has a dependency on proc_caches_init(), which has a
> dependency on kmem_cache_init_late(), etc.
> 
> So how early do you need early_trace_init()?  I'm assuming moving it to
> after kmem_cache_init_late() would be too late.

People have asked to move it even earlier. The point of having it early is
to allow tracing to debug early boot up.

> 
> > It's why we already have magic for enabling function tracing the first time.
> > 
> > Do you see anything wrong with this current solution? It probably needs
> > more comments, but I wanted to get acceptance on the logic before I go and
> > pretty it up and send a non RFC patch.  
> 
> Assuming we can't get text_poke() working earlier, it seems reasonable
> to me.
> 

Thanks.

Peter, what about you?

-- Steve

  reply	other threads:[~2020-05-01 16:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01  0:21 [RFC][PATCH] x86/ftrace: Have ftrace trampolines turn read-only at the end of system boot up Steven Rostedt
2020-05-01  4:47 ` Josh Poimboeuf
2020-05-01  5:17   ` Josh Poimboeuf
2020-05-01 13:24     ` Steven Rostedt
2020-05-01 15:13       ` Josh Poimboeuf
2020-05-01 16:19         ` Steven Rostedt [this message]
2020-05-01 17:29           ` Peter Zijlstra

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=20200501121916.310942b8@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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).