]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv/cpu_helper.c: Invalid exception on MMU translation stage
authorIvan Klokov <ivan.klokov@syntacore.com>
Tue, 21 Nov 2023 07:17:56 +0000 (10:17 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 29 Nov 2023 13:15:22 +0000 (16:15 +0300)
commit87ff608c6fd258c7f323e3a17f948e4e8d412d36
treede76e7964c080b3b346c17ac54b0eef9826a587f
parent837148a31ac68068cd8411118a96ada650bbbef9
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>
(cherry picked from commit 82d53adfbb1aa0dbe7dac09b61ad86014efe81a7)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/riscv/cpu_helper.c