perf tools: Fix kernel_start for PTI on x86
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 17 May 2018 09:21:54 +0000 (12:21 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 19 May 2018 09:42:51 +0000 (06:42 -0300)
Opickn x86_64, PTI entry trampolines are less than the start of kernel text,
but still above 2^63. So leave kernel_start = 1ULL << 63 for x86_64.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86@kernel.org
Link: http://lkml.kernel.org/r/1526548928-20790-7-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/machine.c

index 107bae7676b13a505fb08f7602088884924455b8..e011a7160380a437016f15bbe482383c81dc4974 100644 (file)
@@ -2321,7 +2321,12 @@ int machine__get_kernel_start(struct machine *machine)
        machine->kernel_start = 1ULL << 63;
        if (map) {
                err = map__load(map);
-               if (!err)
+               /*
+                * On x86_64, PTI entry trampolines are less than the
+                * start of kernel text, but still above 2^63. So leave
+                * kernel_start = 1ULL << 63 for x86_64.
+                */
+               if (!err && !machine__is(machine, "x86_64"))
                        machine->kernel_start = map->start;
        }
        return err;