]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv: Restrict midelegh access to S-mode harts
authorJay Chang <jay.chang@sifive.com>
Tue, 1 Jul 2025 03:00:21 +0000 (11:00 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 31 Jul 2025 06:06:44 +0000 (09:06 +0300)
commit93890300d89c19fe76dbed272d6028333add50d2
tree14e5300e9658e1b7ca4a7c0889f499895207eb4a
parentf45d7aaf67fc639a760c76e76d87e2ca900513d1
target/riscv: Restrict midelegh access to S-mode harts

RISC-V AIA Spec states:
"For a machine-level environment, extension Smaia encompasses all added
CSRs and all modifications to interrupt response behavior that the AIA
specifies for a hart, over all privilege levels. For a supervisor-level
environment, extension Ssaia is essentially the same as Smaia except
excluding the machine-level CSRs and behavior not directly visible to
supervisor level."

Since midelegh is an AIA machine-mode CSR, add Smaia extension check in
aia_smode32 predicate.

Reviewed-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Jay Chang <jay.chang@sifive.com>
Reviewed-by: Nutty Liu<liujingqi@lanxincomputing.com>
Message-ID: <20250701030021.99218-3-jay.chang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit 86bc3a0abf10072081cddd8dff25aa72c60e67b8)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/riscv/csr.c