Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3798516imm; Mon, 18 Jun 2018 04:22:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKox+o2vuqqxgBB2M08b2/A68WnFWTwyuimscTCvz4l3TgNwIfFztS/r/i/4p4tiEHQ3zaK X-Received: by 2002:a62:3994:: with SMTP id u20-v6mr13182725pfj.95.1529320948037; Mon, 18 Jun 2018 04:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529320948; cv=none; d=google.com; s=arc-20160816; b=OtUW3DPh7kTA2wltvEB0JhMPTSk3C5HEXda6z6rBqnXmEaVnNasl1w3D/rBJycpOC2 hQssDoVygLIyJ7hWFYG5SArY/NT7AlGBLTZxvVi0m7Ugew3yDSV8YfkqBg9v5V+i7TBL l3sAQZ7I5M48EjtgHbmpwWtsRwLA2xAt3ZWrPMF4yKYBnYefwDbIXIWI4cogomwr+pzQ ZMmfGyQmG1Ic0VH2VEUeGJyV5SUIXwk5fr9jmI7DyYqzHrpu7bbsoqvaeEO2kJ4v1Bbw wrxijHzQNfo17BiE2LPCC3uzfA93RoXJQ/j98N0hhzdjaiY8JgVR/QlUd7aUqwAhLlmv QmFQ== 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=LDycdvsS6IWs4GMxyCn79FrnC51QOu9SYF5TU829ao8=; b=WxkTU1FSnBqeOdFR3CYrB9i7Zq1uNB78Jdq3AF2kitD6DY8g93mX6kQ1O1BiBwJrY1 DS39ABrTrdWkgptcQPrfEGPFN55Op1KqQ7kNdloc8zdSEnKaNSFQlZ87eteONwfJfPVh 96XYFwVHGN/mAmvMfYObTYTZjzEMbQ2C6WP/OXXyabrHFgOR0BuIC/Ny7aNYjHP0SXPj U7HWUTQ2CeFJiQYfAMn4zoC9OeB3ObrbVP00ERbn48xTIO3ExND6n+WX783Lc0F4ksMD tn3ixots1Ycct9GqJZW3FGEiZlRm+AbMAIg7tbM2rR0uue4u1s1JRusTxGvuYV4yC4xb CMfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dV6qzy88; 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 r59-v6si14541468plb.187.2018.06.18.04.22.14; Mon, 18 Jun 2018 04:22:28 -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=bombadil.20170209 header.b=dV6qzy88; 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 S934763AbeFRKl6 (ORCPT + 99 others); Mon, 18 Jun 2018 06:41:58 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48640 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933488AbeFRKl5 (ORCPT ); Mon, 18 Jun 2018 06:41:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=LDycdvsS6IWs4GMxyCn79FrnC51QOu9SYF5TU829ao8=; b=dV6qzy886PrU5Z87sJwlbQi3V hg/FQK0dKJxjrhqZFP6jZX3OdTAAhBtC7cYPctSJKHNKJHYSDloPghTGLlvEHKOV8tbOvzLgvNndO aE5+p2cTWEDke287jTpmS1uJAuXqo7jSgHJgLmQH1Pz7KTkJn5eYZzBIs06ikSwjKfOEz96ES6CkA 0WslyQiTu/tLOq98vxTLV6LLi3ImwY/UZv6Xi36/jCS+TWNaJDDyuAERAK0jmej5I2JqAr/n3TnD9 9OlTq9MxV416K2Hncj8YfxmRDPNsfwlBssYN+3MRpe7VIT+NmjizM1BGkpBEuQmMUs2g776FU+6vO OXBpLR1Qw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fUrbb-0006R6-4x; Mon, 18 Jun 2018 10:41:51 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4F5B92029FA11; Mon, 18 Jun 2018 12:41:49 +0200 (CEST) Date: Mon, 18 Jun 2018 12:41:49 +0200 From: Peter Zijlstra To: "Liang, Kan" Cc: Stephane Eranian , "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 , "Jin, Yao" Subject: Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples Message-ID: <20180618104149.GH2458@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> <20180615081656.GC2458@hirez.programming.kicks-ass.net> <37D7C6CF3E00A74B8858931C1DB2F07753939C70@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F07753939C70@SHSMSX103.ccr.corp.intel.com> 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 Fri, Jun 15, 2018 at 01:31:34PM +0000, Liang, Kan wrote: > > 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. > > I think the large PEBS still need to be specially handled. large pebs should be fine too, all pebs stuff eventually calls perf_event_output() with a synthesized register set.