summaryrefslogtreecommitdiffstats
path: root/qemu-options.h
diff options
context:
space:
mode:
authorHesham Almatary2019-05-30 15:51:32 +0200
committerPalmer Dabbelt2019-06-24 08:44:41 +0200
commitcc0fdb298517ce56c770803447f8b02a90271152 (patch)
treef256b619745fc8f83120e57cd0da25287d279399 /qemu-options.h
parentRISC-V: Raise access fault exceptions on PMP violations (diff)
downloadqemu-cc0fdb298517ce56c770803447f8b02a90271152.tar.gz
qemu-cc0fdb298517ce56c770803447f8b02a90271152.tar.xz
qemu-cc0fdb298517ce56c770803447f8b02a90271152.zip
RISC-V: Check for the effective memory privilege mode during PMP checks
The current PMP check function checks for env->priv which is not the effective memory privilege mode. For example, mstatus.MPRV could be set while executing in M-Mode, and in that case the privilege mode for the PMP check should be S-Mode rather than M-Mode (in env->priv) if mstatus.MPP == PRV_S. This patch passes the effective memory privilege mode to the PMP check. Functions that call the PMP check should pass the correct memory privilege mode after reading mstatus' MPRV/MPP or hstatus.SPRV (if Hypervisor mode exists). Suggested-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'qemu-options.h')
0 files changed, 0 insertions, 0 deletions