qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <ajones@ventanamicro.com>
To: Atish Patra <atishp@rivosinc.com>
Cc: qemu-riscv@nongnu.org, qemu-devel@nongnu.org, palmer@dabbelt.com,
	 liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com,
	bin.meng@windriver.com,  dbarboza@ventanamicro.com,
	alistair.francis@wdc.com
Subject: Re: [PATCH v2 13/13] target/riscv: Enable PMU related extensions to preferred rule
Date: Tue, 6 Aug 2024 10:46:21 +0200	[thread overview]
Message-ID: <20240806-9fdad33468ec103d83a85e77@orel> (raw)
In-Reply-To: <20240723-counter_delegation-v2-13-c4170a5348ca@rivosinc.com>

On Tue, Jul 23, 2024 at 04:30:10PM GMT, Atish Patra wrote:
> Counter delegation/configuration extension requires the following
> extensions to be enabled.
> 
> 1. Smcdeleg - To enable counter delegation from M to S
> 2. S[m|s]csrind - To enable indirect access CSRs
> 3. Smstateen - Indirect CSR extensions depend on it.
> 4. Sscofpmf - To enable counter overflow feature
> 5. S[m|s]aia - To enable counter overflow feature in virtualization
> 6. Smcntrpmf - To enable privilege mode filtering for cycle/instret
> 
> While first 3 are mandatory to enable the counter delegation,
> next 3 set of extension are preferred to enable all the PMU related
> features.

Just my 2 cents, but I think for the first three we can apply the concept
of extension bundles, which we need for other extensions as well. In those
cases we just auto enable all the dependencies. For the three preferred
extensions I think we can just leave them off for 'base', but we should
enable them by default for 'max' along with Ssccfg.

Thanks,
drew

> That's why, enable all of these if Ssccfg extension is
> enabled from the commandline.
> 
> Signed-off-by: Atish Patra <atishp@rivosinc.com>
> ---
>  target/riscv/cpu.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index 22ba43c7ff2a..abebfcc46dea 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -2665,8 +2665,20 @@ RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[] = {
>      NULL
>  };
>  
> +static RISCVCPUPreferredExtsRule SSCCFG_PREFERRED = {
> +    .ext = CPU_CFG_OFFSET(ext_ssccfg),
> +    .preferred_multi_exts = {
> +        CPU_CFG_OFFSET(ext_smcsrind), CPU_CFG_OFFSET(ext_sscsrind),
> +        CPU_CFG_OFFSET(ext_ssaia), CPU_CFG_OFFSET(ext_smaia),
> +        CPU_CFG_OFFSET(ext_smstateen), CPU_CFG_OFFSET(ext_sscofpmf),
> +        CPU_CFG_OFFSET(ext_smcntrpmf), CPU_CFG_OFFSET(ext_smcdeleg),
> +
> +        RISCV_PREFRRED_EXTS_RULE_END
> +    },
> +};
> +
>  RISCVCPUPreferredExtsRule *riscv_multi_ext_preferred_rules[] = {
> -    NULL
> +    &SSCCFG_PREFERRED, NULL
>  };
>  
>  static Property riscv_cpu_properties[] = {
> 
> -- 
> 2.34.1
> 
> 


  reply	other threads:[~2024-08-06  8:47 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23 23:29 [PATCH v2 00/13] Add RISC-V Counter delegation ISA extension support Atish Patra
2024-07-23 23:29 ` [PATCH v2 01/13] target/riscv: Add properties for Indirect CSR Access extension Atish Patra
2024-07-26  7:42   ` Alistair Francis
2024-07-27  1:33     ` Atish Kumar Patra
2024-07-31  9:24       ` Alistair Francis
2024-08-07  7:53         ` Atish Kumar Patra
2024-07-23 23:29 ` [PATCH v2 02/13] target/riscv: Decouple AIA processing from xiselect and xireg Atish Patra
2024-08-06  0:05   ` Alistair Francis
2024-07-23 23:30 ` [PATCH v2 03/13] target/riscv: Enable S*stateen bits for AIA Atish Patra
2024-08-06  0:12   ` Alistair Francis
2024-08-07  7:53     ` Atish Kumar Patra
2024-07-23 23:30 ` [PATCH v2 04/13] target/riscv: Support generic CSR indirect access Atish Patra
2024-08-06  0:15   ` Alistair Francis
2024-08-07  7:50     ` Atish Kumar Patra
2024-07-23 23:30 ` [PATCH v2 05/13] target/riscv: Add counter delegation definitions Atish Patra
2024-08-06  0:36   ` Alistair Francis
2024-07-23 23:30 ` [PATCH v2 06/13] target/riscv: Add select value range check for counter delegation Atish Patra
2024-08-06  0:41   ` Alistair Francis
2024-07-23 23:30 ` [PATCH v2 07/13] target/riscv: Add counter delegation/configuration support Atish Patra
2024-08-06  1:21   ` Alistair Francis
2024-08-07  7:48     ` Atish Kumar Patra
2024-07-23 23:30 ` [PATCH v2 08/13] target/riscv: Add configuration for S[m|s]csrind, Smcdeleg/Ssccfg Atish Patra
2024-08-06  1:22   ` Alistair Francis
2024-07-23 23:30 ` [PATCH v2 09/13] target/riscv: Invoke pmu init after feature enable Atish Patra
2024-08-06  1:43   ` Alistair Francis
2024-07-23 23:30 ` [PATCH v2 10/13] target/riscv: Enable sscofpmf for bare cpu by default Atish Patra
2024-08-06  1:51   ` Alistair Francis
2024-08-06  8:27     ` Andrew Jones
2024-07-23 23:30 ` [PATCH v2 11/13] target/riscv: Repurpose the implied rule startergy Atish Patra
2024-07-23 23:30 ` [PATCH v2 12/13] target/riscv: Add a preferred ISA extension rule Atish Patra
2024-08-06  1:48   ` Alistair Francis
2024-08-07  7:46     ` Atish Kumar Patra
2024-07-23 23:30 ` [PATCH v2 13/13] target/riscv: Enable PMU related extensions to preferred rule Atish Patra
2024-08-06  8:46   ` Andrew Jones [this message]
2024-08-06 16:05     ` Daniel Henrique Barboza
2024-08-07  2:01       ` Alistair Francis
2024-08-07  7:43         ` Atish Kumar Patra
2024-08-08  0:27           ` Alistair Francis
2024-08-08  8:12             ` Atish Kumar Patra
2024-08-08  8:24               ` Alistair Francis
2024-08-09 21:40                 ` Atish Kumar 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=20240806-9fdad33468ec103d83a85e77@orel \
    --to=ajones@ventanamicro.com \
    --cc=alistair.francis@wdc.com \
    --cc=atishp@rivosinc.com \
    --cc=bin.meng@windriver.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=liwei1518@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /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;
as well as URLs for NNTP newsgroup(s).