Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3766400imm; Mon, 11 Jun 2018 01:09:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJqBjDnfEnP8G4lvCuevUTDPLbscZ9j1rE7id+XV2denrSuqZS3tchu3ASzc8CZTmecg8mu X-Received: by 2002:a17:902:760e:: with SMTP id k14-v6mr17473517pll.310.1528704577431; Mon, 11 Jun 2018 01:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528704577; cv=none; d=google.com; s=arc-20160816; b=W4aX/PgauYL8Kb1r5rN6nRSH0KKEh3GDFqSq2aUjimcLTg0AdVZde/xvclzrzPjA6r ze4C6FGD9iDX1tL5WVJcjuqtwo1MNB1Id+inxBsh+1lcY17GovE1D2E2xAignOtsIVje 4D3JrpSkQPtXumiaQEB3+8lDgUy37P7gYTYE295RILXKTubwPZ+zNOXvdEzvMmuhhsPS glRikiNFBn77CFjAm0j0ay2147tqR6qNo7xE3NDCuZvFotAhRm62VX/wJv9Tw8VocthN aZlVKxgriQL/B89anr5xNZbrnPSUhweH+VXz8N22l/CIEVAOFZG2cPKp5H3nrcnF8Ia9 1OvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=Sl1uPQPaiJMCl/8gUEkXp9YReTMmvyLp13h8BQesZOQ=; b=qqbBkHZBTG7jn3/krfE2TJ5eP4TIgMmnWTWVzt4sRhJi+r+fYucIJGoPQM/gG7ySop l90jIoyEbBAMHIglr5zXnCgfKFrW5fsRz+MsEMXMoyiskNVamcVbKXqXGVCQTuX5X+Bg K9TcEAVmOYV0zwTbyNNp24rUHBmdlbqYiTFSsB7rx8b1U4HFAfJACGD7qJaANtwBvKLx nlfkJqY0JAI+0MMbJRsqKnHsH7VMD5R0J0HWniNYzD17TJ+VritGbZ387GtCcux3gakA 0mzafPKHga9aOODXnldSiWvi2vCLUp20mRKFs/1S8qaDyoiOjGjuebDB1f/OhCNYBpyq QMIw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i185-v6si15963685pge.587.2018.06.11.01.09.23; Mon, 11 Jun 2018 01:09:37 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932415AbeFKIIq (ORCPT + 99 others); Mon, 11 Jun 2018 04:08:46 -0400 Received: from mga05.intel.com ([192.55.52.43]:27925 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932109AbeFKIId (ORCPT ); Mon, 11 Jun 2018 04:08:33 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2018 01:08:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,501,1520924400"; d="scan'208";a="236106138" Received: from msjoblom-mobl.ger.corp.intel.com (HELO [10.252.25.78]) ([10.252.25.78]) by fmsmga005.fm.intel.com with ESMTP; 11 Jun 2018 01:08:29 -0700 Subject: Re: [RFC] perf: Allow fine-grained PMU access control To: Andi Kleen , Alexey Budankov Cc: Peter Zijlstra , Tvrtko Ursulin , linux-kernel@vger.kernel.org, Tvrtko Ursulin , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Mark Rutland , "Rogozhkin, Dmitry V" References: <20180521092549.5349-1-tvrtko.ursulin@linux.intel.com> <20180522090527.GP12198@hirez.programming.kicks-ass.net> <017c4a20-b597-9c0e-4cf3-c0fd1d7bf3d7@ursulin.net> <20180522123213.GR12198@hirez.programming.kicks-ass.net> <88a005e3-e090-33c1-0107-5c04a4d8f97f@linux.intel.com> <20180522171925.GL4486@tassilo.jf.intel.com> From: Tvrtko Ursulin Message-ID: Date: Mon, 11 Jun 2018 09:08:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180522171925.GL4486@tassilo.jf.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 22/05/2018 18:19, Andi Kleen wrote: >> IMHO, it is unsafe for CBOX pmu but could IMC, UPI pmus be an exception here? >> Because currently perf stat -I from IMC, UPI counters is only allowed when >> system wide monitoring is permitted and this prevents joint perf record and >> perf stat -I in cluster environments where users usually lack ability to >> modify paranoid. Adding Andi who may have more ideas regarding all that. > > PMU isolation is about not making side channels worse. There are normally > already side channels from timing, but it has a degree of noise. > > PMU isolation is just to prevent opening side channels with less noise. > But reducing noise is always a trade off, it can never be perfect > and at some point there are dimishing returns. > > In general the farther you are from the origin of the noise there > is already more noise. The PMU can reduce the noise, but if it's far > enough away it may not make much difference. > > So there are always trade offs with shades of grey, not a black > and white situation. Depending on your security requirements > it may be totally reasonable e.g. to allow the PMU > on the memory controller (which is already very noisy in any case), > but not on the caches. > > Or allow it only on the graphics which is already fairly isolated. > > So per pmu paranoid settings are a useful concept. So it seems there is some positive feedback and fine-grained controls would be useful for other PMU's in cluster environments. If we have agreement on that, question is how to drive this forward? Would someone be able to review the patch I've sent, or suggest more people to look at it before it could be queued up for merge? Regards, Tvrtko