Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5280953imm; Tue, 26 Jun 2018 08:41:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLecMbfXgHJFoFN70S9htbjQu/PHs1qO/03hJ/8ynPEtUcJeScLFxn4Xj2D+PW1CAPpsQtg X-Received: by 2002:a17:902:2c83:: with SMTP id n3-v6mr2124711plb.211.1530027684406; Tue, 26 Jun 2018 08:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530027684; cv=none; d=google.com; s=arc-20160816; b=H5MsFaWIhGi4o+Q5CaOLeG+7bVfc2s1+BfSc2gdrnGPlsCPQSg9N1ouKAm4Tly9dI0 /3o/MgHuBo9DiIChnuKx2ehUZ5Y3KDs1eQG5qDE5DnkIHkL9+BIjWOEcw65BIkyRD5lu 4szwa5uTud98lV2HAyV1nwlrpf9O0wjCh/vKqCPqyQjrLGTi6p8zSduWRrImS1BUWT7L 7Mvp+paaZIwrM7BRWgbHshW+t0NW8xVq+ryGeOQciE8eMrGyLc2QvGnJh9nTf5X+tYY0 JgFC4nRyOR4vGlJLjtp/iPKzEWHq11LJgioYMOZRMKMFmnV4f2TChJO08tMUBKSm0HxI 3s4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=TnyDPwlhFnYJWpAuAR/kdT6H9t0g4ev/rss4zkCF3K8=; b=cPf+mCuRChG2rsHnEsU6IEz7XBjb69lbwRXUspO5OEgIjVGHBaKMZSA8o4BLhKPVTr TEQIYfLqbqNUzGIDRKxzIhSrcbBTHilLBqbEVwhsab2ADTihR4LAY0ROpmJjgeUwic23 F0q5amMVZGYCLsLacag+BeZM1+oAmQO11/2WdLJnAFZzScYUXty9JuDxfEskt34GNUhL xGbwjxnDanY5+KaOvhSjzdv7OVSNIGCDsIPGGrepeinVex8BWsEj00qcgBLmTcI/fBzM 7gc9jl6pcyr7mmfdlPCCaH60qP/7koUS2uFFxb0xRaZbmZHuQAevHIm6HyKPU0NFkoXK N1gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ursulin-net.20150623.gappssmtp.com header.s=20150623 header.b=E3A6gkw3; 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 43-v6si1863941pla.362.2018.06.26.08.41.09; Tue, 26 Jun 2018 08:41: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; dkim=pass header.i=@ursulin-net.20150623.gappssmtp.com header.s=20150623 header.b=E3A6gkw3; 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 S1752109AbeFZPhS (ORCPT + 99 others); Tue, 26 Jun 2018 11:37:18 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35635 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751144AbeFZPhR (ORCPT ); Tue, 26 Jun 2018 11:37:17 -0400 Received: by mail-wm0-f65.google.com with SMTP id z137-v6so2356954wmc.0 for ; Tue, 26 Jun 2018 08:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=TnyDPwlhFnYJWpAuAR/kdT6H9t0g4ev/rss4zkCF3K8=; b=E3A6gkw3aCFnXmsaI0r2PIn0I/zdA//00Hg5qVXrUynRgFl8VMdvf9L5UvCERRvk0j V0DThrVEwYV6fPEZxHb+UrmRC8Bo8zo2dj1dfdMfnW0ae4Tqoqq2PUCsoxWhYKM5t69y qe8iPSXcjuWXz9idKVG2Vj4YS9lcYNJUfuji/jnVlMpWM6yTOyO4xcnlHc9b+iXQZ/SE Es+50SJhAtSiGai/mXMUk3mwgHXYHL31Ua8LXACGfX3hA9P6S1ITvreWaMVas+D26C3T HbSBwDlyNAoXzHJJIy2f6qRdIVDIuymku4SU2TRHUuYalPAoLX9dnU1H9s6te8GlLbJx Da6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TnyDPwlhFnYJWpAuAR/kdT6H9t0g4ev/rss4zkCF3K8=; b=CThNxk2SoULZoM142ekrQKq8mghksN0VR9RT2Kh77nfsRf7fxHmAKyERsa+0Xjm6bo 1kponLHdV5T+ku2RCOlAsfzYTJDBJOHqJ8qGkReyoqewpyQgpKZKCmnaLdUrRDmCtKKe RewKCPNyqVLyHudoJZbnzErawfneo0u5k4f8L9YIojerqxy+Lkc99UYy5k5F5tMtaBSy 3OJY94LhP7q5PvMEUCLlSHQ3HSeSz53fYFmNaDXpA0ses+hOT+W4tcL53sN5vNzIYEA1 tDACx9A/araNrZVWUpAPTeLWYZBV3My+cJGmKeZEdkANexsQMAIqeJi8o21JLr6Wk/+n 3TKA== X-Gm-Message-State: APt69E1PybqYbaHKRmkh9XJgkeKGEdFX0BdRnMlCS0YwqOPE2E+i+xg0 GZkPvz9vrKSPj0td7I9BU1hje2uh X-Received: by 2002:a1c:f513:: with SMTP id t19-v6mr2176522wmh.50.1530027435811; Tue, 26 Jun 2018 08:37:15 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id l84-v6sm3411176wmi.3.2018.06.26.08.37.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 08:37:15 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: linux-kernel@vger.kernel.org Cc: Tvrtko Ursulin , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , "H. Peter Anvin" , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Madhavan Srinivasan , Andi Kleen , Alexey Budankov , x86@kernel.org Subject: [RFC 0/4] perf: Per PMU access controls (paranoid setting) Date: Tue, 26 Jun 2018 16:36:38 +0100 Message-Id: <20180626153642.5587-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tvrtko Ursulin For situations where sysadmins might want to allow different level of access control for different PMUs, we start creating per-PMU perf_event_paranoid controls in sysfs. These work in equivalent fashion as the existing perf_event_paranoid sysctl, which now becomes the parent control for each PMU. On PMU registration the global/parent value will be inherited by each PMU, as it will be propagated to all registered PMUs when the sysctl is updated. At any later point individual PMU access controls, located in /device//perf_event_paranoid, can be adjusted to achieve fine grained access control. Discussion from previous posting: https://lkml.org/lkml/2018/5/21/156 Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Madhavan Srinivasan Cc: Andi Kleen Cc: Alexey Budankov Cc: linux-kernel@vger.kernel.org Cc: x86@kernel.org Tvrtko Ursulin (4): perf: Move some access checks later in perf_event_open perf: Pass pmu pointer to perf_paranoid_* helpers perf: Allow per PMU access control perf Documentation: Document the per PMU perf_event_paranoid interface .../sysfs-bus-event_source-devices-events | 14 +++ arch/powerpc/perf/core-book3s.c | 2 +- arch/x86/events/intel/bts.c | 2 +- arch/x86/events/intel/core.c | 2 +- arch/x86/events/intel/p4.c | 2 +- include/linux/perf_event.h | 18 ++- kernel/events/core.c | 104 +++++++++++++++--- kernel/sysctl.c | 4 +- kernel/trace/trace_event_perf.c | 6 +- 9 files changed, 123 insertions(+), 31 deletions(-) -- 2.17.1