Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10005982rwr; Fri, 12 May 2023 02:21:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ46yQZJpWNt/Osc0zre26hfBXgM2lSYOxPA9jrGGaoLhw80i7J/DPIex8h13JXYjGHuJhOS X-Received: by 2002:a17:903:41c3:b0:1a9:6b57:f400 with SMTP id u3-20020a17090341c300b001a96b57f400mr31434323ple.16.1683883310160; Fri, 12 May 2023 02:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683883310; cv=none; d=google.com; s=arc-20160816; b=sFHn59wAw8cKICEJZ1Peo1dUdUZYfqewH77ZTELKIhaP7PFdvD/Aib+E8lK2xVzx1g swkqQN+j9aTZXiYvs9yigbsLB3ujzURUKUwLDT9Rah+dKKBr+yELhG72sokpWy589F9N feHxMUbPii9QPbp4FmF7fiqadfGIDxmdscykIB2aYghZoL/gwuFPl8o+U02tvY07XWKI sYYwfz65Zsl24/isXxI6JB8/+7TguJ8s6WEBhJaG3phFjU8PW7h42dckjOGsD2Qe1kCk 0l3oqEgCYU5Yj/v1woGQP3uAIrp/wBrTK8+4lHmQ4yWiUF4Z8nTscY9+eihS5Cdi+Pq3 Y5eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lnd8gr51X8/5uF+3rCtJjAEchITyuqH0kTrDbBmZ9i8=; b=fiUq09upIH6Lqeb0TH66JReOnHDI2PCrE4IHz11fpctkXiB7PwblZpxroMJTZuy0DJ MRe/47cSwQRGXUNRdvXpEaz3pNCXrImCq0sCVKJRxUkLIT0ymNdhF3GbcttXx5rVYN3Z 0MMFMbq5SnNjwXA9KrmvmyAPgsLFq2XMTqGR4x4hOVAz6YLFgNZFRMQOR2y0P24QfqwV xRlIXwOGa5vCWZrvmsDp+JnXiRZVLQqqh9nj+V5+Evb/0lZFu3t26wc367XdpYgd8D5f Izl4zE+xROxKZd9sMCLsQ5Q2B7BXn2nrBZ8QraOFRKX58bGM3wTq88H3pa3LSFKVQ1Za Gb3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=BP88QC1b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay8-20020a1709028b8800b001ac482e25a0si8520440plb.374.2023.05.12.02.21.35; Fri, 12 May 2023 02:21:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=BP88QC1b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240262AbjELJCG (ORCPT + 99 others); Fri, 12 May 2023 05:02:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240286AbjELJCF (ORCPT ); Fri, 12 May 2023 05:02:05 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57B70D879 for ; Fri, 12 May 2023 02:02:04 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f42c865534so40718045e9.2 for ; Fri, 12 May 2023 02:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1683882123; x=1686474123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lnd8gr51X8/5uF+3rCtJjAEchITyuqH0kTrDbBmZ9i8=; b=BP88QC1bhM6e6lKhDv4DvB5IhPrAhRpa7/EMuvDfBK9ilVoXmFBPXJUv7eBZFXmzeA pnY3MuFsQG/Vi8of/R7SxCeVy84BBl6Kp1magUzy5obpB8MTplmqFtJ+UgoUCcKHR6m9 UwYczpC1Cx+cXBzZGpkRFIRi/arSoVntIWcSkPr8Uz7fI8PTIaU1AmU3/fMWlJvtE84G vEGkUYx4uqolizKdU/vvmYS0xRNcR9bjpIc8poxfmhpbguk7A2Gc9CwCubqWiDgmeF5g 3turrONwbQmgL4fwYhBq0v/Kxt48W0IjtCm8J04PJG0yCm4qXFEa4nSI1/4IOKe8BxDM dsHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683882123; x=1686474123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lnd8gr51X8/5uF+3rCtJjAEchITyuqH0kTrDbBmZ9i8=; b=i5W7ENkbDwYdB6F0ZM1tJxEBgbqNhS4SiviqKst39lFEL/ysb5x2JYiL+OqBAUIcuL K849BjmUfNlKHwixa1Cu5Lo8eAIQsWoNGXEOF8usJerVNqvq0VMPo9faK/7sb/grR06I GFl+m/KbKFwRDGuY8ZGc4qSm33Rbw+u057yPepQPm4L4Wq+nI6Nks5t1KdcFh7YTUa6W 9q2zESEQPByGvmaYfFFWf2jf1GiZrMoEAr9DdGJ2ajkGCykgjGy51J8r1xGLfdZNari4 Okyf2iIzltKVoY1O8UQPzibFUksevoOFDpsQx5PlRNMTWR9szU4FFE96gupY08443mHe 65PA== X-Gm-Message-State: AC+VfDyTt4+7q2AjyQUPW7CqQA8pw1IiAAQHHnp+mnbzQEwWyheiN2jQ iJlvxGtJMfdWT1jW6UhrWkMrhA== X-Received: by 2002:a05:600c:228e:b0:3f4:2174:b28a with SMTP id 14-20020a05600c228e00b003f42174b28amr15724552wmf.15.1683882122838; Fri, 12 May 2023 02:02:02 -0700 (PDT) Received: from alex-rivos.home (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id f26-20020a7bcd1a000000b003f423f5b659sm15364363wmj.10.2023.05.12.02.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 02:02:02 -0700 (PDT) From: Alexandre Ghiti To: 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 , Andrew Jones , 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 Cc: Alexandre Ghiti Subject: [PATCH v2 08/10] Documentation: admin-guide: Add riscv sysctl_perf_user_access Date: Fri, 12 May 2023 10:53:19 +0200 Message-Id: <20230512085321.13259-9-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230512085321.13259-1-alexghiti@rivosinc.com> References: <20230512085321.13259-1-alexghiti@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. pid_max ======= -- 2.37.2