Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5616177imu; Mon, 26 Nov 2018 03:03:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/XGVFId4iekAC1OEnCsI4WAYL9/iy2LiJZ3p4U6or3mrpG91zovA7XY1jOogJxKjnObLo6x X-Received: by 2002:a17:902:aa8c:: with SMTP id d12mr5135568plr.25.1543230216866; Mon, 26 Nov 2018 03:03:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543230216; cv=none; d=google.com; s=arc-20160816; b=Gfe552ePUs7zLTEvEs1/OPOYNRfcay51vOtFqV83NtZhCnM3On/SdCzqUdKlVOM3Zu rGcok98DIr5+oIGXpNUz5B8ciDRV2LTpAgl16BZseEYtQ/1PcGW6yEg/aKLnNKRQFKYg I+LfcPiubRrzq0hdmN6QaZI4RhP+WwxTaopEO0SruwftRgM8QGkGygAGLAksaGOucSnH O5o4KW5Xz1aUGe1JeIg51n2JYanXHRsR5b2q6a/sGLrcBXUeoGWAAO6HaDfA0fC1SPn0 12v4xigay2yy9p0Ti7S1+nCpni6QGEAMGpeivajtAOknPf0t5/O7cj+X6zF3qe3F9Nk2 xMhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KQVe8FSEt0Vh7wrfr7iUnTm2RuoErv0Sq6b7fa3aSHs=; b=AjasEv9KBo0MTg+OVKufZ3cbl6NCgsmfNEnlSr+njcmhYZCByPWA4HgZm9agqof8Ln tobgncEV/jvCpjsHov8pOTRKMo7u/7HmccqVFKZ/YTVLWpThH7ipaPRv+2ktZz24RFV6 B0K6wWGAdhfgj6rwhVqw/Pkcr8wE6ci6zVQA6Ch79lNm+ZdxJyIL/mmErVvqgHGU2MHo H7ELp1O91Y33tPHnNRKW/rwdWct+vd5tatcaMWsmWomldd6/VqnsZA+R1N6zBER1T9aB iTrSll8Z53lA7T3c4lO2C/5w7H7L6/XcEcXImE6sJlLb1hAVcr2vA8hMDtgsmOExP7q5 A/mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E472FXu9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si17130536pgm.339.2018.11.26.03.03.11; Mon, 26 Nov 2018 03:03:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E472FXu9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729850AbeKZVyO (ORCPT + 99 others); Mon, 26 Nov 2018 16:54:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:36210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728039AbeKZVyN (ORCPT ); Mon, 26 Nov 2018 16:54:13 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0719521473; Mon, 26 Nov 2018 11:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543230028; bh=pqbs+A/n3Ps2y/JjCrAdi6ZDxYcVwqKlHK17SJL89us=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E472FXu9aRBorOvkA0UobASNwgtdZfeBq8IS5kU3Gt19wmvdr1TJYAH4U7mc+ulON HWEulvTU1GW95ybZ3zwYy22k0WNsxA164mx/lVZAOLQ/RX/SFWsHZnFYnvkcHwmoFc v60sj77Vrfz36C/mxvN9rbL7OKlQuumWer0lGRwI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Jiri Olsa , Alexander Shishkin , Andi Kleen , Andy Lutomirski , Dave Hansen , "H. Peter Anvin" , Joerg Roedel , Peter Zijlstra , Thomas Gleixner , x86@kernel.org, Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.14 44/62] perf tools: Fix kernel_start for PTI on x86 Date: Mon, 26 Nov 2018 11:51:25 +0100 Message-Id: <20181126105054.151471165@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105050.592727680@linuxfoundation.org> References: <20181126105050.592727680@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ commit 19422a9f2a3be7f3a046285ffae4cbb571aa853a upstream. 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. Signed-off-by: Adrian Hunter Tested-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andy Lutomirski Cc: Dave Hansen Cc: H. Peter Anvin Cc: Joerg Roedel Cc: Peter Zijlstra Cc: Thomas Gleixner 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 Signed-off-by: Sasha Levin --- tools/perf/util/machine.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 2af879693fbe..af18c3d55642 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -2263,7 +2263,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; -- 2.17.1