Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3444523ybg; Mon, 28 Oct 2019 12:57:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsp3a/9lLZ+Hxf1JTBAVZ3GdbzK13J3lLjeXj9a4V8MQ6BY+guEz0jGT1Hjm8m6NoBB80J X-Received: by 2002:a50:f306:: with SMTP id p6mr9498025edm.284.1572292644670; Mon, 28 Oct 2019 12:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572292644; cv=none; d=google.com; s=arc-20160816; b=BhYLO+X61VuML8zK27ZFH4MNQPuI46oZYkNYYUO1ptf2dr8qWEU7DuV+e4AcyqRwCs gKN0iP+9DZT44AD1imZphEtek1c6yvFmAfp67Onon+PBsLmmtH5T/QYwaJX2kx4pPx8B 3v5deJD3Vmdtpe5h6/7AGdruayOb0hJeVEpyc4KuJmy9gJlRHpevNNw+rQuwQmT7220h hYoz0cUd0yxM7Vc5LUPO85fWCi+0M8lQfxOZ1HKcfj0/UaSwQb+UH5zGa8qY88XUTwFB vbrYCaVXKqSW5samxidDT7Knp3aLuLo5MN7OmpvM76WlgfZZGslkSSePmLyPx/DhuYzs WyUQ== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=FzeP4Mp3c1zxTzK9OQMFIU7f3MOmYgUVLVMfuT47FmY=; b=NZCt50VM12bagP4NtJJceLG1Jffsn/zcuv1F1SUMm0M7pmX7eYR3TV2QTlIJ3CBbDs R4XFygsJ7A2JU79cHLpWqFdw+6sHiePGtUM03mfeY3gHjhVsCkipUuMzJG+J2BpYzdMg Jx4+ycPoFcdIL02Gh71o6YKFHinPxL+Z8dKxCYrh2pxEmGdItdpFPWRUnTFUVOvPZny4 stpdyywjc9bUnACmOxLWMzbphbGHk0hrvl4pd+XA0pReJgj/EW0bvBFXiEulBOzxK/EE iDMCyn8SIPYLdCJngDMfGiYkAIGPzOrf9rHP+Zt+VPwt8WfIy2+uiFeQIhKiBgvQnYbT jkYw== ARC-Authentication-Results: i=1; mx.google.com; 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 g7si7735392edg.66.2019.10.28.12.57.00; Mon, 28 Oct 2019 12:57:24 -0700 (PDT) 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; 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 S2388573AbfJ1LmH (ORCPT + 99 others); Mon, 28 Oct 2019 07:42:07 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:44343 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729074AbfJ1LmG (ORCPT ); Mon, 28 Oct 2019 07:42:06 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iP3PA-0001G9-Ua; Mon, 28 Oct 2019 12:41:49 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 917951C0081; Mon, 28 Oct 2019 12:41:48 +0100 (CET) Date: Mon, 28 Oct 2019 11:41:48 -0000 From: "tip-bot2 for Kim Phillips" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf/x86/amd/ibs: Fix reading of the IBS OpData register and thus precise RIP validity Cc: Kim Phillips , "Peter Zijlstra (Intel)" , Alexander Shishkin , Arnaldo Carvalho de Melo , Arnaldo Carvalho de Melo , Borislav Petkov , "H. Peter Anvin" , Jiri Olsa , Linus Torvalds , Mark Rutland , Namhyung Kim , Stephane Eranian , Thomas Gleixner , Vince Weaver , Ingo Molnar , linux-kernel@vger.kernel.org In-Reply-To: <20191023150955.30292-1-kim.phillips@amd.com> References: <20191023150955.30292-1-kim.phillips@amd.com> MIME-Version: 1.0 Message-ID: <157226290832.29376.10682843753427923945.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/urgent branch of tip: Commit-ID: 317b96bb14303c7998dbcd5bc606bd8038fdd4b4 Gitweb: https://git.kernel.org/tip/317b96bb14303c7998dbcd5bc606bd8038fdd4b4 Author: Kim Phillips AuthorDate: Wed, 23 Oct 2019 10:09:54 -05:00 Committer: Ingo Molnar CommitterDate: Mon, 28 Oct 2019 11:01:59 +01:00 perf/x86/amd/ibs: Fix reading of the IBS OpData register and thus precise RIP validity The loop that reads all the IBS MSRs into *buf stopped one MSR short of reading the IbsOpData register, which contains the RipInvalid status bit. Fix the offset_max assignment so the MSR gets read, so the RIP invalid evaluation is based on what the IBS h/w output, instead of what was left in memory. Signed-off-by: Kim Phillips Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Borislav Petkov Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Linus Torvalds Cc: Mark Rutland Cc: Namhyung Kim Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Fixes: d47e8238cd76 ("perf/x86-ibs: Take instruction pointer from ibs sample") Link: https://lkml.kernel.org/r/20191023150955.30292-1-kim.phillips@amd.com Signed-off-by: Ingo Molnar --- arch/x86/events/amd/ibs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c index 5b35b7e..98ba21a 100644 --- a/arch/x86/events/amd/ibs.c +++ b/arch/x86/events/amd/ibs.c @@ -614,7 +614,7 @@ fail: if (event->attr.sample_type & PERF_SAMPLE_RAW) offset_max = perf_ibs->offset_max; else if (check_rip) - offset_max = 2; + offset_max = 3; else offset_max = 1; do {