summary refs log tree commit diff stats
path: root/docs/system/device-url-syntax.rst.inc
diff options
context:
space:
mode:
authorLoïc Lefort <loic@rivosinc.com>2025-03-13 20:30:09 +0100
committerAlistair Francis <alistair.francis@wdc.com>2025-05-19 13:29:29 +1000
commit19cf1a7d9e59b71bf8d6571d4747e5c82667c3d1 (patch)
treefb5993c8e6b8c77f25954c904031ff70cae96855 /docs/system/device-url-syntax.rst.inc
parent915b203745540e908943758f78f5da49e0a15e45 (diff)
downloadfocaccia-qemu-19cf1a7d9e59b71bf8d6571d4747e5c82667c3d1.tar.gz
focaccia-qemu-19cf1a7d9e59b71bf8d6571d4747e5c82667c3d1.zip
target/riscv: pmp: fix checks on writes to pmpcfg in Smepmp MML mode
With Machine Mode Lockdown (mseccfg.MML) set and RLB not set, checks on pmpcfg
writes would match the wrong cases of Smepmp truth table.

The existing code allows writes for the following cases:
- L=1, X=0: cases 8, 10, 12, 14
- L=0, RWX!=WX: cases 0-2, 4-6
This leaves cases 3, 7, 9, 11, 13, 15 for which writes are ignored.

From the Smepmp specification: "Adding a rule with executable privileges that
either is M-mode-only or a locked Shared-Region is not possible (...)" This
description matches cases 9-11, 13 of the truth table.

This commit implements an explicit check for these cases by using
pmp_get_epmp_operation to convert between PMP configuration and Smepmp truth
table cases.

Signed-off-by: Loïc Lefort <loic@rivosinc.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20250313193011.720075-4-loic@rivosinc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Cc: qemu-stable@nongnu.org
Diffstat (limited to 'docs/system/device-url-syntax.rst.inc')
0 files changed, 0 insertions, 0 deletions