From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47766C7EE23 for ; Wed, 31 May 2023 15:08:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0ULbV9MEz0i5dW8sRhF+vFc6tcak/NNKEt719lAQ5jk=; b=N8zWtFDE5c0l1H wGt97gRrUho968F7RD4fntfMPzvDM+7c3dFbp0+2b3zITOUvyhkvAh9VA+n+Z3CbXLruwCXTWgEAx HvUpDFp5Q3WwQBNG96npCdNxhM13Y59gutn3V7SaWIU9Vfkjc2QKmVk21UTCvgn1HOv0hrvXXc8l2 BKJxLHRfgyVuGjy+pq60mXPXYBzMcyg2RVdp9tkxeX00BbH09SikHTDkfvIuUQrgiVqurdchK+iTj hHO8sDmrxXRT+R7o5h952/omyp7UnV4LkFul2Yhy3zieWyal8/+S2xkBa6gAKkYFe+9iiu1UILsY+ 3WJ4GlJR6AunTE5is+7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4NQg-000EyW-2b; Wed, 31 May 2023 15:08:02 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4NQc-000Evv-2x for linux-arm-kernel@lists.infradead.org; Wed, 31 May 2023 15:08:00 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f3b314b1d7so6539234e87.1 for ; Wed, 31 May 2023 08:07:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1685545676; x=1688137676; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=JUIbREcbx/7AYCYbP6hJBZ04/CWyd0xTzthWNvvFKW0=; b=CpdRFrDGLIRJKki5RjwxylxPBIFamWlGob2MdmpKb4HBlVP/tRQ13doI2Q6aF2nWQt CXk6kqO9Egk15pYIpSHmHy+QzOKB1W+xuz4hJf9LD8tmbKFjnyCbESeDgc+kw9Z+1jzj JQE3+HWfdLsErL/zbVzmgs8uXKzNLV1fuxZjATvFFXL5M8p5iJKf7Uq5nHp2PxFGj6SH lHUbchz2sVhxVTxsM77cueNtzFJshSst2SFewStnxOBaBsiBefJfqH8lrv1Rvdc3pIWA aurGDEE+qIriegaiVBQ+1e2w7d3M99inUa0YPEoxy4Fumca0XI7NMJ9lB+tvXz0B8jbb Pouw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685545676; x=1688137676; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JUIbREcbx/7AYCYbP6hJBZ04/CWyd0xTzthWNvvFKW0=; b=JZnNuwiK3v8SYcdSA+7n5gdDFseWeRjeh7EOHUb5eeIussTEp+A+aSleX6xChdwyxa KE2UVLd0iZopYG5YJIqESUybb+UhIRQoMnHulp8o5idM5StCd05UxTvfC3oSN8sRgVjJ s3FVlmU1lfOmF4m5QwyYwvqPWtwYnio9FL9y7cjh5ULAJ3f8OaKUvBWB62JdfaZFjCqD DS7TnVdtQz73vPuwSHMCLRECoNXPkdQ9Zown+e5qliXp18/rAd8JkLfLwJDIa9MQzAXA QqaGpfCs8O7KEF8loFoPVo2ctF7uxINSZvMdyvXfyn3AROK8x4scixnSlBGDnsgFp/6S 2eeQ== X-Gm-Message-State: AC+VfDy7iIBB1o4VymiUiwE5u3EzbXlrl1xH9Gjn/owlb7j/jJX92ONv bA9knVFRloXxrhV8hA+Pi3h6kA== X-Google-Smtp-Source: ACHHUZ7E6kbDp2hRRtt+qsXk2F0ex4UkDmy/j1U8lrPnGhR9xK8TtMFExzBERPqMYV57ESb28Lkr0g== X-Received: by 2002:a05:6512:4ce:b0:4f3:a69e:1d80 with SMTP id w14-20020a05651204ce00b004f3a69e1d80mr3069033lfq.0.1685545676307; Wed, 31 May 2023 08:07:56 -0700 (PDT) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id m6-20020a7bce06000000b003f6050d35c9sm20952739wmc.20.2023.05.31.08.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 08:07:55 -0700 (PDT) Date: Wed, 31 May 2023 17:07:55 +0200 From: Andrew Jones To: Alexandre Ghiti Cc: Jonathan Corbet , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Anup Patel , Will Deacon , Rob Herring , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 08/10] Documentation: admin-guide: Add riscv sysctl_perf_user_access Message-ID: <20230531-0707dc46df8078cd92711314@orel> References: <20230512085321.13259-1-alexghiti@rivosinc.com> <20230512085321.13259-9-alexghiti@rivosinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230512085321.13259-9-alexghiti@rivosinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230531_080758_953110_A6EDA1EC X-CRM114-Status: GOOD ( 24.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 12, 2023 at 10:53:19AM +0200, Alexandre Ghiti wrote: > riscv now uses this sysctl so document its usage for this architecture. > > Signed-off-by: Alexandre Ghiti > --- > Documentation/admin-guide/sysctl/kernel.rst | 24 +++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) > > diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst > index 4b7bfea28cd7..93cd518ca94b 100644 > --- a/Documentation/admin-guide/sysctl/kernel.rst > +++ b/Documentation/admin-guide/sysctl/kernel.rst > @@ -941,16 +941,32 @@ enabled, otherwise writing to this file will return ``-EBUSY``. > The default value is 8. > > > -perf_user_access (arm64 only) > -================================= > +perf_user_access (arm64 and riscv only) > +======================================= > + > +Controls user space access for reading perf event counters. > > -Controls user space access for reading perf event counters. When set to 1, > -user space can read performance monitor counter registers directly. > +arm64 > +===== > > The default value is 0 (access disabled). > +When set to 1, user space can read performance monitor counter registers > +directly. > > See Documentation/arm64/perf.rst for more information. > > +riscv > +===== > + > +When set to 0, user access is disabled. > + > +When set to 1, user space can read performance monitor counter registers > +directly only through perf, any direct access without perf intervention will > +trigger an illegal instruction. > + > +The default value is 2, which enables legacy mode (user space has direct > +access to cycle, time and insret CSRs only). Note that this legacy value > +is deprecated and will be removed once all userspace applications are fixed. All modes can access the time CSR so I'm not sure if it should be pointed out here as if it's an exception. Maybe we shouldn't point it out at all or we should point it out for all three? Thanks, drew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel