[PATCH v3 0/2] Add S-mode checks for delegation-related CSRs

Jay Chang posted 2 patches 4 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250701030021.99218-1-jay.chang@sifive.com
Maintainers: Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
target/riscv/csr.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
[PATCH v3 0/2] Add S-mode checks for delegation-related CSRs
Posted by Jay Chang 4 months, 2 weeks ago
Patch 1 adds a predicate to restrict access to "medeleg, mideleg, and 
medelegh" to harts that support S-mode. 

Patch 2 adds a privilege check for the "midelegh" CSR, which is defined by 
the AIA extension and only valid when Smaia is supported. This is enforced 
via an updated predicate in aia_smode32. 

Change log:
  V3:
    * Add cover letter

Jay Chang (2):
  target/riscv: Restrict mideleg/medeleg/medelegh access to S-mode harts
  target/riscv: Restrict midelegh access to S-mode harts

 target/riscv/csr.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

-- 
2.48.1
Re: [PATCH v3 0/2] Add S-mode checks for delegation-related CSRs
Posted by Alistair Francis 3 months, 2 weeks ago
On Tue, Jul 1, 2025 at 1:02 PM Jay Chang <jay.chang@sifive.com> wrote:
>
> Patch 1 adds a predicate to restrict access to "medeleg, mideleg, and
> medelegh" to harts that support S-mode.
>
> Patch 2 adds a privilege check for the "midelegh" CSR, which is defined by
> the AIA extension and only valid when Smaia is supported. This is enforced
> via an updated predicate in aia_smode32.
>
> Change log:
>   V3:
>     * Add cover letter
>
> Jay Chang (2):
>   target/riscv: Restrict mideleg/medeleg/medelegh access to S-mode harts
>   target/riscv: Restrict midelegh access to S-mode harts

Thanks!

Applied to riscv-to-apply.next

Alistair

>
>  target/riscv/csr.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> --
> 2.48.1
>
>