target/riscv/cpu_helper.c: Invalid exception on MMU translation stage
commit82d53adfbb1aa0dbe7dac09b61ad86014efe81a7
authorIvan Klokov <ivan.klokov@syntacore.com>
Tue, 21 Nov 2023 07:17:56 +0000 (21 10:17 +0300)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 22 Nov 2023 03:58:25 +0000 (22 13:58 +1000)
treee0e635fa9d53ba5b0a3ed588cc4476a7d7204f90
parenta7472560ca5f7a61ef3a46b52118f680de81058c
target/riscv/cpu_helper.c: Invalid exception on MMU translation stage

According to RISCV privileged spec sect. 5.3.2 Virtual Address Translation Process
access-fault exceptions may raise only after PMA/PMP check. Current implementation
generates an access-fault for mbare mode even if there were no PMA/PMP errors.
This patch removes the erroneous MMU mode check and generates an access-fault
exception based on the pmp_violation flag only.

Fixes: 1448689c7b ("target/riscv: Allow specifying MMU stage")

Signed-off-by: Ivan Klokov <ivan.klokov@syntacore.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20231121071757.7178-2-ivan.klokov@syntacore.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu_helper.c