Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755200AbbF0IeK (ORCPT ); Sat, 27 Jun 2015 04:34:10 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:35542 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752604AbbF0IeA (ORCPT ); Sat, 27 Jun 2015 04:34:00 -0400 Date: Sat, 27 Jun 2015 10:33:55 +0200 From: Ingo Molnar To: Prarit Bhargava Cc: linux-kernel@vger.kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Len Brown , Dasaratharaman Chandramouli Subject: Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr Message-ID: <20150627083354.GA12834@gmail.com> References: <1435341131-3279-1-git-send-email-prarit@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435341131-3279-1-git-send-email-prarit@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1962 Lines: 48 * Prarit Bhargava wrote: > Customers write system monitoring software for single systems as well as > clusters. In load-balancing software it is useful to know how "busy" a > core is. Unfortunately the only way to get this data is to run as root, > or use setcap to allow userspace access for particular programs. Both of > these options are clunky at best. > > This patch allows read access to the msr dev files which should be okay. > No damage can be done by reading the MSR values and it allows non-root > users to run system monitoring software. > > The turbostat code specifically checks for CAP_SYS_RAWIO, which it > shouldn't have to and I've removed that code. Additionally I've modified > the turbostat man page to remove documentation about configuring > CAP_SYS_RAW_IO. > > Note: Write access to msr is still restricted with this patch. > > Cc: "H. Peter Anvin" > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: x86@kernel.org > Cc: Len Brown > Cc: Prarit Bhargava > Cc: Dasaratharaman Chandramouli > Signed-off-by: Prarit Bhargava > --- > arch/x86/kernel/msr.c | 11 ++++++++--- > tools/power/x86/turbostat/turbostat.8 | 8 -------- > tools/power/x86/turbostat/turbostat.c | 17 ----------------- > 3 files changed, 8 insertions(+), 28 deletions(-) So what's wrong with exposing them as a simplified PMU driver? That way we only expose the ones we want to - plus tooling can use all the rich perf features that can be used around this. (sampling, counting, call chains, etc.) Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/