From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756429AbcASQaf (ORCPT ); Tue, 19 Jan 2016 11:30:35 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:53545 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754334AbcASQa0 (ORCPT ); Tue, 19 Jan 2016 11:30:26 -0500 Date: Tue, 19 Jan 2016 17:30:20 +0100 From: Peter Zijlstra To: kan.liang@intel.com Cc: acme@kernel.org, eranian@google.com, ak@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 1/8] perf: Add PERF_SAMPLE_PHYS_ADDR Message-ID: <20160119163020.GJ6344@twins.programming.kicks-ass.net> References: <1452173440-10697-1-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452173440-10697-1-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 07, 2016 at 08:30:33AM -0500, kan.liang@intel.com wrote: > From: Kan Liang > > For understanding how the workload maps to memory channels and hardware > behavior, it's useful to collect address maps with physical addresses. > This is not intended for detecting page sharing (which can be already > done using the mmap inode), but for lower level hardware behavior > studies. This patch set completely lacks any useful example for why we should entertain this. > @@ -8269,6 +8275,11 @@ SYSCALL_DEFINE5(perf_event_open, > return -EINVAL; > } > > + /* Only privileged users can get kernel addresses */ > + if ((attr.sample_type & PERF_SAMPLE_PHYS_ADDR) && > + !capable(CAP_SYS_ADMIN)) > + return -EACCES; > + should that not also include a perf_paranoid_kernel() test?