[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 15/20] target/riscv/cpu.c: introduce cpu_cfg_ext_auto_upda
From: |
Andrew Jones |
Subject: |
Re: [PATCH v9 15/20] target/riscv/cpu.c: introduce cpu_cfg_ext_auto_update() |
Date: |
Mon, 4 Sep 2023 11:16:46 +0200 |
On Fri, Sep 01, 2023 at 04:46:21PM -0300, Daniel Henrique Barboza wrote:
> During realize() time we're activating a lot of extensions based on some
> criteria, e.g.:
>
> if (cpu->cfg.ext_zk) {
> cpu->cfg.ext_zkn = true;
> cpu->cfg.ext_zkr = true;
> cpu->cfg.ext_zkt = true;
> }
>
> This practice resulted in at least one case where we ended up enabling
> something we shouldn't: RVC enabling zca/zcd/zcf when using a CPU that
> has priv_spec older than 1.12.0.
>
> We're also not considering user choice. There's no way of doing it now
> but this is about to change in the next few patches.
>
> cpu_cfg_ext_auto_update() will check for priv version mismatches before
> enabling extensions. If we have a mismatch between the current priv
> version and the extension we want to enable, do not enable it. In the
> near future, this same function will also consider user choice when
> deciding if we're going to enable/disable an extension or not.
>
> For now let's use it to handle zca/zcd/zcf enablement if RVC is enabled.
>
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> ---
> target/riscv/cpu.c | 43 ++++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 40 insertions(+), 3 deletions(-)
>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
- [PATCH v9 10/20] target/riscv: add 'max' CPU type, (continued)
- [PATCH v9 10/20] target/riscv: add 'max' CPU type, Daniel Henrique Barboza, 2023/09/01
- [PATCH v9 11/20] avocado, risc-v: add tuxboot tests for 'max' CPU, Daniel Henrique Barboza, 2023/09/01
- [PATCH v9 12/20] target/riscv: deprecate the 'any' CPU type, Daniel Henrique Barboza, 2023/09/01
- [PATCH v9 14/20] target/riscv: make CPUCFG() macro public, Daniel Henrique Barboza, 2023/09/01
- [PATCH v9 13/20] target/riscv/cpu.c: use offset in isa_ext_is_enabled/update_enabled, Daniel Henrique Barboza, 2023/09/01
- [PATCH v9 15/20] target/riscv/cpu.c: introduce cpu_cfg_ext_auto_update(), Daniel Henrique Barboza, 2023/09/01
- [PATCH v9 16/20] target/riscv/cpu.c: use cpu_cfg_ext_auto_update() during realize(), Daniel Henrique Barboza, 2023/09/01
- [PATCH v9 19/20] target/riscv/cpu.c: honor user choice in cpu_cfg_ext_auto_update(), Daniel Henrique Barboza, 2023/09/01
- [PATCH v9 18/20] target/riscv: use isa_ext_update_enabled() in init_max_cpu_extensions(), Daniel Henrique Barboza, 2023/09/01
- [PATCH v9 17/20] target/riscv/cpu.c: introduce RISCVCPUMultiExtConfig, Daniel Henrique Barboza, 2023/09/01
- [PATCH v9 20/20] target/riscv/cpu.c: consider user option with RVG, Daniel Henrique Barboza, 2023/09/01
- Re: [PATCH v9 00/20] riscv: 'max' CPU, detect user choice in TCG, Alistair Francis, 2023/09/07
- Re: [PATCH v9 00/20] riscv: 'max' CPU, detect user choice in TCG, Alistair Francis, 2023/09/10