]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv: Make PMP region count configurable
authorJay Chang <jay.chang@sifive.com>
Fri, 6 Jun 2025 07:25:25 +0000 (15:25 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 4 Jul 2025 11:09:48 +0000 (21:09 +1000)
commitcd633bea8b0d30f3418b0dd372116bf3e028e42f
tree9d1156116d67655b21f73a570e5534999e3ed722
parentb0175841fa4f867b4b1219dba72c33392118dd43
target/riscv: Make PMP region count configurable

Previously, the number of PMP regions was hardcoded to 16 in QEMU.
This patch replaces the fixed value with a new `pmp_regions` field,
allowing platforms to configure the number of PMP regions.

If no specific value is provided, the default number of PMP regions
remains 16 to preserve the existing behavior.

A new CPU parameter num-pmp-regions has been introduced to the QEMU
command line. For example:

-cpu rv64, g=true, c=true, pmp=true, num-pmp-regions=8

Signed-off-by: Jay Chang <jay.chang@sifive.com>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20250606072525.17313-3-jay.chang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.c
target/riscv/cpu.h
target/riscv/cpu_cfg_fields.h.inc
target/riscv/csr.c
target/riscv/machine.c
target/riscv/pmp.c