Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp504060imm; Fri, 15 Jun 2018 01:18:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKjyCowXSguTzQ7VKgUtn0losFatZPFwXdje6+w5UY9iMCjjGRHE9NlH7wcPhuAYXhm9dja X-Received: by 2002:a63:3c4b:: with SMTP id i11-v6mr649811pgn.414.1529050684700; Fri, 15 Jun 2018 01:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529050684; cv=none; d=google.com; s=arc-20160816; b=tExI1as3xcAE/fBKwb53XFkv1rXNoC6hT4TDGjLc/56MqWLdElNfDwkyVqwJqg8BnR aVI/GU5+nkX94XvClgzHHQ9sX7YIIdgWTUKxJC5EG0Ca8eJW1VT1cWBxN6qxrSMSf2ai Lhxg6MFXpNkiyYg290SCWQxaQLwW9Q5hAcH1l4Z/tlXXKX2h8IMx2BCJ1uOdLpWPiXEX QLUH1Wh3TjRielY82A/qXOyrqZuoE87NOqkSFLnCjXdR5B9PGBRfQiAq9Yrp5bokRJGE YZrS9zzzBTfyNYkcBFeoIcBYnO5x1M9NkVuBjpNW0GajJ3LWu6t0/jQkFHpT7F5VOzo4 d7LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=pv6C0oexGS7w9Sc6SpYeYAOyQn+821H77ADzNCTiFpI=; b=lJBCUxl5eaKDT5Yb8qSo+egNPOPPU25PyyxxhH2mt+P41BMTkHjkZ3t8TF4aILVWNT sS1lGRbWsUThgH1ND+6Lb4VIRmpqfzF8D4rTcFV7tGKak7GWi04jiGxC6EcAN+WgJfC5 /MFJ5MQZQhxNAIYJ7WW/CcypB8dD/yoblje/6kJYv5zUhXtS0iNIihG4f5Sxv3Z1QTNm zWT0rUrIMRm9rvnK3yYMde2KB7uBqC9j2ZOk11vmn/RYXg5ULvkRamgfmAH17qAyRsCr 3f6nLbs4hqek44gwp/iuVct8QAvMGIPsOGBIm0/Vb0ijLFsPEXoGXe6/FgkYztdUqq8Y jDAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="B7a/Y849"; 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 33-v6si7436751plq.348.2018.06.15.01.17.50; Fri, 15 Jun 2018 01:18:04 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b="B7a/Y849"; 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 S1756025AbeFOIRO (ORCPT + 99 others); Fri, 15 Jun 2018 04:17:14 -0400 Received: from merlin.infradead.org ([205.233.59.134]:51174 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755847AbeFOIRM (ORCPT ); Fri, 15 Jun 2018 04:17:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pv6C0oexGS7w9Sc6SpYeYAOyQn+821H77ADzNCTiFpI=; b=B7a/Y849j+NBtKsXvUsJEXRPm 2454s26kelEdput/IjE5KDYq2wiKscipGYfXhdNcXCdfPQXlmImh5R7gQjNPTeHb7PtNMf1NT6l1G T7NyGq2AfwtfVk3xdi4cDx88f0vLvfdp8GfQ6fO1oRjxs75j8gvoS5TyGV00mK8dFequAE8rg1Sbp vBXSX1lcm8uv44d7OUwFYs6Gypy8AQQgpj50qQhRsmbNZtSOEvrZv1EyPu8YLOjeU0UG5PuY958EP V2jF6fsHqj2fNfRl0hYjWqLI2eNe3mSizOLM+Fp39Ff0Ng0fMPDu/HPzURKUn6LmPtkiczWhPy9PN btAM4+MXQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTjuk-0003oS-DT; Fri, 15 Jun 2018 08:16:58 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 17B892029FA0D; Fri, 15 Jun 2018 10:16:56 +0200 (CEST) Date: Fri, 15 Jun 2018 10:16:56 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: yao.jin@linux.intel.com, Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Alexander Shishkin , me@kylehuey.com, LKML , Vince Weaver , Will Deacon , Namhyung Kim , Andi Kleen , "Liang, Kan" , "Jin, Yao" Subject: Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples Message-ID: <20180615081656.GC2458@hirez.programming.kicks-ass.net> References: <1529057003-2212-1-git-send-email-yao.jin@linux.intel.com> <1529057003-2212-2-git-send-email-yao.jin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 14, 2018 at 11:02:53PM -0700, Stephane Eranian wrote: > On Thu, Jun 14, 2018 at 7:10 PM Jin Yao wrote: > > + /* > > + * Due to interrupt latency (AKA "skid"), we may enter the > > + * kernel before taking an overflow, even if the PMU is only > > + * counting user events. > > + * To avoid leaking information to userspace, we must always > > + * reject kernel samples when exclude_kernel is set. > > + */ > > + if (event->attr.exclude_kernel && !user_mode(regs)) > > + return false; > > + > And how does that filter PEBS or LBR records? I suspect the user_mode() thing actually covers PEBS, but yes LBR might need additional filtering.