[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180510201922.GE4311@kernel.org>
Date: Thu, 10 May 2018 17:19:22 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: "Hunter, Adrian" <adrian.hunter@...el.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, Andi Kleen <ak@...ux.intel.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Joerg Roedel <joro@...tes.org>, Jiri Olsa <jolsa@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH RFC 07/19] perf tools: Workaround missing maps for x86_64
KPTI entry trampolines
Em Thu, May 10, 2018 at 05:15:42PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, May 10, 2018 at 07:08:37PM +0000, Hunter, Adrian escreveu:
> > > -----Original Message-----
> > > From: Arnaldo Carvalho de Melo [mailto:acme@...nel.org]
> > > Sent: Wednesday, May 9, 2018 8:07 PM
> > > To: Hunter, Adrian <adrian.hunter@...el.com>
> > > Cc: Thomas Gleixner <tglx@...utronix.de>; Ingo Molnar
> > > <mingo@...hat.com>; Peter Zijlstra <peterz@...radead.org>; Andy
> > > Lutomirski <luto@...nel.org>; H. Peter Anvin <hpa@...or.com>; Andi Kleen
> > > <ak@...ux.intel.com>; Alexander Shishkin
> > > <alexander.shishkin@...ux.intel.com>; Dave Hansen
> > > <dave.hansen@...ux.intel.com>; Joerg Roedel <joro@...tes.org>; Jiri Olsa
> > > <jolsa@...hat.com>; linux-kernel@...r.kernel.org; x86@...nel.org
> > > Subject: Re: [PATCH RFC 07/19] perf tools: Workaround missing maps for
> > > x86_64 KPTI entry trampolines
> > >
> > > Em Wed, May 09, 2018 at 02:43:36PM +0300, Adrian Hunter escreveu:
> > > > On x86_64 the KPTI entry trampolines are not in the kernel map created
> > > > by perf tools. That results in the addresses having no symbols and
> > > > prevents annotation. It also causes Intel PT to have decoding errors
> > > > at the trampoline addresses. Workaround that by creating maps for the
> > > trampolines.
> > > > At present the kernel does not export information revealing where the
> > > > trampolines are. Until that happens, the addresses are hardcoded.
> > > >
> > > > Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
> > > > ---
> > > > tools/perf/util/machine.c | 104
> > > ++++++++++++++++++++++++++++++++++++++++++++++
> > > > tools/perf/util/machine.h | 3 ++
> > > > tools/perf/util/symbol.c | 12 +++---
> > > > 3 files changed, 114 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
> > > > index 22047ff3cf2a..1bf15aa0b099 100644
> > > > --- a/tools/perf/util/machine.c
> > > > +++ b/tools/perf/util/machine.c
> > > > @@ -851,6 +851,110 @@ static int
> > > machine__get_running_kernel_start(struct machine *machine,
> > > > return 0;
> > > > }
> > > >
> > > > +struct special_kernal_map {
> > >
> > > s/kernal/kernel/
> > >
> > > And "special"?
> >
> > I have added comment:
> >
> > /* Kernel-space maps that are not the main kernel map nor a module map */
>
> Perhaps:
>
> /* Kernel-space maps for symbols that are outside the main kernel map and module maps */
>
> struct extra_kernel_map;
>
> What do you think?
>
> > And fixed kernal, and changed machine__is()
>
> Thanks
>
> > Revised patch set is here:
> >
> > http://git.infradead.org/users/ahunter/linux-perf.git/shortlog/refs/heads/perf-tools-kpti
> >
> > which is the perf-tools-kpti branch of:
> >
> > git://git.infradead.org/users/ahunter/linux-perf.git
> >
> > Let me know if you want me to post the workaround patches separately,
> > otherwise I will wait a bit before sending the patches again.
>
> I'll see if I went thru all of the patches already...
So I looked at the patches posted and one comment is about the terse
commit logs for some of the kcore_copy patches, for instance:
--------------------
In preparation to add more program headers, get rid of kernel_map and
modules_map.
--------------------
Can't this be made a bit more verbose? Lemme re-read the patch...
- Arnaldo
Powered by blists - more mailing lists