[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191028165519.GF4114@hirez.programming.kicks-ass.net>
Date: Mon, 28 Oct 2019 17:55:19 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Will Deacon <will@...nel.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, rostedt@...dmis.org,
mhiramat@...nel.org, bristot@...hat.com, jbaron@...mai.com,
torvalds@...ux-foundation.org, tglx@...utronix.de,
mingo@...nel.org, namit@...are.com, hpa@...or.com, luto@...nel.org,
ard.biesheuvel@...aro.org, jpoimboe@...hat.com, jeyu@...nel.org,
rabin@....in, Mark Rutland <mark.rutland@....com>,
james.morse@....com
Subject: Re: [PATCH v4 13/16] arm/ftrace: Use __patch_text_real()
On Mon, Oct 28, 2019 at 04:47:59PM +0000, Will Deacon wrote:
> On Mon, Oct 28, 2019 at 05:34:21PM +0100, Peter Zijlstra wrote:
> > On Mon, Oct 28, 2019 at 04:25:26PM +0000, Will Deacon wrote:
> > > On Fri, Oct 18, 2019 at 09:35:38AM +0200, Peter Zijlstra wrote:
> > > > @@ -97,10 +100,7 @@ static int ftrace_modify_code(unsigned l
> > > > return -EINVAL;
> > > > }
> > > >
> > > > - if (probe_kernel_write((void *)pc, &new, MCOUNT_INSN_SIZE))
> > > > - return -EPERM;
> > > > -
> > > > - flush_icache_range(pc, pc + MCOUNT_INSN_SIZE);
> > > > + __patch_text_real((void *)pc, new, patch_text_remap);
> > >
> > > Why can't you just pass 'true' for patch_text_remap? AFAICT, the only
> > > time you want to pass false is during early boot when the text is
> > > assumedly still writable without the fixmap.
> >
> > Ah, it will also become true for module loading once we rework where we
> > flip the module text RO,X. See this patch:
> >
> > https://lkml.kernel.org/r/20191018074634.858645375@infradead.org
> >
> > But for that to land, there's still a few other issues to fix (KLP).
>
> Passing 'true' would still work though, right? Just feels a bit error
> prone having to maintain the state of patch_test_remap() and remember
> that 'ftrace_lock' is holding the concurrency together.
It should, provided your fixmap stuff is working when we do the early
stuff I suppose. Module loading will be a wee bit slower too, but I'm
not the person to care about that.
Powered by blists - more mailing lists