[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200501121916.310942b8@gandalf.local.home>
Date: Fri, 1 May 2020 12:19:16 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Andy Lutomirski <luto@...capital.net>,
Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [RFC][PATCH] x86/ftrace: Have ftrace trampolines turn read-only
at the end of system boot up
On Fri, 1 May 2020 10:13:10 -0500
Josh Poimboeuf <jpoimboe@...hat.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@...hat.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
Powered by blists - more mailing lists