From: Jiri Olsa <jolsa@redhat.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Andy Lutomirski <luto@kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>, Andi Kleen <ak@linux.intel.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Joerg Roedel <joro@8bytes.org>,
linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH V1 10/19] perf tools: Create maps for x86 PTI entry trampolines
Date: Wed, 16 May 2018 13:06:56 +0200 [thread overview]
Message-ID: <20180516110656.GB25591@krava> (raw)
In-Reply-To: <1526388213-30696-11-git-send-email-adrian.hunter@intel.com>
On Tue, May 15, 2018 at 03:43:24PM +0300, Adrian Hunter wrote:
SNIP
> +int machine__create_extra_kernel_map(struct machine *machine,
> + struct dso *kernel,
> + struct extra_kernel_map *xm)
> {
> struct kmap *kmap;
> struct map *map;
> @@ -923,9 +915,33 @@ static u64 find_entry_trampoline(struct dso *dso)
> int machine__map_x86_64_entry_trampolines(struct machine *machine,
> struct dso *kernel)
> {
> - u64 pgoff = find_entry_trampoline(kernel);
> + struct map_groups *kmaps = &machine->kmaps;
> + struct maps *maps = &kmaps->maps;
> int nr_cpus_avail = 0, cpu;
> + bool found = false;
> + struct map *map;
> + u64 pgoff;
> +
> + /*
> + * In the vmlinux case, pgoff is a virtual address which must now be
> + * mapped to a vmlinux offset.
> + */
> + for (map = maps__first(maps); map; map = map__next(map)) {
> + struct kmap *kmap = __map__kmap(map);
> + struct map *dest_map;
> +
> + if (!kmap || !is_entry_trampoline(kmap->name))
> + continue;
> +
> + dest_map = map_groups__find(kmaps, map->pgoff);
> + if (dest_map != map)
> + map->pgoff = dest_map->map_ip(dest_map, map->pgoff);
> + found = true;
hum, could you please explain/comment on above? the purpose of pgoff for these maps
all the trampoline maps seems to have the same pgoff at the end..
0 0x158 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe0000006000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x1b0 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe0000032000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x208 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe000005e000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x260 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe000008a000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x2b8 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe00000b6000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x310 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe00000e2000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x368 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe000010e000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x3c0 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe000013a000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x418 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe0000166000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x470 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe0000192000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x4c8 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe00001be000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x520 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe00001ea000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x578 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe0000216000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x5d0 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe0000242000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x628 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe000026e000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x680 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe000029a000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x6d8 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe00002c6000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x730 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe00002f2000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x788 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe000031e000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x7e0 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe000034a000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x838 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe0000376000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x890 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe00003a2000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x8e8 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe00003ce000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
0 0x940 [0x58]: PERF_RECORD_MMAP -1/0: [0xfffffe00003fa000(0x1000) @ 0xffffffff8fc02000]: x __entry_SYSCALL_64_trampoline
thanks,
jirka
next prev parent reply other threads:[~2018-05-16 11:07 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-15 12:43 [PATCH V1 00/19] perf tools and x86 PTI entry trampolines Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 01/19] kallsyms: Simplify update_iter_mod() Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 02/19] kallsyms, x86: Export addresses of syscall trampolines Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 03/19] x86: Add entry trampolines to kcore Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 04/19] x86: kcore: Give entry trampolines all the same offset in kcore Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 05/19] perf tools: Use the _stest symbol to identify the kernel map when loading kcore Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 06/19] perf tools: Fix kernel_start for PTI on x86 Adrian Hunter
2018-05-16 13:00 ` Arnaldo Carvalho de Melo
2018-05-16 13:45 ` Adrian Hunter
2018-05-16 13:55 ` Arnaldo Carvalho de Melo
2018-05-16 18:16 ` Adrian Hunter
2018-05-16 18:38 ` Arnaldo Carvalho de Melo
2018-05-15 12:43 ` [PATCH V1 07/19] perf tools: Workaround missing maps for x86 PTI entry trampolines Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 08/19] perf tools: Fix map_groups__split_kallsyms() for entry trampoline symbols Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 09/19] perf tools: Allow for extra kernel maps Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 10/19] perf tools: Create maps for x86 PTI entry trampolines Adrian Hunter
2018-05-16 11:06 ` Jiri Olsa [this message]
2018-05-16 11:37 ` Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 11/19] perf tools: Synthesize and process mmap events " Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 12/19] perf buildid-cache: kcore_copy: Keep phdr data in a list Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 13/19] perf buildid-cache: kcore_copy: Keep a count of phdrs Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 14/19] perf buildid-cache: kcore_copy: Calculate offset from phnum Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 15/19] perf buildid-cache: kcore_copy: Layout sections Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 16/19] perf buildid-cache: kcore_copy: Iterate phdrs Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 17/19] perf buildid-cache: kcore_copy: Get rid of kernel_map Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 18/19] perf buildid-cache: kcore_copy: Copy x86 PTI entry trampoline sections Adrian Hunter
2018-05-15 12:43 ` [PATCH V1 19/19] perf buildid-cache: kcore_copy: Amend the offset of sections that remap kernel text Adrian Hunter
2018-05-16 12:50 ` [PATCH V1 00/19] perf tools and x86 PTI entry trampolines Jiri Olsa
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=20180516110656.GB25591@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.