Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp563945imm; Mon, 21 May 2018 10:24:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZohbrX9BHa2w5VgFJYpqm7jnUlARyoqv2CHf48mTWH+ea6ROvkdggQBbhpg4J5besNWvTAI X-Received: by 2002:a63:6fc8:: with SMTP id k191-v6mr16514134pgc.153.1526923446027; Mon, 21 May 2018 10:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526923445; cv=none; d=google.com; s=arc-20160816; b=zWcE/PdgveVD7MIdm74sqAQZybo1fIt+j3iXVaYz5PMExscUXBGqZk+F6hhXr4SzI4 PkQCsKuaWXovSSkuH/+3DlxbMVAjCclWBCqVaStet9i8JVRoKchPON6bhrcT5CFEz/X8 dXEqXiD1qZ/1KLh6qITk1INBuXCFn1K3vKuRp7nHmBcICCjcRiJmAIevaViyf7OTDGBI 4THOs90znvhDrFf9Mkp4pjLHkdzPz0NOqv/WvN/NgZfbgCfO+EJOcbtoJDORZrZQxGqy cDLGPKZpfTw8brJCDe1R3sDyjV0g4NY4BZBmONTtkbsHAZrWx1lPxlf82gjsBPcqLgtd FcPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=YpLBEj/v4j7SDvVjQKPbQfU0Zm+TTDA1CdT2F4RaQEI=; b=zP1SDu57YcUJFm1/hYKx41zK2u959A+IJDJJy6idDvGbs+W/mFdV4g5c1Gwb3T8OLP kQcVkpYXv6VRhy/f7dEo+wn4gq1Pk6pkInCrg2+ewbDI1d3JrBf+cex+RYoEk5jNgcRK 1MUhNJFsKGLpLXRJicWLGf4hiEs2H6Btdhc9/SjXBp/1ZwiSX2opEt9ckDT1K+2kbpk1 xYIiZkvB+qc6AfzWMyy8GZwvB7dq4S21VFyT01dDRadeEx3rYiK6f7uRAZwklenzuV0w IK0tte5pdQbxOAr2OobOXXsX0XIxEGtgfEotMGGHRgg9Yd/BoVbPtWY091yLWqRP9P7i m9Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=GXHmTUnB; 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 h8-v6si14603094pfh.278.2018.05.21.10.23.51; Mon, 21 May 2018 10:24:05 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=GXHmTUnB; 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 S1753235AbeEURXg (ORCPT + 99 others); Mon, 21 May 2018 13:23:36 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:39626 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753120AbeEURXe (ORCPT ); Mon, 21 May 2018 13:23:34 -0400 Received: by mail-pg0-f67.google.com with SMTP id e1-v6so6643636pga.6 for ; Mon, 21 May 2018 10:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=YpLBEj/v4j7SDvVjQKPbQfU0Zm+TTDA1CdT2F4RaQEI=; b=GXHmTUnBr0Rs9XM+Z2R6zBB+vYb+EnMGgNLQFVs6sQszOr5owOrRBtUp7ECunfH4K7 rR3jsfcMkZfAGBH2cdq60OPettkTLV4mPE+Ly3kUDBef2rMtQJXiv76DHg7u6uQzTK7+ yE8bLI5tPocsQN8/gXcmcokTzR1MeZesafZ5DM0l9tgcPbQpu4+zpAEfv0maxYxcpY0V n7OE5BJmWTGBGVYJ3uJpWTKZl+w1/jHzvnPVwNwDhign94E7nZoA6/74Tqy+hFKF+q9w EmMxihQOwaj6DHcVZ21CHM8Dun6hKm+75G4jYrl7kwDRNgIC9W3xvbTFQKZ1CfJ/Wkdx ma3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=YpLBEj/v4j7SDvVjQKPbQfU0Zm+TTDA1CdT2F4RaQEI=; b=JYMAl6Soz1hT5oF5lRHuKNdGZDYgGgkxOBRx26gZ2EfhSPA44BFgcaW8mQwKh8Ag9a J0y1PSTOhEj1ii936nXYYoSQsei8s+esabXuS5P/9wd1p0H3JxCxiHR7P6SSDxdMAFPW 3dRotAFR6VO5rpJ8k3lLyLjLDJLlkbkjdaKRDxIhZjiDhJ2cCYQt9bnOZwLnDgL/3jHL Gt5QLlm8UI2lhvOImLevXzHQJcyZJaTNqBJGZpXA/9fp0F7JSe94oXqlFhJhzDwXrLq/ GfjZw0TWxPnRpfscUv7xT/PSY+v1LOppxlGx17r/ZikaPR1/jGvLbb64n+t5Sp+y7jNt jBDA== X-Gm-Message-State: ALKqPwe/eSIkFs232OYU5Jbdy1DEbKAMIfKmsXnzyCuEXKTyfYVHX9wL gw8Xb2yN7MnsFCt9zEGU0SRZ99auGr0= X-Received: by 2002:a63:7f4b:: with SMTP id p11-v6mr15352465pgn.80.1526923413554; Mon, 21 May 2018 10:23:33 -0700 (PDT) Received: from ?IPv6:2600:1012:b007:97b1:4d6e:83f7:ffb7:f177? ([2600:1012:b007:97b1:4d6e:83f7:ffb7:f177]) by smtp.gmail.com with ESMTPSA id e5-v6sm27393395pfk.28.2018.05.21.10.23.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 10:23:32 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v2]: perf/x86: store user space frame-pointer value on a sample From: Andy Lutomirski X-Mailer: iPhone Mail (15E302) In-Reply-To: <36a2c137-8342-4ff4-ddcb-3ac1fe092810@linux.intel.com> Date: Mon, 21 May 2018 10:23:31 -0700 Cc: Peter Zijlstra , Andy Lutomirski , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Andi Kleen , linux-kernel , linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <31205dc8-b756-e12b-0249-2ed06c2db9c9@linux.intel.com> <20180509145436.GV12217@hirez.programming.kicks-ass.net> <3ecedd91-1c01-6fc5-4648-89eaf5ff0930@linux.intel.com> <20180510101406.GA12217@hirez.programming.kicks-ass.net> <0594eaea-0cab-ea04-c258-5f4770ffeee6@linux.intel.com> <71E4F816-7E0F-4984-B53C-06F8566EAB40@amacapital.net> <36a2c137-8342-4ff4-ddcb-3ac1fe092810@linux.intel.com> To: Alexey Budankov Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 21, 2018, at 9:51 AM, Alexey Budankov wrote: >=20 >=20 > Hi Andy, >> On 21.05.2018 17:14, Andy Lutomirski wrote: >>=20 >>> On May 21, 2018, at 5:44 AM, Alexey Budankov wrote: >>>=20 >>> Hi Peter, >>>=20 >>>> On 10.05.2018 13:14, Peter Zijlstra wrote: >>>> On Thu, May 10, 2018 at 12:42:38PM +0300, Alexey Budankov wrote: >>>>>> The Changelog needs to state that user_regs->bp is in fact valid and >>>>>=20 >>>>> That actually was tested on binaries compiled without and with BP expo= sed=20 >>>>> and in the latter case proved the value of that change. >>>>=20 >>>> Mostly works is not the same as 'always initialized', if there are entr= y >>>> paths that do not store that register, then using the value might leak >>>> values from the kernel stack, which would be bad. >>>>=20 >>>> But like said, I think much of the kernel entry code was sanitized with= >>>> the PTI effort and I suspect things are in fact fine now, but lets wait= >>>> for Andy to confirm. >>>=20 >>> It looks like, these days, all registers are saved on system calls, just= =20 >>> like you anticipated. >>>=20 >>> So BP register value might be stored into the Perf trace on a sample.=20= >>>=20 >>> Andy? >>=20 >> Hmm, I thought I replied. Yes, they are indeed all saved, but I=E2=80=99m= not very excited about committing to doing so forever. But storing BP shoul= d be fine. >=20 > Thanks for explicit confirmation regarding BP register. > BTW, do you see any mean to prevent possible unattended regression? > I guess it could be some compile time assertion or regression testing. Write a selftest? The whole perf user regs mechanism is buggy and fragile. I need to massively= clean it up at some point. >=20 > Thanks, > Alexey >=20 >>=20