From: Conor Dooley <conor@kernel.org>
To: Atish Patra <atishp@rivosinc.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Anup Patel <anup@brainfault.org>,
Atish Patra <atishp@atishpatra.org>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
weilin.wang@intel.com, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 09/21] RISC-V: Add Smcntrpmf extension parsing
Date: Tue, 28 Jan 2025 18:10:59 +0000 [thread overview]
Message-ID: <20250128-jubilance-mosaic-e3a81199aec8@spud> (raw)
In-Reply-To: <20250127-counter_delegation-v3-9-64894d7e16d5@rivosinc.com>
[-- Attachment #1: Type: text/plain, Size: 1911 bytes --]
On Mon, Jan 27, 2025 at 08:59:50PM -0800, Atish Patra wrote:
> Smcntrpmf extension allows M-mode to enable privilege mode filtering
> for cycle/instret counters. However, the cyclecfg/instretcfg CSRs are
> only available only in Ssccfg only Smcntrpmf is present.
>
> That's why, kernel needs to detect presence of Smcntrpmf extension and
> enable privilege mode filtering for cycle/instret counters.
>
> Signed-off-by: Atish Patra <atishp@rivosinc.com>
> ---
> arch/riscv/include/asm/hwcap.h | 1 +
> arch/riscv/kernel/cpufeature.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h
> index 2f5ef1dee7ac..42b34e2f80e8 100644
> --- a/arch/riscv/include/asm/hwcap.h
> +++ b/arch/riscv/include/asm/hwcap.h
> @@ -104,6 +104,7 @@
> #define RISCV_ISA_EXT_SMCSRIND 95
> #define RISCV_ISA_EXT_SSCCFG 96
> #define RISCV_ISA_EXT_SMCDELEG 97
> +#define RISCV_ISA_EXT_SMCNTRPMF 98
>
> #define RISCV_ISA_EXT_XLINUXENVCFG 127
>
> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
> index b584aa2d5bc3..ec068c9130e5 100644
> --- a/arch/riscv/kernel/cpufeature.c
> +++ b/arch/riscv/kernel/cpufeature.c
> @@ -394,6 +394,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
> __RISCV_ISA_EXT_DATA(smmpm, RISCV_ISA_EXT_SMMPM),
> __RISCV_ISA_EXT_SUPERSET(smnpm, RISCV_ISA_EXT_SMNPM, riscv_xlinuxenvcfg_exts),
> __RISCV_ISA_EXT_DATA(smstateen, RISCV_ISA_EXT_SMSTATEEN),
> + __RISCV_ISA_EXT_DATA(smcntrpmf, RISCV_ISA_EXT_SMCNTRPMF),
> __RISCV_ISA_EXT_DATA(smcsrind, RISCV_ISA_EXT_SMCSRIND),
Isn't the order here wrong?
* 3. Standard supervisor-level extensions (starting with 'S') must be listed
* after standard unprivileged extensions. If multiple supervisor-level
* extensions are listed, they must be ordered alphabetically.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2025-01-28 18:12 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 4:59 [PATCH v3 00/21] Add Counter delegation ISA extension support Atish Patra
2025-01-28 4:59 ` [PATCH v3 01/21] perf pmu-events: Add functions in jevent.py to parse counter and event info for hardware aware grouping Atish Patra
2025-01-28 4:59 ` [PATCH v3 02/21] RISC-V: Add Sxcsrind ISA extension CSR definitions Atish Patra
2025-01-28 4:59 ` [PATCH v3 03/21] RISC-V: Add Sxcsrind ISA extension definition and parsing Atish Patra
2025-01-28 4:59 ` [PATCH v3 04/21] dt-bindings: riscv: add Sxcsrind ISA extension description Atish Patra
2025-01-28 18:13 ` Conor Dooley
2025-01-28 4:59 ` [PATCH v3 05/21] RISC-V: Define indirect CSR access helpers Atish Patra
2025-01-28 4:59 ` [PATCH v3 06/21] RISC-V: Add Sscfg extension CSR definition Atish Patra
2025-01-28 4:59 ` [PATCH v3 07/21] RISC-V: Add Ssccfg ISA extension definition and parsing Atish Patra
2025-01-28 4:59 ` [PATCH v3 08/21] dt-bindings: riscv: add Counter delegation ISA extensions description Atish Patra
2025-01-28 18:13 ` Conor Dooley
2025-01-28 18:15 ` Conor Dooley
2025-01-28 4:59 ` [PATCH v3 09/21] RISC-V: Add Smcntrpmf extension parsing Atish Patra
2025-01-28 18:10 ` Conor Dooley [this message]
2025-02-04 6:35 ` Atish Kumar Patra
2025-01-28 4:59 ` [PATCH v3 10/21] dt-bindings: riscv: add Smcntrpmf ISA extension description Atish Patra
2025-01-28 18:16 ` Conor Dooley
2025-01-28 4:59 ` [PATCH v3 11/21] RISC-V: perf: Restructure the SBI PMU code Atish Patra
2025-01-28 4:59 ` [PATCH v3 12/21] RISC-V: perf: Modify the counter discovery mechanism Atish Patra
2025-01-28 4:59 ` [PATCH v3 13/21] RISC-V: perf: Add a mechanism to defined legacy event encoding Atish Patra
2025-01-28 4:59 ` [PATCH v3 14/21] RISC-V: perf: Implement supervisor counter delegation support Atish Patra
2025-01-28 4:59 ` [PATCH v3 15/21] RISC-V: perf: Skip PMU SBI extension when not implemented Atish Patra
2025-01-28 4:59 ` [PATCH v3 16/21] RISC-V: perf: Use config2/vendor table for event to counter mapping Atish Patra
2025-01-28 4:59 ` [PATCH v3 17/21] RISC-V: perf: Add legacy event encodings via sysfs Atish Patra
2025-01-28 4:59 ` [PATCH v3 18/21] RISC-V: perf: Add Qemu virt machine events Atish Patra
2025-01-28 5:00 ` [PATCH v3 19/21] tools/perf: Support event code for arch standard events Atish Patra
2025-01-28 5:00 ` [PATCH v3 20/21] tools/perf: Pass the Counter constraint values in the pmu events Atish Patra
2025-01-28 5:00 ` [PATCH v3 21/21] Sync empty-pmu-events.c with autogenerated one Atish Patra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250128-jubilance-mosaic-e3a81199aec8@spud \
--to=conor@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=anup@brainfault.org \
--cc=atishp@atishpatra.org \
--cc=atishp@rivosinc.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=peterz@infradead.org \
--cc=robh@kernel.org \
--cc=weilin.wang@intel.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox