diff options
author | Jose Martins <josemartins90@gmail.com> | 2021-10-26 15:51:25 +0100 |
---|---|---|
committer | Alistair Francis <alistair@alistair23.me> | 2021-10-29 16:54:45 +1000 |
commit | 487a99551ae903fc83a878d4cbc6d853e17ad252 (patch) | |
tree | 953376802ac16489cbbfe787b3c0e65531682920 /target/riscv/cpu.h | |
parent | 0ee9a4e57e1cee4577cab22f6ced6c0c34fb2d94 (diff) |
target/riscv: fix VS interrupts forwarding to HS
VS interrupts (2, 6, 10) were not correctly forwarded to hs-mode when
not delegated in hideleg (which was not being taken into account). This
was mainly because hs level sie was not always considered enabled when
it should. The spec states that "Interrupts for higher-privilege modes,
y>x, are always globally enabled regardless of the setting of the global
yIE bit for the higher-privilege mode." and also "For purposes of
interrupt global enables, HS-mode is considered more privileged than
VS-mode, and VS-mode is considered more privileged than VU-mode". Also,
vs-level interrupts were not being taken into account unless V=1, but
should be unless delegated.
Finally, there is no need for a special case for to handle vs interrupts
as the current privilege level, the state of the global ie and of the
delegation registers should be enough to route all interrupts to the
appropriate privilege level in riscv_cpu_do_interrupt.
Signed-off-by: Jose Martins <josemartins90@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20211026145126.11025-2-josemartins90@gmail.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target/riscv/cpu.h')
0 files changed, 0 insertions, 0 deletions